<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" %>
<%@ page import = "zr.zrpower.ejb.sys.UnitService" %>
<%@ page import = "zr.zrpower.ejb.sys.UdictService" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_UNIT" %>
<%@ page import = "zr.zrpower.common.util.DateWork" %>

<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@page import="zr.zrpower.ejb.sys.SecurityService"%>
<% request.setCharacterEncoding("GBK"); %>
<html>
<head>
<%
  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  UIService userUI =new UIService();
  UnitService depMgr = new UnitService();
  UdictService dictMgr = new UdictService();
  SecurityService SeService =new SecurityService();
  BPIP_UNIT dep =  depMgr.GetUnit(request.getParameter("unitid"));

  String strUnitid = request.getParameter("unitid");

%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<link REL="stylesheet" type="text/css" href="../zrsysmanage/css/<%=user.getUserCSS()%>">
<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<%}%>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/script/Public.js"></SCRIPT>
<SCRIPT language=JavaScript src="../zrsysmanage/script/validate.js"></SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--
function Save(){
   if(document.form1.UnitID.value.length!=12) {

      <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('请输入12位的单位编号!', {icon: 7});
      <%}else{%>
       alert("请输入12位的单位编号！");
       <%}%>
	 document.form1.DepartmentID.focus();
	 return false;
   }

   if(document.form1.UnitName.value.length<1) {

      <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('请输入单位名称!', {icon: 7});
      <%}else{%>
       alert("请输入单位名称！");
       <%}%>
	 document.form1.UnitName.focus();
	 return false;
   }
   return true;
}


  function GetKeyDown()
  {
    if(event.keyCode==13) event.keyCode=9;
  }
//-->
</script>
</head>
<%
  if(dep!=null){
%>
<BODY class="BodyMain" onkeydown="GetKeyDown()">
<form action="../actionunit.do" method="post" name="form1">
<input name="UnitID" type="hidden" id="UnitID" value="<%=request.getParameter("unitid")%>">
<input name="Act" type="hidden" id="Act" value="edit">

<TABLE width="100%" height='100%' cellSpacing='0' cellPadding='0' border='0'><tr><td>
<TABLE height='31' cellSpacing='0' cellPadding='0' border='0'>
 <TR>

<%=userUI.ClickButton("删除本单位","../actionunit.do?Act=delete&unitid="+strUnitid,"buttonDelete.gif",user.getUserImage())%>
  </tr></table></td></tr><tr><td valign="top">

<DIV id="divMessage" style='padding-left:0;padding-top:0;width:100%;height:100%;overflow:auto'>
   <br>&nbsp;
   <fieldset style="width: 98%">
    <legend>修改单位信息</legend>
    <br>
    <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td class="PutdSet" width="40%">单位编号:</td>
            <td><%=dep.getUNITID()%></td>
          </tr>

          <tr>
            <td class="PutdSet">单位名称:</td>
            <td><input name="UnitName" type="text" class="text" value="<%=dep.getUNITNAME()%>" size="40" maxlength="100"><Font class="WriteSign">*</Font></td>
          </tr>



          <tr>
            <td class="PutdSet">排序号:</td>
            <td><input name="ORDERCODE" type="text" class="text" size="40" maxlength="4" value="<%=dep.getORDERCODE()%>"></td>
          </tr>
      </table>
      <br><br>
      </fieldset>

      <center><br>
            <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保 存","JavaScript:if(Save()){document.form1.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("返 回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
            </tr></table>
      </center>
      <br></div>
<%
  }else{
     %>
     <br><div align="center"> 请 选 择 单 位 . . . </div>
     <%
  }
%>

</td></tr></TABLE>
</form>
</body>
</html>
<%
user = null;
userUI = null;
depMgr = null;
dictMgr = null;
dep = null;
%>
