Exemplo n.º 1
0
 @Override
 public RequestForm mapRow(ResultSet rs, int rowNum) throws SQLException {
   RequestForm requestForm = new RequestForm();
   requestForm.setRequestFormId(rs.getLong("request_form_id"));
   requestForm.setRequestCSNo(rs.getString("request_cs_no"));
   requestForm.setRequestFormStatus(rs.getString("request_form_status"));
   requestForm.setRequestDate(rs.getDate("request_date"));
   return requestForm;
 }
Exemplo n.º 2
0
  @RequestMapping(value = "/edit.htm", method = RequestMethod.POST)
  public ModelAndView edit(@ModelAttribute RequestForm requestForm, BindingResult result) {
    logger.info(" Start edit Post ");
    ModelAndView mav = new ModelAndView();

    try {
      requestForm = new RequestFormValidator().validate(requestForm, result);
      if (result.hasErrors()) {
        mav.setViewName("peaMeterForm");
      } else {

        requestForm.setRequestFormStatus(BuckwaConstants.END_STATUS);

        peaMeterService.insertMeter(requestForm);
        mav.addObject("requestFormList", peaMeterService.queryIdForMeterList());
        mav.setViewName("peaMeterIndex");
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return mav;
  }