/**
   * 연계기관을 등록한다.
   *
   * @param loginVO
   * @param cntcInstt
   * @param bindingResult
   * @param model
   * @return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist"
   * @throws Exception
   */
  @RequestMapping(value = "/ssi/syi/iis/addCntcInstt.do")
  public String insertCntcInstt(
      @ModelAttribute("cntcInstt") CntcInstt cntcInstt,
      BindingResult bindingResult,
      @RequestParam Map<?, ?> commandMap,
      ModelMap model)
      throws Exception {
    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {

      return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist";
    } else if (sCmd.equals("Regist")) {

      beanValidator.validate(cntcInstt, bindingResult);
      if (bindingResult.hasErrors()) {

        return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist";
      }

      // 로그인VO에서  사용자 정보 가져오기
      LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
      String uniqId = loginVO.getUniqId();
      cntcInstt.setFrstRegisterId(uniqId);

      // ID Generation
      String sInsttId = idgenService.getNextStringId();
      cntcInstt.setInsttId(sInsttId);

      cntcInsttService.insertCntcInstt(cntcInstt);

      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    } else {
      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    }
  }
  /**
   * 연계기관을 수정한다.
   *
   * @param loginVO
   * @param cntcInstt
   * @param bindingResult
   * @param commandMap
   * @param model
   * @return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt"
   * @throws Exception
   */
  @RequestMapping(value = "/ssi/syi/iis/updateCntcInstt.do")
  public String updateCntcInstt(
      @ModelAttribute("cntcInstt") CntcInstt cntcInstt,
      BindingResult bindingResult,
      @RequestParam Map<?, ?> commandMap,
      ModelMap model)
      throws Exception {
    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {
      CntcInstt vo = cntcInsttService.selectCntcInsttDetail(cntcInstt);
      model.addAttribute("cntcInstt", vo);

      return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt";
    } else if (sCmd.equals("Modify")) {
      beanValidator.validate(cntcInstt, bindingResult);
      if (bindingResult.hasErrors()) {
        CntcInstt vo = cntcInsttService.selectCntcInsttDetail(cntcInstt);
        model.addAttribute("cntcInstt", vo);

        return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt";
      }

      // 로그인VO에서  사용자 정보 가져오기
      LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
      String uniqId = loginVO.getUniqId();

      cntcInstt.setLastUpdusrId(uniqId);
      cntcInsttService.updateCntcInstt(cntcInstt);
      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    } else {
      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    }
  }