Package org.sis.ancmessaging.domain

Examples of org.sis.ancmessaging.domain.Gott


   
  }
 
  @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) {
View Full Code Here


 
  @RequestMapping(value = "editgott", method = RequestMethod.POST)
  public @ResponseBody CustomGenericResponse editGott(
    @RequestParam("gottId") int gottId,  @RequestParam("gottName") String gottName) {
   
    Gott gott = healthPostService.findGottById(gottId);
    gott.setGottName(gottName);
   
    boolean result = healthPostService.persistGott(gott);
    CustomGenericResponse response = new CustomGenericResponse();
   
    if (result) {
View Full Code Here

    getSession().update(gare);
  }

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

    return criteria.list();
  }

  @Override
  public List<Gare> getAllGaresForGott(int gottId) {
    Gott gott = (Gott) getSession().createCriteria(Gott.class)
        .add(Restrictions.eq("gottId", gottId))
        .uniqueResult();
    Criteria criteria = getSession().createCriteria(Gare.class)
        .add(Restrictions.eq("gott", gott))
        .addOrder(Order.asc("gareName"));
View Full Code Here

  public void setPostId(int postId) {
    this.postId = postId;
  }
 
  public Gott generateGott() {
    Gott gott = new Gott();
    gott.setGottId(gottId);
    gott.setGottName(gottName);
    return gott;
  }
View Full Code Here

      model.addAttribute("gareDTO", gareDTO);
      return "gott";
    } else {
      Gare gare = gareDTO.generateGare();
      Gott gott = healthPostService.findGottById(gareDTO.getGareGottId());
      healthPostService.addGareToGott(gare, gott);
      return "redirect:/healthpost/entries?pid=" + gott.getHealthPost().getPostId();
    }

  }
View Full Code Here

  public @ResponseBody
  List<GareDTO> createGare(@RequestParam("gareId") int gareId, @RequestParam("gareName") String gareName,
                           @RequestParam("gareGottId") int gareGottId) {
    Gare gare = new Gare();
    gare.setGareName(gareName);
    Gott gott = healthPostService.findGottById(gareGottId);
    healthPostService.addGareToGott(gare, gott);
    List<Gare> gares = healthPostService.getAllGaresForGott(gareGottId);
    List<GareDTO> gareDTOs = new ArrayList<GareDTO>();
    for (Gare g : gares) {
      GareDTO gDTO = new GareDTO();
View Full Code Here

    if (result.hasErrors()) {
      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

TOP

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

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.