EditDepartment.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:9k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
- <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
- <%
- Request m_request = new Request(request);
- int intDepartmentID = m_request.GetInt("ID");
- if(intDepartmentID<1)
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("请选择正确的部门,修改失败!");
- history.back();
- </script>
- <%
- }
- else
- {
- Vector vt = DepartmentManager.getRecordByID(intDepartmentID);
- if(vt.size()==1)
- {
- String sDepartmentID = ((Vector)vt.get(0)).get(2).toString();
- sDepartmentID = sDepartmentID.substring(0,sDepartmentID.length()-1);
- sDepartmentID = sDepartmentID.substring(sDepartmentID.lastIndexOf("_")+1);
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title>部门器管理-- GForce OA 2.0</title>
- <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
- <script language="JavaScript" type="text/javascript">
- function checkEditDepartment()
- {
- if(document.editdepartment.Name.value=="")
- {
- alert("请输入部门名称!");
- document.editdepartment.Name.focus();
- return false;
- }
- if(document.editdepartment.DepartmentID.value=="")
- {
- alert("请选择上级部门!");
- self.SelectDepartment.document.SelectDepartment.Department[0].focus();
- return false;
- }
- if(document.editdepartment.DepartmentID.value==document.editdepartment.ID.value)
- {
- alert("上级部门不能是该部门自己,请选择正确的上级部门!");
- self.SelectDepartment.document.SelectDepartment.Department[0].focus();
- return false;
- }
- document.editdepartment.OrderNumber.value=<%=((Vector)vt.get(0)).get(5).toString()%>;
- }
- function uploadimage(ImageBox,ImagePic)
- {
- var ImageSrc=window.showModalDialog("/UploadFile.jsp","","status:no; resizable: no; help:no; dialogWidth:296px; dialogHeight:150px");
- if(ImageSrc!=null&&ImageSrc!="")
- {
- ImageBox.value=ImageSrc;
- ImagePic.src=ImageSrc;
- }
- return false;
- }
- </script>
- </head>
- <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
- <table width="100%" height="100%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center" valign="top"><p> </p>
- <form name="editdepartment" action="EditDepartmentAction.jsp" method="post" onSubmit="javascript:return checkEditDepartment();">
- <table border="0" cellpadding="0" cellspacing="0" width="90%">
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">部门名称:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="ID" type="hidden" maxlength="5" value="<%=((Vector)vt.get(0)).get(0).toString()%>">
- <input name="Name" type="text" maxlength="50" size="37" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="top"><font color="#0A0A0A">上级部门:</font></td>
- <td align="left" valign="middle" nowrap>
- <iframe id="SelectDepartment" frameborder=1 src="SelectDepartment.jsp" width="100%" height="100%" scrolling="auto"></iframe>
- </td>
- </tr>
- <input name="Station" type="hidden" ID="Station" Value="<%=((Vector)vt.get(0)).get(2).toString()%>">
- <input name="LevelNumber" type="hidden" id="LevelNumber" value="<%=((Vector)vt.get(0)).get(3).toString()%>">
- <input name="ChildrenAcount" type="hidden" id="ChildrenAcount" value="<%=((Vector)vt.get(0)).get(4).toString()%>">
- <input name="OrderNumber" type="hidden" id="OrderNumber" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
- <input name="DepartmentID" type="hidden" id="DepartmentID" value="<%=sDepartmentID%>">
- <%
- String strOpenICO = ((Vector)vt.get(0)).get(6).toString();
- if(strOpenICO.trim().length()>1)
- {
- %>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">打开时的图标:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="OpenedICO" type="text" maxlength="50" size="20" value="<%=strOpenICO%>">
- <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>
- </td>
- </tr>
- <%
- }
- else
- {
- %>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">打开时的图标:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="OpenedICO" type="text" maxlength="50" size="20">
- <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>
- </td>
- </tr>
- <%
- }
- String strCloseICO = ((Vector)vt.get(0)).get(7).toString();
- if(strCloseICO.trim().length()>1)
- {
- %>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">关闭时的图标:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="CloseedICO" type="text" maxlength="50" size="20" value="<%=strCloseICO%>">
- <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>
- </td>
- </tr>
- <%
- }
- else
- {
- %>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">关闭时的图标:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="CloseedICO" type="text" maxlength="50" size="20">
- <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>
- </td>
- </tr>
- <%
- }
- %>
- <input name="LinkUrl" type="hidden" value="">
- <input name="Target" type="hidden" value="">
- <input name="IsLink" type="hidden" value="0">
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">部门简介:</font></td>
- <td align="left" valign="middle" nowrap>
- <input name="Content" type="text" maxlength="50" size="38" value="<%=((Vector)vt.get(0)).get(11).toString()%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">是否显示:</font></td>
- <td align="left" valign="middle" nowrap>
- <font color="#0A0A0A"><input name="IsShow" type="radio" value="1" <%=((Vector)vt.get(0)).get(12).toString().equalsIgnoreCase("true")?"checked":""%>>是 <input name="IsShow" type="radio" value="0" <%=((Vector)vt.get(0)).get(12).toString().equalsIgnoreCase("false")?"checked":""%>>否</font>
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A"> </font></td>
- <td align="left" valign="middle" nowrap>
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"> </td>
- <td align="left" valign="middle" nowrap>
- <input type="submit" value="修改"> <input type="reset" value="重填"> <input type="button" value="返回" onclick="window.location='DepartmentManage.jsp';">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
- history.back();
- </script>
- <%
- }
- }
- %>