<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.dbmanage.BPIP_TABLE"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.dbmanage.service.TableService" %>
<%@ page import = "zr.zrpower.dbmanage.service.TableSpaceService"%>

<%@ page import = "java.lang.Object"%>
<%@ page import = "java.util.*" %>
<%@ page import = "java.text.*" %>
<HTML>
<%
TableSpaceService Space = new TableSpaceService();
TableService Table = new TableService();

UIService userUI =new UIService();
SessionUser user = (SessionUser)session.getAttribute("userinfo");
String strID = request.getParameter("ID");
String strchinesename = Space.GetSpaceCHINESENAME(strID);
%>
<HTML>
<HEAD>
<TITLE><%=SysPreperty.getProperty().SystemName%><%=SysPreperty.getProperty().Versoin%></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()%>">
<LINK type="text/css" rel="stylesheet" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--
function Check(theForm){

  if (theForm.TABLENAME.value == ""){

    <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('表名不能为空！', {icon: 7});
    <%}else{%>
    alert("表名不能为空！");
    <%}%>
    theForm.TABLENAME.focus();
    return (false);
  }

  if (theForm.CHINESENAME.value == ""){

    <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('中文名称不能为空！', {icon: 7});
    <%}else{%>
    alert("中文名称不能为空！");
    <%}%>
    theForm.CHINESENAME.focus();
    return (false);
  }

  if (theForm.TABLETYPE.value!="1")
  {
  if (theForm.PRIMARYKEY.value == ""){

    <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('主键不能为空！', {icon: 7});
    <%}else{%>
    alert("主键不能为空！");
    <%}%>
    theForm.PRIMARYKEY.focus();
    return (false);
  }
  }

  theForm.TABLENAME.value=theForm.TABLENAME.value.toUpperCase();
  theForm.PRIMARYKEY.value=theForm.PRIMARYKEY.value.toUpperCase();
  <%if("6".equals(user.getUserWINDOWTYPE())){%>
  document.RegForm.submit();
  window.parent.document.location.reload();
  <%}else{%>
  return (true);
  <%}%>

}
//-->
</script>
</HEAD>
<BODY class="BodyMain">
<FORM name="RegForm" method="post" action="../../actiontable.do"  onsubmit="return Check(this);">
<input type="hidden" id="Act" name="Act" value="add">
<input type="hidden" name="TABLESPACE" value='<%=strID%>'>

  <DIV id="divMessage" style='padding-left:0;padding-top:0;width:96%;height:99%;overflow:auto'>
           <fieldset>
           <legend><%=strchinesename%>表管理-增加表信息</legend>
           <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
           <tr>
               <td class="inputTdtitle">表名：</td>
               <td class="inputTd"><input class="text" type="text" name="TABLENAME" size="50" maxlength="50"><Font class="WriteSign">*</Font></td>
           </tr>
           <tr>
               <td class="inputTdtitle">中文名称：</td>
               <td class="inputTd" ><input class="text" type="text" name="CHINESENAME" size="50" maxlength="300"><Font class="WriteSign">*</Font></td>
          </tr>
          <tr>
               <td class="inputTdtitle">表类型：</td>
               <TD> <select name = "TABLETYPE" style = "width:320px">
                 	<option value = "0">系统表
                 	<option value = "1">字典表
                        <option value = "2" selected>基础数据表
                        <option value = "3">审批表
                     </select>

                     <br>说明：只有基础数据表和审批表才能配置自定义表单和流程。
                     <br>     新建的表为字典表时将自动建字段，可以到字段管理中调整字段长度。
             </TD>
          </tr>

          <tr>
               <td class="inputTdtitle">主键：</td>
               <td class="inputTd" ><input class="text" type="text" name="PRIMARYKEY" size="50" maxlength="30"><Font class="WriteSign">*</Font></td>
             </tr>
         <tr>
               <td class="inputTdtitle">标题：</td>
               <td class="inputTd" ><input class="text" type="text" name="TITLE" size="50" maxlength="30">
               <br>说明：设置有标题字段,在使用流程引擎时收到的提示中包括有标题。
               </td>
             </tr>

          <tr>
              <td class="inputTdtitle">描述：</td>
               <td   class="inputTd" ><textarea name="DESCRIPTION" rows="3" cols="51"></textarea></td>
           </tr>
          </table>
          <br>
          </fieldset>
                 <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保存","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%if("6".equals(user.getUserWINDOWTYPE())){%>
                 <%=userUI.ClickButton("关闭","JavaScript:parent.layer.closeAll();","buttonClose.gif",user.getUserImage())%>

                <%}else{ %>
                <%=userUI.ClickButton("关闭","JavaScript:window.opener.document.location.reload();window.close();","buttonClose.gif",user.getUserImage())%>

                <%} %>
                 </tr></table>
                 </center>
          </DIV>

</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
Space = null;
Table = null;
%>
