Package org.sis.ancmessaging.domain

Examples of org.sis.ancmessaging.domain.HealthPost


  }
 
  @RequestMapping(value = "create", method = RequestMethod.POST)
  public String createWorker(HealthWorkerDTO healthWorkerDTO, BindingResult result, Model model) {
    if (result.hasErrors()) {
      HealthPost healthPost = healthPostService.findById(healthWorkerDTO.getPostId());
      model.addAttribute("healthPost", healthPost);
      List<Gott> gotts = healthPost.getGotts();
      model.addAttribute("gotts", gotts);
      model.addAttribute("healthWorkerDTO", healthWorkerDTO);
      return "/admin/healthpost/entries?pid=" + healthWorkerDTO.getPostId();
    } else {
      HealthExtensionWorker healthWorker = healthWorkerDTO.generateHealthWorker();
      healthWorker.setPhoneNumber("+251" + healthWorker.getPhoneNumber());
      HealthPost healthPost = healthPostService.findById(healthWorkerDTO.getPostId());
      healthPostService.addHwToHp(healthWorker, healthPost);
      return "redirect:/admin/healthpost/entries?pid=" + healthWorkerDTO.getPostId();
    }
   
  }
View Full Code Here


    HealthExtensionWorker healthWorker = new HealthExtensionWorker();
    healthWorker.setFullName(fullName);
    healthWorker.setPhoneNumber("+251" + phoneNumber);
    healthWorker.setSex(sex);
   
    HealthPost healthPost = healthPostService.findById(postId);
   
    healthPostService.addHwToHp(healthWorker, healthPost);
  }
View Full Code Here

    return response;
  }
 
  @RequestMapping(value = "gethealthworkersajax", method = RequestMethod.GET)
  public @ResponseBody List<HealthWorkerDTO> fetchHealthWorkersAjax(@RequestParam("postId") int postId) {
    HealthPost healthPost = healthPostService.findById(postId);
    List<HealthExtensionWorker> healthWorkers = healthPost.getHealthWorkers();
    List<HealthWorkerDTO> healthWorkerDTO = new ArrayList<HealthWorkerDTO>();
    for (HealthExtensionWorker healthWorker : healthWorkers) {
      HealthWorkerDTO hDTO = new HealthWorkerDTO();
      hDTO.setWorkerId(healthWorker.getWorkerId());
      hDTO.setFullName(healthWorker.getFullName());
View Full Code Here

  public void setPostName(String postName) {
    this.postName = postName;
  }

  public HealthPost generateHealthPost() {
    HealthPost healthPost = new HealthPost();
    healthPost.setPostId(postId);
    healthPost.setPostName(postName);
    healthPost.setKebele(kebele);
    return healthPost;
  }
View Full Code Here

  }
 
  @RequestMapping(value = "create", method = RequestMethod.POST)
  public String createTransporter(TransporterDTO transporterDTO, BindingResult result, Model model) {
    if (result.hasErrors()) {
      HealthPost healthPost = healthPostService.findById(transporterDTO.getPostId());
      model.addAttribute("healthPost", healthPost);
      List<Gott> gotts = healthPost.getGotts();
      model.addAttribute("gotts", gotts);
      model.addAttribute("transporterDTO", transporterDTO);
      return "/admin/healthpost/entries?pid=" + transporterDTO.getPostId();
    } else {
      Transporter transporter = transporterDTO.generateTransporter();
      transporter.setPhoneNumber("+251" + transporter.getPhoneNumber());
      HealthPost healthPost = healthPostService.findById(transporterDTO.getPostId());
      healthPostService.addTransporterToHp(transporter, healthPost);
      return "redirect:/admin/healthpost/entries?pid=" + transporterDTO.getPostId();
    }
   
  }
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.