<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.ejb.sys.UnitService" %>
<%@ page import = "zr.zrpower.ejb.sys.UIService"%>

<HTML>
<%
UIService userUI =new UIService();
SessionUser user = (SessionUser)session.getAttribute("userinfo");
%>
<%
request.setCharacterEncoding("GBK");
UnitService UnitManage = new UnitService();

String strUnitid = request.getParameter("unitid");
String strTYPE = request.getParameter("TYPE");
if (strTYPE ==null){strTYPE = "1";}

//生成单位编码
String AddCode = UnitManage.AddCode(strTYPE,strUnitid);

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<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" type="text/JavaScript">
<!--
function Save(){
   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>
<BODY class="BodyMain">
<form action="../actionunit.do" method="post" name="form1">
<input type="hidden" id="Act" name="Act" value="add">

<DIV id="divMessage" style='padding-left:0;padding-top:0;width:100%;height:100%;overflow:auto'>
<br>&nbsp;
<fieldset style="width: 98%">
    <legend>增加单位</legend>
    <div align="left">
      <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td class="PutdSet" width="40%">单位编号:</td>
            <td><input name="UnitID" type="text" class="text" size="40" maxlength="12" readonly="readonly" value="<%=AddCode%>"><Font class="WriteSign">*</Font></td>
          </tr>

		  <tr>
            <td class="PutdSet">单位名称:</td>
            <td><input name="UnitName" type="text" class="text" 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"></td>
          </tr>
      </table>

	</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>
      </div>


</FORM>
</BODY>
</HTML>
<%
userUI = null;
user = null;
%>
