EditPublicRes.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 iSysDirID = m_request.GetInt("SysDirID");
  7. int iIsPlan = m_request.GetInt("IsPlan");
  8. int iAssetID = m_request.GetInt("AssetID");
  9. int intPublicResID = m_request.GetInt("ID");
  10. if(intPublicResID<1)
  11. {
  12. %>
  13. <script language="JavaScript" type="text/JavaScript">
  14. alert("请选择正确的共享,修改失败!");
  15. history.back();
  16. </script>
  17. <%
  18. }
  19. else
  20. {
  21. Vector vt = PublicResShareManager.getByIDAllRecord(intPublicResID);
  22. if(vt.size()==1)
  23. {
  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" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  31. <script language="JavaScript" type="text/javascript">
  32. function checkEditPublicRes()
  33. {
  34.     if(document.EditPublicRes.Purpose.value=="")
  35.     {
  36.         alert("请输入用途!");
  37.         document.EditPublicRes.Purpose.focus();
  38.         return false;
  39.     }
  40.         if(!isDate(document.EditPublicRes.StartDateD.value))
  41.         {
  42.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  43.             document.EditPublicRes.StartDateD.focus();
  44.             return false;
  45.         }
  46.         if(!isDate(document.EditPublicRes.EndDateD.value))
  47.         {
  48.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  49.             document.EditPublicRes.EndDateD.focus();
  50.             return false;
  51.         }
  52.         if (document.EditPublicRes.StartDateD.value>document.EditPublicRes.EndDateD.value)
  53.         {
  54.           alert("开始日期不能大于结束日期!");
  55.           document.EditPublicRes.EndDateD.focus();
  56.           return false;
  57.         }
  58. if (document.EditPublicRes.StartDateTm.value=="")
  59. {
  60.   document.EditPublicRes.StartDateTm.value=0;
  61. }
  62. else if(isNaN(parseInt(document.EditPublicRes.StartDateTm.value,10)) || parseInt(document.EditPublicRes.StartDateTm.value,10)>59 || parseInt(document.EditPublicRes.StartDateTm.value,10)<0)
  63. {
  64. alert("请输入正确的分钟!");
  65. document.EditPublicRes.StartDateTm.select();
  66. document.EditPublicRes.StartDateTm.focus();
  67. return false;
  68. }
  69. if (document.EditPublicRes.EndDateTm.value=="")
  70. {
  71.   document.EditPublicRes.EndDateTm.value=0;
  72. }
  73. else if(isNaN(parseInt(document.EditPublicRes.EndDateTm.value,10)) || parseInt(document.EditPublicRes.EndDateTm.value,10)>59 || parseInt(document.EditPublicRes.EndDateTm.value,10)<0)
  74. {
  75. alert("请输入正确的分钟!");
  76. document.EditPublicRes.EndDateTm.select();
  77. document.EditPublicRes.EndDateTm.focus();
  78. return false;
  79. }
  80. if (document.EditPublicRes.StartDateD.value==document.EditPublicRes.EndDateD.value)
  81. {
  82.   if (parseInt(document.EditPublicRes.StartDateT.value,10)>parseInt(document.EditPublicRes.EndDateT.value,10))
  83.   {
  84.     alert("开始时间不能大于结束时间!");
  85.     document.EditPublicRes.EndDateT.focus();
  86.     return false;
  87.   }
  88.   else if (parseInt(document.EditPublicRes.StartDateT.value,10)==parseInt(document.EditPublicRes.EndDateT.value,10))
  89.   {
  90.     if (parseInt(document.EditPublicRes.StartDateTm.value,10)>parseInt(document.EditPublicRes.EndDateTm.value,10))
  91.     {
  92.       alert("开始时间不能大于结束时间!");
  93.       document.EditPublicRes.EndDateTm.focus();
  94.       document.EditPublicRes.EndDateTm.select();
  95.       return false;
  96.     }
  97.   }
  98. }
  99. //计划开始时间,结束时间合成
  100.    document.EditPublicRes.StartTime.value = document.EditPublicRes.StartDateD.value + " "+
  101.                                                  document.EditPublicRes.StartDateT.value + ":"+document.EditPublicRes.StartDateTm.value+":00";
  102.    document.EditPublicRes.EndTime.value = document.EditPublicRes.EndDateD.value + " "+
  103.                                                  document.EditPublicRes.EndDateT.value + ":"+document.EditPublicRes.EndDateTm.value+":00";
  104. }
  105. </script>
  106. </head>
  107. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  108. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  109.     <tr>
  110.         <td align="center" valign="top"><p>&nbsp;</p>
  111.             <form name="EditPublicRes" action="/Asset/EditPublicResAction.jsp?SysDirID=<%=iSysDirID%>&IsPlan=<%=iIsPlan%>" method="post" onSubmit="javascript:return checkEditPublicRes();">
  112.             <table  border="0" cellpadding="0" cellspacing="0" width="90%">
  113.                 <tr>
  114.                     <td align="right" valign="middle"><font color="#0A0A0A">用途:</font></td>
  115.                     <td align="left" valign="middle" nowrap>
  116.                         <input name="ID" type="Hidden" value="<%=((Vector)vt.get(0)).get(0).toString()%>" >
  117.                         <input name="UserID" type="hidden" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
  118.                         <input name="AssetID" type="hidden" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
  119.                         <input name="IsPlan" type="hidden" value="<%=((Vector)vt.get(0)).get(6).toString()%>">
  120.                         <input name="Purpose" type="text" maxlength="60" size="37" Value="<%=((Vector)vt.get(0)).get(4).toString()%>">
  121.                     </td>
  122.                 </tr>
  123.                 <tr>
  124.                     <td align="right" valign="middle"><font color="#0A0A0A">开始时间:</font></td>
  125.                     <td align="left" valign="middle" nowrap>
  126.                     <input name="StartTime" type="hidden">
  127.                     <input name="StartDateD" type="text" Value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy-MM-dd")%>" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);">
  128.               <select name="StartDateT">
  129.                 <%
  130.                   for(int i=1;i<24;i++)
  131.                   {
  132.                     if (StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"H").equalsIgnoreCase(i+""))
  133.                     {
  134.                       out.println("<option value=" + i + " selected>" + i + "</option>");
  135.                     }
  136.                     else
  137.                     {
  138.                       out.println("<option value=" + i + ">" + i + "</option>");
  139.                     }
  140.                   }
  141.                 %>
  142.               </select>
  143.               <font color="#0A0A0A">时</font>
  144.               <input name="StartDateTm" type="text" size="3" maxlength="2" Value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"m")%>">
  145.               <font color="#0A0A0A">分</font> </td>
  146.                 </tr>
  147.                 <tr>
  148.                     <td align="right" valign="middle"><font color="#0A0A0A">结束时间:</font></td>
  149.                     <td align="left" valign="middle" nowrap>
  150.                     <input name="EndTime" type="hidden">
  151.                     <input name="EndDateD" type="text" Value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy-MM-dd")%>" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);">
  152.                 <select name="EndDateT">
  153.                 <%
  154.                   for(int i=1;i<24;i++)
  155.                   {
  156.                     if (StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"H").equalsIgnoreCase(i+""))
  157.                     {
  158.                       out.println("<option value=" + i + " selected>" + i + "</option>");
  159.                     }
  160.                     else
  161.                     {
  162.                       out.println("<option value=" + i + ">" + i + "</option>");
  163.                     }
  164.                   }
  165.                 %>
  166.               </select>
  167.               <font color="#0A0A0A">时</font>
  168.               <input name="EndDateTm" type="text" size="3"  maxlength="2" Value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"m")%>">
  169.               分</td>
  170.                 </tr>
  171.                  <tr>
  172.                     <td align="right" valign="middle">&nbsp;</td>
  173.                     <td align="left" valign="middle" nowrap></td>
  174.                 </tr>
  175.                 <tr>
  176.                     <td align="right" valign="middle">&nbsp;</td>
  177.                     <td align="left" valign="middle" nowrap>
  178.                         <input type="submit" value="修改">&nbsp;&nbsp; <input type="reset" value="重填">&nbsp;&nbsp; <input type="button" value="返回" onclick="window.location='PublicResManage.jsp?SysDirID=<%=iSysDirID%>&ID=<%=iAssetID%>&IsPlan=<%=iIsPlan%>';">
  179.                    </td>
  180.                 </tr>
  181.             </table>
  182.             </form>
  183.         </td>
  184.     </tr>
  185. </table>
  186. </body>
  187. </html>
  188. <%
  189. }
  190. else
  191. {
  192. %>
  193. <script language="JavaScript" type="text/JavaScript">
  194. alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
  195. history.back();
  196. </script>
  197. <%
  198. }
  199. }
  200. %>