EditUser.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:7k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <%
  5. Request m_request = new Request(request);
  6. int iUserID = m_request.GetInt("ID");
  7. int iDepartmentID = m_request.GetInt("DepartmentID");
  8. if(iUserID<1)
  9. {
  10. %>
  11. <script language="JavaScript" type="text/JavaScript">
  12. alert("请选择正确的用户,修改失败!");
  13. history.back();
  14. </script>
  15. <%
  16. }
  17. else
  18. {
  19. Vector vt = UserManager.getUserInfoByID(iUserID);
  20. %>
  21. <html>
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  24. <title>用户管理-- GForce OA 2.0</title>
  25. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  26. <script language="JavaScript" src="/js/changestyle.js"></script>
  27. <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  28. <script language="JavaScript" type="text/javascript">
  29. function checkEditUser()
  30. {
  31.     if(document.edituser.DepartmentID.value=="")
  32.     {
  33.         alert("请选择所属部门!");
  34.         document.edituser.DepartmentID.focus();
  35.         return false;
  36.     }
  37.     if(document.edituser.PersonnelID.value=="0")
  38.     {
  39.         alert("请选择员工姓名!");
  40.         document.edituser.PersonnelID.focus();
  41.         return false;
  42.     }
  43.     if(document.edituser.UserName.value=="")
  44.     {
  45.         alert("请输入用户名称!");
  46.         document.edituser.UserName.focus();
  47.         return false;
  48.     }
  49.     if(document.edituser.Password.value=="")
  50.     {
  51.         alert("输入用户密码!");
  52.         document.edituser.Password.focus();
  53.         return false;
  54.     }
  55.     if(document.edituser.Password1.value=="")
  56.     {
  57.         alert("输入确认密码!");
  58.         document.edituser.Password1.focus();
  59.         return false;
  60.     }
  61.     if(document.edituser.Password.value!=document.edituser.Password1.value)
  62.     {
  63.         alert("用户密码和确认密码不一致,请重新填写密码!");
  64.         document.edituser.Password.value="";
  65.         document.edituser.Password1.value="";
  66.         document.edituser.Password.focus();
  67.         return false;
  68.     }
  69.     if(document.edituser.RoleID.value=="0")
  70.     {
  71.         alert("请选择用户角色!");
  72.         document.edituser.RoleID.focus();
  73.         return false;
  74.     }
  75. }
  76. var arrayPersonnel = new Array();
  77. <%
  78. Vector vPersonnel = PersonnelManager.getFreePersonnels(iUserID);
  79. for(int i=0;i<vPersonnel.size();i++)
  80. {
  81.     out.println("arrayPersonnel["+ i +"]=new Array("" + ((Vector)vPersonnel.get(i)).get(0).toString() + "","" + ((Vector)vPersonnel.get(i)).get(1).toString() + "","" + ((Vector)vPersonnel.get(i)).get(13).toString() + "");");
  82. }
  83. %>
  84. function addPersonnel()
  85. {
  86.     with(document.edituser)
  87.     {
  88.     PersonnelID.length=1;
  89.     PersonnelID.selectedIndex=0;
  90.     for(var i=0;i < arrayPersonnel.length;i++)
  91.     {
  92.        if(arrayPersonnel[i][2]==DepartmentID.value)
  93.         {
  94.             var oOption = document.createElement("OPTION");
  95.             PersonnelID.options.add(oOption);
  96.             oOption.innerText = arrayPersonnel[i][1];
  97.             oOption.value = arrayPersonnel[i][0];
  98.             if(arrayPersonnel[i][0]=="<%=((Vector)vt.get(0)).get(3).toString()%>")
  99.                 oOption.selected = true;
  100.         }
  101.     }
  102.     }
  103. }
  104. </script>
  105. </head>
  106. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0" onload="javascript:addPersonnel();">
  107. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  108.     <tr>
  109.         <td align="center" valign="top"><p>&nbsp;</p>
  110.             <form name="edituser" action="EditUserAction.jsp" method="post" onSubmit="javascript:return checkEditUser();">
  111.         <table width="95%"  border="1" align="center" cellpadding="0" cellspacing="0">
  112.           <tr height="100">
  113.             <td width="22%" align="right" valign="middle" nowrap><font color="#0A0A0A">所属部门:</font></td>
  114.             <td width="78%" align="left" valign="middle" nowrap>
  115.                 <input type="hidden" name="DepartmentID" id="DepartmentID" value="<%=iDepartmentID%>" onpropertychange="javascript:addPersonnel();">
  116.                     <iframe id="SelectDepartment" frameborder=1 src="/SelectDepartment.jsp" width="100%" height="100%" scrolling="auto"></iframe>
  117.             </td>
  118.           </tr>
  119.           <tr>
  120.             <td align="right" valign="middle"><font color="#0A0A0A">员工姓名:</font></td>
  121.             <td align="left" valign="middle" nowrap> <select name="PersonnelID">
  122.                 <option value="0">请先选择所属部门再选择员工</option>
  123.               </select> </td>
  124.           </tr>
  125.           <tr>
  126.             <td align="right" valign="middle"><font color="#0A0A0A">用户名称:</font></td>
  127.             <td align="left" valign="middle" nowrap> <input name="UserName" type="text" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
  128.                  <input name="ID" type="Hidden" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(0).toString()%>">
  129.             </td>
  130.           </tr>
  131.           <tr>
  132.             <td align="right" valign="middle"><font color="#0A0A0A">用户密码:</font></td>
  133.             <td align="left" valign="middle" nowrap><input name="Password" type="Password" value="<%=StringNew.getDisencodePassword(((Vector)vt.get(0)).get(2).toString())%>">
  134.             </td>
  135.           </tr>
  136.           <tr>
  137.             <td align="right" valign="middle"><font color="#0A0A0A">确认密码:</font></td>
  138.             <td align="left" valign="middle" nowrap><input name="Password1" type="Password" value="<%=StringNew.getDisencodePassword(((Vector)vt.get(0)).get(2).toString())%>">
  139.             </td>
  140.           </tr>
  141.           <tr>
  142.             <td align="right" valign="middle"><font color="#0A0A0A">用户角色:</font></td>
  143.             <td align="left" valign="middle" nowrap> <select name="RoleID">
  144.                 <option value="0">请选择用户角色</option>
  145.                 <%
  146. //检索要选择的用户角色
  147. Vector vRole = RoleManager.getAllRecord();
  148. for(int i=0;i<vRole.size();i++)
  149. {
  150.     if(((Vector)vRole.get(i)).get(0).toString().equalsIgnoreCase(((Vector)vt.get(0)).get(4).toString()))
  151.     {
  152.         out.println("<option value="" + ((Vector)vRole.get(i)).get(0).toString() + "" selected>" + ((Vector)vRole.get(i)).get(1).toString() + "</option>");
  153.     }
  154.     else
  155.     {
  156.         out.println("<option value="" + ((Vector)vRole.get(i)).get(0).toString() + "">" + ((Vector)vRole.get(i)).get(1).toString() + "</option>");
  157.     }
  158. }
  159. %>
  160.               </select> </td>
  161.           </tr>
  162.           <tr>
  163.             <td align="right" valign="middle">&nbsp;</td>
  164.             <td align="left" valign="middle" nowrap> <input type="submit" value="修改">
  165.               &nbsp;&nbsp; <input type="reset" value="重填"> &nbsp;&nbsp; <input type="button" value="返回" onclick="window.location='UserManage.jsp';">
  166.             </td>
  167.           </tr>
  168.         </table>
  169.             </form>
  170.         </td>
  171. <!--  去掉右边图片   马登军2003年6月3日
  172. -->
  173.     </tr>
  174. </table>
  175. </body>
  176. </html>
  177. <%
  178. }
  179. %>