Package org.sis.ancmessaging.domain

Examples of org.sis.ancmessaging.domain.HealthPost


      model.addAttribute("healthPosts", healthPostService.getAll());
      model.addAttribute("gottDTO", gottDTO);
      return "gott";
    } else {
      Gott gott = gottDTO.generateGott();
      HealthPost healthPost = healthPostService.findById(gottDTO.getPostId());
      healthPostService.addGottToHp(gott, healthPost);
      return "redirect:/healthpost/entries?pid=" + gottDTO.getPostId();
    }
   
  }
View Full Code Here


 
  @RequestMapping(value = "createajax", method = RequestMethod.POST)
  public @ResponseBody List<GottDTO> createGott(@RequestParam("postId") int postId, @RequestParam("gottName") String gottName) {
    Gott gott = new Gott();
    gott.setGottName(gottName);
    HealthPost healthPost = healthPostService.findById(postId);
    healthPostService.addGottToHp(gott, healthPost);
    List<Gott> gotts = healthPostService.getAllGottsForHealthPost(postId);
    List<GottDTO> gottDTOs = new ArrayList<GottDTO>();
    for (Gott g : gotts) {
      GottDTO gDTO = new GottDTO();
View Full Code Here

    return response;
  }
 
  @RequestMapping(value = "getgottsajax", method = RequestMethod.GET)
  public @ResponseBody List<GottDTO> fetchGottsAjax(@RequestParam("postId") int postId) {
    HealthPost healthPost = healthPostService.findById(postId);
    List<Gott> gotts = healthPost.getGotts();
    List<GottDTO> gottDTOs = new ArrayList<GottDTO>();
    for (Gott gott : gotts) {
      GottDTO gDTO = new GottDTO();
      gDTO.setGottId(gott.getGottId());
      gDTO.setGottName(gott.getGottName());
View Full Code Here

  }

    @SuppressWarnings("unchecked")
  @Override
  public List<HealthExtensionWorker> getPaginatedList(int postId, int rows, int page, StringBuilder sb) {
    HealthPost healthPost = (HealthPost) getSession().createCriteria(HealthPost.class)
                               .add(Restrictions.eq("postId", postId))
                               .uniqueResult();
    int total = healthPost.getHealthWorkers().size();
    int totalPages;
    if (total <= rows) {
      totalPages = 1;
    } else {
      totalPages = total / rows;
View Full Code Here

  }
 
  @SuppressWarnings("unchecked")
  @Override
  public List<Transporter> getPaginatedList(int postId, int rows, int page, StringBuilder sb) {
    HealthPost healthPost = (HealthPost) getSession().createCriteria(HealthPost.class)
                               .add(Restrictions.eq("postId", postId))
                               .uniqueResult();
    int total = healthPost.getTransporters().size();
    int totalPages;
    if (total <= rows) {
      totalPages = 1;
    } else {
      totalPages = total / rows;
View Full Code Here

    return "healthpost";
  }
 
  @RequestMapping(value = "entries", method = RequestMethod.GET)
  public String getEntriesPage(@RequestParam("pid") int postId, Model model) {
    HealthPost healthPost = healthPostService.findById(postId);
    model.addAttribute("healthPost", healthPost);
    List<Gott> gotts = healthPost.getGotts();
    model.addAttribute("gotts", gotts);

    Map<Integer, String> gottList = new HashMap<Integer, String>();
    for (Gott gott : gotts) {
      gottList.put(gott.getGottId(), gott.getGottName());
View Full Code Here

    if (result.hasErrors()) {
      model.addAttribute("healthCenter", healthCenterService.findById(healthPostDTO.getCenterId()));
      model.addAttribute("healthPostDTO", healthPostDTO);
      return "healthpost";
    } else {
      HealthPost healthPost = healthPostDTO.generateHealthPost();
      HealthCenter healthCenter = healthCenterService.findById(healthPostDTO.getCenterId());
      healthCenterService.addHpToHc(healthCenter, healthPost);
      return "redirect:/admin/healthpost?pid=" + healthPostDTO.getCenterId();
    }
   
View Full Code Here

  @RequestMapping(value = "edithealthpost", method = RequestMethod.POST)
  public @ResponseBody CustomGenericResponse editPost(
    @RequestParam("postId") int postId,  @RequestParam("postName") String postName,
    @RequestParam("kebele") String kebele) {
   
    HealthPost healthPost = healthPostService.findById(postId);
    healthPost.setPostName(postName);
    healthPost.setKebele(kebele);
   
    boolean result = healthPostService.persist(healthPost);
    CustomGenericResponse response = new CustomGenericResponse();
   
    if (result) {
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public List<Gott> getPaginatedList(int postId, int rows, int page, StringBuilder sb) {
    HealthPost healthPost = (HealthPost) getSession().createCriteria(HealthPost.class)
                               .add(Restrictions.eq("postId", postId))
                               .uniqueResult();
    int total = healthPost.getGotts().size();
    int totalPages;
    if (total <= rows) {
      totalPages = 1;
    } else {
      totalPages = total / rows;
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public List<Gott> getAllGottsForHealthPost(int postId) {
    HealthPost healthPost = (HealthPost) getSession().createCriteria(HealthPost.class)
                            .add(Restrictions.eq("postId", postId))
                            .uniqueResult();
    Criteria criteria = getSession().createCriteria(Gott.class)
                    .add(Restrictions.eq("healthPost", healthPost))
                    .addOrder(Order.asc("gottName"));
View Full Code Here

TOP

Related Classes of org.sis.ancmessaging.domain.HealthPost

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.