user_admin_department_do.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:2k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=gb2312"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <html>
  4. <head>
  5. <title>增加日程</title>
  6. <%@ include file="../inc/nocache.jsp"%>
  7. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  8. <link rel="stylesheet" href="common.css" type="text/css">
  9. <script language="javascript">
  10. <!--
  11. //-->
  12. </script>
  13. </head>
  14. <body bgcolor="#FFFFFF" text="#000000">
  15. <%@ include file="../inc/inc.jsp"%>
  16. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  17. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  18. <%
  19. String priv="admin";
  20. if (!privilege.isUserPrivValid(request,priv))
  21. {
  22. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  23. return;
  24. }
  25. String op = fchar.getNullStr(request.getParameter("op"));
  26. String name = fchar.UnicodeToGB(fchar.getNullStr(request.getParameter("name")));
  27. String department_id = fchar.getNullStr(request.getParameter("department_id"));
  28. String sql = "";
  29. if (op.equals("setadmin"))
  30. {
  31. sql = "insert user_admin_department (name,department_id) values ("+fchar.sqlstr(name)+","+department_id+")";
  32. }
  33. else if (op.equals("deladmin"))
  34. {
  35. sql = "delete user_admin_department where name="+fchar.sqlstr(name)+" and department_id="+department_id;
  36. }
  37. else
  38. {
  39. out.println(fchar.Alert("缺少操作符!"));
  40. return;
  41. }
  42. %>
  43. <jsp:useBean id="conn" scope="page" class="com.redmoon.oa.db.Conn"/>
  44. <jsp:setProperty name="conn" property="POOLNAME" value="ttoa"/>
  45. <%
  46. if (conn.executeUpdate(sql)>0)
  47. {
  48. out.println(fchar.Alert_Back("操作成功!"));
  49. }
  50. else
  51. {
  52. out.println(fchar.Alert_Back("操作失败!"));
  53. }
  54. if (conn!=null)
  55. {
  56. conn.close();
  57. conn = null;
  58. }
  59. %>
  60. </body>
  61. </html>