@Override
 public String deleteCustomer(HttpServletRequest request, UserDetail userDetails)
     throws Exception {
   int compId = 0;
   String result = "";
   try {
     if (request.getParameter("compIdToDel") != null
         && request.getParameter("compIdToDel") != "") {
       compId = Integer.parseInt(request.getParameter("compIdToDel").trim());
       result = customerDetailsDAO.setCustomerDelete(compId);
       result = addressDetailsDAO.setDeleteAddressByUser(compId, userDetails);
     } else {
       result = "Cannot Find The Company To Delete. Please refresh the page and try again.";
     }
     return result;
   } catch (Exception e) {
     e.printStackTrace();
     throw e;
   }
 }
コード例 #2
0
 @RequestMapping(value = "/deleteAddress", method = RequestMethod.POST)
 @ResponseBody
 public String deleteAddress(
     HttpSession session,
     HttpServletRequest request,
     @RequestParam(value = "moduleId") String jobId) {
   HashMap<Object, Object> resultMap = new HashMap<Object, Object>();
   try {
     Integer moduleId = null;
     if (null != jobId && !jobId.trim().isEmpty()) {
       moduleId = Integer.valueOf(jobId);
       UserDetail userDetails = (UserDetail) session.getAttribute("selectedUser");
       String result = addressDetailsDAO.setDeleteAddressByUser(moduleId, userDetails);
       resultMap = util.responseBuilder(result);
     }
   } catch (Exception e) {
     e.printStackTrace();
     util.handleException(resultMap, e);
   }
   return util.getJsonResult(resultMap);
 }