Ejemplo n.º 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");
 }
Ejemplo n.º 2
0
 public ActionForward upddoginfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   DoginfoDAO dao = (DoginfoDAO) NLLDDAOTool.getBean("doginfoDAO");
   DoginfoForm cform = (DoginfoForm) form;
   int id = StringUtil.getId(request, "id");
   try {
     DoginfoObj obj = dao.findDoginfoObjById(id);
     cform.setObj(obj);
   } catch (Exception e) {
     request.setAttribute("myerror", e.getMessage());
     e.printStackTrace();
   }
   return mapping.findForward("upddoginfo");
 }