예제 #1
0
 /** *********狗登记信息管理************ */
 public ActionForward doginfolist(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   DoginfoDAO dao = (DoginfoDAO) NLLDDAOTool.getBean("doginfoDAO");
   DoginfoForm cform = (DoginfoForm) form;
   DoginfoObj obj = cform.getObj();
   try {
     StringBuffer wheresql = new StringBuffer(" ");
     if (StringUtil.sfYz(obj.getName())) {
       wheresql.append(" and name = '" + obj.getName() + "'");
     }
     if (StringUtil.sfYz(obj.getMaster())) {
       wheresql.append(" and master = '" + obj.getMaster() + "'");
     }
     //			List list = dao.findAllDoginfoObjList();
     List list = dao.findAllDoginfoObjByCon(wheresql.toString());
     request.setAttribute("list", list);
   } catch (Exception e) {
     request.setAttribute("myerror", e.getMessage());
     e.printStackTrace();
   }
   return mapping.findForward("doginfolist");
 }
예제 #2
0
 public ActionForward upddoginfosave(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   DoginfoDAO dao = (DoginfoDAO) NLLDDAOTool.getBean("doginfoDAO");
   DoginfoForm cform = (DoginfoForm) form;
   DoginfoObj obj = cform.getObj();
   try {
     String[][] attrs = {{"name", "String", obj.getName()}};
     dao.updDoginfoObj(obj.getId(), attrs);
     request.setAttribute("myerror", "修改成功!");
   } catch (Exception e) {
     request.setAttribute("myerror", e.getMessage());
     e.printStackTrace();
   }
   return doginfolist(mapping, form, request, response);
 }