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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="com.redmoon.oa.dept.*" %>
  3. <%@ page import="cn.js.fan.web.*" %>
  4. <%@ page import="cn.js.fan.util.*" %>
  5. <%@ page import="java.util.*" %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <title>职位-员工</title>
  11. <LINK href="default.css" type=text/css rel=stylesheet>
  12. </head>
  13. <body>
  14. <%
  15. String postCode = ParamUtil.get(request, "postCode");
  16. if (postCode.equals("")) {
  17. // out.print(StrUtil.Alert("对不起,请选择某个职位!"));
  18. return;
  19. }
  20. PostDb post = new PostDb();
  21. post = post.getPostDb(postCode);
  22. if (post==null || !post.isLoaded()) {
  23. out.print(SkinUtil.makeErrMsg(request, "职位" + postCode + "不存在!"));
  24. return;
  25. }
  26. String op = ParamUtil.get(request, "op");
  27. if (op.equals("add")) {
  28. try {
  29. PostUserMgr pum = new PostUserMgr();
  30. if (pum.add(request))
  31. out.print(StrUtil.Alert("添加成功!"));
  32. }
  33. catch (ErrMsgException e) {
  34. out.print(StrUtil.Alert(e.getMessage()));
  35. }
  36. }
  37. if (op.equals("del")) {
  38. try {
  39. PostUserMgr pum = new PostUserMgr();
  40. if (pum.del(request))
  41. out.print(StrUtil.Alert("删除成功!"));
  42. }
  43. catch (ErrMsgException e) {
  44. out.print(StrUtil.Alert(e.getMessage()));
  45. }
  46. }
  47. if (op.equals("modify")) {
  48. try {
  49. PostUserMgr jm = new PostUserMgr();
  50. if (jm.modify(request))
  51. out.print(StrUtil.Alert("修改成功!"));
  52. }
  53. catch (ErrMsgException e) {
  54. out.print(StrUtil.Alert(e.getMessage()));
  55. }
  56. }
  57. %>
  58. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  59.   <tr>
  60.     <td>
  61. <select name="deptCode">
  62. <%
  63. DeptDb rootlf = new DeptDb();
  64. rootlf = rootlf.getDeptDb(DeptDb.ROOTCODE);
  65. DeptView dv = new DeptView(rootlf);
  66. dv.ShowDeptAsOptions(out, rootlf, rootlf.getLayer());
  67. %>
  68. </select>
  69. </td>
  70.   </tr>
  71. </table>
  72. <table width="444" border="0" align="left" cellpadding="0" cellspacing="1" class="frame_gray" style="height:100%">
  73.   <tr>
  74.     <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  75.       <tr>
  76.         <td height="24" align="center" bgcolor="#88B5FF"><%=post.getName()%>职位的员工</td>
  77.       </tr>
  78.     </table>
  79.       <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
  80.       <tr>
  81.         <td height="24" align="center" bgcolor="#C4DAFF">用户</td>
  82.         <td height="24" colspan="3" align="center" bgcolor="#C4DAFF">操作</td>
  83.         </tr>
  84.       <%
  85. PostUserDb jd = new PostUserDb();
  86. Vector v = jd.list(postCode);
  87. Iterator ir = v.iterator();
  88. while (ir.hasNext()) {
  89. PostUserDb pu = (PostUserDb)ir.next();
  90. %>
  91.       <tr>
  92.         <td width="53%" height="22"><%=pu.getName()%></td>
  93.         <td width="16%" height="22"><a target="_parent" href="user_edit.jsp?name=<%=StrUtil.UrlEncode(pu.getName())%>">修改</a></td>
  94.         <td width="15%" height="22">&nbsp;</td>
  95.         <td width="16%" height="22"><a href="?op=del&id=<%=pu.getId()%>&postCode=<%=StrUtil.UrlEncode(postCode)%>">删除</a></td>
  96.       </tr>
  97.       <%}%>
  98.     </table>
  99.       <br>
  100.       <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  101.         <form name="form1" method="post" action="post_employee.jsp">
  102.           <tr>
  103.             <td height="24" colspan="2" align="center" bgcolor="#C4DAFF">添加职位中的用户</td>
  104.           </tr>
  105.           <tr>
  106.             <td width="32%" height="22" align="center"> 职&nbsp;&nbsp;&nbsp;&nbsp;位 </td>
  107.             <td width="68%" align="left"><%=post.getName()%>
  108.               <input type=hidden name="code" value="<%=postCode%>">
  109.               <input name="op" value="add" type=hidden></td>
  110.           </tr>
  111.           <tr>
  112.             <td height="22" align="center">用户名</td>
  113.             <td height="22" align="left"><input name="name" class="singleboarder" value="" size="16">
  114.               <input name="postCode" value="<%=postCode%>" type=hidden></td>
  115.           </tr>
  116.           <tr>
  117.             <td height="15" colspan="2" align="center"> </td>
  118.           </tr>
  119.           <tr>
  120.             <td height="22" colspan="2" align="center"><input name="Submit" type="submit" class="singleboarder" value="添加">
  121. &nbsp;&nbsp;&nbsp;
  122.         <input name="Submit" type="reset" class="singleboarder" value="重置">            </td>
  123.           </tr>
  124.         </form>
  125.     </table></td>
  126.   </tr>
  127. </table>
  128. </body>
  129. </html>