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

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 intDepartmentID = m_request.GetInt("ID");
  7. if(intDepartmentID<1)
  8. {
  9. %>
  10. <script language="JavaScript" type="text/JavaScript">
  11. alert("请选择正确的部门,修改失败!");
  12. history.back();
  13. </script>
  14. <%
  15. }
  16. else
  17. {
  18. Vector vt = DepartmentManager.getRecordByID(intDepartmentID);
  19. if(vt.size()==1)
  20. {
  21.     String sDepartmentID = ((Vector)vt.get(0)).get(2).toString();
  22.     sDepartmentID = sDepartmentID.substring(0,sDepartmentID.length()-1);
  23.     sDepartmentID = sDepartmentID.substring(sDepartmentID.lastIndexOf("_")+1);
  24. %>
  25. <html>
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  28. <title>部门器管理-- GForce OA 2.0</title>
  29. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  30. <script language="JavaScript" type="text/javascript">
  31. function checkEditDepartment()
  32. {
  33.     if(document.editdepartment.Name.value=="")
  34.     {
  35.         alert("请输入部门名称!");
  36.         document.editdepartment.Name.focus();
  37.         return false;
  38.     }
  39.     if(document.editdepartment.DepartmentID.value=="")
  40.     {
  41.         alert("请选择上级部门!");
  42.         self.SelectDepartment.document.SelectDepartment.Department[0].focus();
  43.         return false;
  44.     }
  45.     if(document.editdepartment.DepartmentID.value==document.editdepartment.ID.value)
  46.     {
  47.         alert("上级部门不能是该部门自己,请选择正确的上级部门!");
  48.         self.SelectDepartment.document.SelectDepartment.Department[0].focus();
  49.         return false;
  50.     }
  51.     document.editdepartment.OrderNumber.value=<%=((Vector)vt.get(0)).get(5).toString()%>;
  52. }
  53. function uploadimage(ImageBox,ImagePic)
  54. {
  55.     var ImageSrc=window.showModalDialog("/UploadFile.jsp","","status:no; resizable: no; help:no; dialogWidth:296px; dialogHeight:150px");
  56.     if(ImageSrc!=null&&ImageSrc!="")
  57.     {
  58.         ImageBox.value=ImageSrc;
  59.         ImagePic.src=ImageSrc;
  60.     }
  61.     return false;
  62. }
  63. </script>
  64. </head>
  65. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  66. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  67.     <tr>
  68.         <td align="center" valign="top"><p>&nbsp;</p>
  69.             <form name="editdepartment" action="EditDepartmentAction.jsp" method="post" onSubmit="javascript:return checkEditDepartment();">
  70.             <table  border="0" cellpadding="0" cellspacing="0" width="90%">
  71.                 <tr>
  72.                     <td align="right" valign="middle"><font color="#0A0A0A">部门名称:</font></td>
  73.                     <td align="left" valign="middle" nowrap>
  74.                         <input name="ID" type="hidden" maxlength="5" value="<%=((Vector)vt.get(0)).get(0).toString()%>">
  75.                         <input name="Name" type="text" maxlength="50" size="37" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
  76.                     </td>
  77.                 </tr>
  78.                 <tr>
  79.                     <td align="right" valign="top"><font color="#0A0A0A">上级部门:</font></td>
  80.                     <td align="left" valign="middle" nowrap>
  81.                         <iframe id="SelectDepartment" frameborder=1 src="SelectDepartment.jsp" width="100%" height="100%" scrolling="auto"></iframe>
  82.                     </td>
  83.                 </tr>
  84.                         <input name="Station" type="hidden" ID="Station" Value="<%=((Vector)vt.get(0)).get(2).toString()%>">
  85.                         <input name="LevelNumber" type="hidden" id="LevelNumber" value="<%=((Vector)vt.get(0)).get(3).toString()%>">
  86.                         <input name="ChildrenAcount" type="hidden" id="ChildrenAcount" value="<%=((Vector)vt.get(0)).get(4).toString()%>">
  87.                         <input name="OrderNumber" type="hidden" id="OrderNumber" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
  88.                         <input name="DepartmentID" type="hidden" id="DepartmentID" value="<%=sDepartmentID%>">
  89.                 <%
  90.                 String strOpenICO = ((Vector)vt.get(0)).get(6).toString();
  91.                 if(strOpenICO.trim().length()>1)
  92.                 {
  93.                 %>
  94.                 <tr>
  95.                     <td align="right" valign="middle"><font color="#0A0A0A">打开时的图标:</font></td>
  96.                     <td align="left" valign="middle" nowrap>
  97.                         <input name="OpenedICO" type="text" maxlength="50" size="20" value="<%=strOpenICO%>">
  98.                         <a href="" onclick="return uploadimage(document.editdepartment.OpenedICO,document.all.OpenedICOImg);"><font color="#0A0A0A"><img src="<%=strOpenICO%>" width="19" height="19" id="OpenedICOImg" align="absbottom" border="0">上传图片</font></a>
  99.                    </td>
  100.                 </tr>
  101.                 <%
  102.                 }
  103.                 else
  104.                 {
  105.                 %>
  106.                 <tr>
  107.                     <td align="right" valign="middle"><font color="#0A0A0A">打开时的图标:</font></td>
  108.                     <td align="left" valign="middle" nowrap>
  109.                         <input name="OpenedICO" type="text" maxlength="50" size="20">
  110.                         <a href="" onclick="return uploadimage(document.editdepartment.OpenedICO,document.all.OpenedICOImg);"><font color="#0A0A0A"><img src="/images/tree/folderopen.gif" width="19" height="19" id="OpenedICOImg" align="absbottom" border="0">上传图片</font></a>
  111.                    </td>
  112.                 </tr>
  113.                 <%
  114.                 }
  115.                 String strCloseICO = ((Vector)vt.get(0)).get(7).toString();
  116.                 if(strCloseICO.trim().length()>1)
  117.                 {
  118.                 %>
  119.                 <tr>
  120.                     <td align="right" valign="middle"><font color="#0A0A0A">关闭时的图标:</font></td>
  121.                     <td align="left" valign="middle" nowrap>
  122.                         <input name="CloseedICO" type="text" maxlength="50" size="20" value="<%=strCloseICO%>">
  123.                         <a href="" onclick="return uploadimage(document.editdepartment.CloseedICO,document.all.CloseedICOImg);"><font color="#0A0A0A"><img src="<%=strCloseICO%>" width="19" height="19" id="CloseedICOImg" align="absbottom" border="0">上传图片</font></a>
  124.                    </td>
  125.                 </tr>
  126.                 <%
  127.                 }
  128.                 else
  129.                 {
  130.                 %>
  131.                 <tr>
  132.                     <td align="right" valign="middle"><font color="#0A0A0A">关闭时的图标:</font></td>
  133.                     <td align="left" valign="middle" nowrap>
  134.                         <input name="CloseedICO" type="text" maxlength="50" size="20">
  135.                         <a href="" onclick="return uploadimage(document.editdepartment.CloseedICO,document.all.CloseedICOImg);"><font color="#0A0A0A"><img src="/images/tree/folderclosed.gif" width="19" height="19" id="CloseedICOImg" align="absbottom" border="0">上传图片</font></a>
  136.                    </td>
  137.                 </tr>
  138.                 <%
  139.                 }
  140.                 %>
  141.                         <input name="LinkUrl" type="hidden" value="">
  142.                         <input name="Target" type="hidden" value="">
  143.                         <input name="IsLink" type="hidden" value="0">
  144.                 <tr>
  145.                     <td align="right" valign="middle"><font color="#0A0A0A">部门简介:</font></td>
  146.                     <td align="left" valign="middle" nowrap>
  147.                         <input name="Content" type="text" maxlength="50" size="38" value="<%=((Vector)vt.get(0)).get(11).toString()%>">
  148.                    </td>
  149.                 </tr>
  150.                 <tr>
  151.                     <td align="right" valign="middle"><font color="#0A0A0A">是否显示:</font></td>
  152.                     <td align="left" valign="middle" nowrap>
  153.                         <font color="#0A0A0A"><input name="IsShow" type="radio" value="1"  <%=((Vector)vt.get(0)).get(12).toString().equalsIgnoreCase("true")?"checked":""%>>是&nbsp; <input name="IsShow" type="radio" value="0" <%=((Vector)vt.get(0)).get(12).toString().equalsIgnoreCase("false")?"checked":""%>>否</font>
  154.                    </td>
  155.                 </tr>
  156.                 <tr>
  157.                     <td align="right" valign="middle"><font color="#0A0A0A">&nbsp;</font></td>
  158.                     <td align="left" valign="middle" nowrap>
  159.                    </td>
  160.                 </tr>
  161.                 <tr>
  162.                     <td align="right" valign="middle">&nbsp;</td>
  163.                     <td align="left" valign="middle" nowrap>
  164.                         <input type="submit" value="修改">&nbsp;&nbsp; <input type="reset" value="重填">&nbsp;&nbsp; <input type="button" value="返回" onclick="window.location='DepartmentManage.jsp';">
  165.                     </td>
  166.                 </tr>
  167.             </table>
  168.             </form>
  169.         </td>
  170.     </tr>
  171. </table>
  172. </body>
  173. </html>
  174. <%
  175. }
  176. else
  177. {
  178. %>
  179. <script language="JavaScript" type="text/JavaScript">
  180. alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
  181. history.back();
  182. </script>
  183. <%
  184. }
  185. }
  186. %>