dept_user_edit.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="com.redmoon.oa.basic.*" %>
  4. <%@ page import="com.redmoon.oa.person.*" %>
  5. <%@ page import="cn.js.fan.web.*" %>
  6. <%@ page import="cn.js.fan.util.*" %>
  7. <%@ page import="java.util.*" %>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>职位-员工</title>
  13. <LINK href="default.css" type=text/css rel=stylesheet>
  14. <script>
  15. function setPerson(user, userRealName)
  16. {
  17. form1.userName.value = user;
  18. form1.userRealName.value = userRealName;
  19. }
  20. function openWin(url,width,height)
  21. {
  22.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=120,width="+width+",height="+height);
  23. }
  24. </script>
  25. </head>
  26. <body>
  27. <%
  28. String deptCode = ParamUtil.get(request, "deptCode");
  29. if (deptCode.equals(DeptDb.ROOTCODE)) {
  30. out.print(SkinUtil.makeErrMsg(request, "请选择某个部门!"));
  31. return;
  32. }
  33. DeptDb dd = new DeptDb();
  34. dd = dd.getDeptDb(deptCode);
  35. if (dd==null) {
  36. out.print(SkinUtil.makeErrMsg(request, "部门 " + deptCode + " 不存在!"));
  37. return;
  38. }
  39. int id = ParamUtil.getInt(request, "id");
  40. DeptUserDb du = new DeptUserDb();
  41. du = du.getDeptUserDb(id);
  42. UserDb ud = new UserDb();
  43. ud = ud.getUserDb(du.getUserName());
  44. String op = ParamUtil.get(request, "op");
  45. if (op.equals("modify")) {
  46. String userName = ParamUtil.get(request, "userName");
  47. String rank = ParamUtil.get(request, "rank");
  48. du.setUserName(userName);
  49. du.setRank(rank);
  50. if (du.save())
  51. out.print(StrUtil.Alert("操作成功!"));
  52. else
  53. out.print(StrUtil.Alert_Back("操作失败!"));
  54. du = du.getDeptUserDb(id);
  55. ud = ud.getUserDb(du.getUserName());
  56. }
  57. %>
  58. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="frame_gray" style="height:100%">
  59.   <tr>
  60.     <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  61.       <tr>
  62.         <td height="24" align="center" bgcolor="#88B5FF">
  63.   <a href="dept_user.jsp?deptCode=<%=StrUtil.UrlEncode(deptCode)%>"><%=dd.getName()%></a>&nbsp;的员工</td>
  64.       </tr>
  65.     </table>
  66.       <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  67.         <form name="form1" method="post" action="?op=modify">
  68.           <tr>
  69.             <td height="24" colspan="2" align="center" bgcolor="#C4DAFF">修改部门中的用户</td>
  70.           </tr>
  71.           <tr>
  72.             <td width="22%" height="22" align="center"> 部&nbsp;&nbsp;&nbsp;&nbsp;门 </td>
  73.             <td width="78%" align="left"><%=dd.getName()%>
  74.               <input type=hidden name="deptCode" value="<%=deptCode%>">
  75.               <input name="op" value="add" type=hidden>
  76.             <input name="id" value="<%=id%>" type=hidden></td>
  77.           </tr>
  78.           <tr>
  79.             <td height="22" align="center">用户名</td>
  80.             <td height="22" align="left">
  81. <%
  82. String userRealName = "";
  83. if (ud.isLoaded())
  84. userRealName = ud.getRealName();
  85. %>
  86. <input name="userName" value="<%=ud.getName()%>" size="16" type="hidden">
  87. <input name="userRealName" class="singleboarder" id="userRealName" size="18" readonly value="<%=userRealName%>">
  88. <a href="#" onClick="openWin('user_sel.jsp', 480, 320)">选择</a>&nbsp;<a href="#" onClick="form1.userName.value=''; form1.userRealName.value=''">清除</a>
  89. <input name="rank" class="singleboarder" value="" size="16" type="hidden"></td>
  90.           </tr>
  91.           
  92.           <tr>
  93.             <td height="22" colspan="2" align="center"><input name="Submit" type="submit" class="singleboarder" value="确定">
  94. &nbsp;&nbsp;&nbsp;
  95.         <input name="Submit" type="reset" class="singleboarder" value="重置">            </td>
  96.           </tr>
  97.         </form>
  98.     </table></td>
  99.   </tr>
  100. </table>
  101. </body>
  102. </html>