editExc.jsp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  3. <%@ page language="java"
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpConstantImpl,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.sysmodel.datamodel.xmlmanager.xmlobjdll.SysModeldllable,
  8. com.sysmodel.datamodel.xmlmanager.xmlobjdll.SysModeldllimpl"%>
  9. <%
  10. String name = request.getParameter("name") == null ? "0" : request.getParameter("name");
  11. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  12. System.out.println("action="+action);
  13. System.out.println("name="+name);
  14. MdpConstantImpl MdpConstantImpl = new MdpConstantImpl();
  15. SysModeldllable SysModeldllable = new SysModeldllimpl();
  16. if(action.equals("save") || action.equals("edit")) {
  17. String type = request.getParameter("type") == null ? "" : request.getParameter("type");
  18. String description = request.getParameter("description") == null ? "" : request.getParameter("description");
  19. String TemplateName = request.getParameter("TemplateName") == null ? "" : request.getParameter("TemplateName");
  20. String RootFrom = request.getParameter("RootFrom") == null ? "" : request.getParameter("RootFrom");
  21. String DataSource = request.getParameter("DataSource") == null ? "" : request.getParameter("DataSource");
  22. String isKeyCodeAuto = request.getParameter("isKeyCodeAuto") == null ? " " : request.getParameter("isKeyCodeAuto");
  23. String OrderProperty = request.getParameter("OrderProperty") == null ? "" : request.getParameter("OrderProperty");
  24. String OrderMethod = request.getParameter("OrderMethod") == null ? "" : request.getParameter("OrderMethod");
  25. MdpConstantImpl.setCodeName(name);
  26. MdpConstantImpl.setDescription(description);
  27. MdpConstantImpl.setTemplateName(TemplateName);
  28. MdpConstantImpl.setRootFrom(RootFrom);
  29. MdpConstantImpl.setDataSource(new Integer(DataSource));
  30. MdpConstantImpl.setKeyCodeAuto(Boolean.valueOf(isKeyCodeAuto).booleanValue());
  31. MdpConstantImpl.setOrderProperty(OrderProperty);
  32. MdpConstantImpl.setOrderMethod(OrderMethod);
  33. MdpConstantImpl.setType(type);
  34. if(action.equals("save")){
  35. SysModeldllable.addConstant(MdpConstantImpl);
  36. System.out.println("保存成功!!!");
  37. }else if (action.equals("edit")){
  38. SysModeldllable.updateConstant(MdpConstantImpl,name);
  39. System.out.println("修改成功!!!");
  40. }
  41. response.sendRedirect("edit.jsp?name="+name+"&refreshNode=true");
  42. }
  43. else if (action.equals("del")){
  44. SysModel sysmodel = ModelFactory.getSysmodel();
  45. MdpConstantImpl=(MdpConstantImpl)sysmodel.getMdpConstantByName(name);
  46. String type = MdpConstantImpl.getType();
  47. SysModeldllable.deleteConstant(MdpConstantImpl);
  48. System.out.println("删除成功!!!");
  49. response.sendRedirect("list.jsp?refreshNode=true&type="+type);
  50. }
  51. %>