<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.formCreate.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>

<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<style type="text/css">
  .readClass {
      background:#D4D0C8;
      readonly;
  }
  .selectClass {
      width:70;
  }  
</style>
</head>
<%
    //获取提交的参数
    String id = SzConvert.toSpaceStr(request.getParameter("id"));
    String readonly = "";
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
    
    BdAppend append = new BdAppend();
    String s[] = new String[5];
    
    Iterator iter = null;
    String s2[] = null;
    if (!id.equals("")) {
    	s = (String[])append.getMethodInfo(id);
    	iter = append.getMethodArgs(id).iterator();
    } else {
    	SzConvert.initialArray(s,"");
    }
    
	
%>
<body>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="oldid" value="<%=id%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">

<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">名称</td>
    <td><input type="text" name="id" class="txtClass1" value="<%=s[0]%>"> <font color="red">*</font>
    	<a href="#" onClick="javascript:SelectWin('formUpdate.moduleName');" onfocus="javascript:blur();">所属模块<img src="<%=strLevel_SESSION%>images/share2/select.gif" border="0" ></a> <input type="text" name="moduleName" value="<%=s[4]%>" class="txtClass1R" readonly> <font color="red">*</font>
    </td>
  </tr>
  <tr>
    <td class="tdClassTitle">所属java类</td>
    <td><input type="text" name="className" class="txtClass2" value="<%=s[2]%>"> <font color="red">*</font></td>
  </tr>
  <tr>
    <td class="tdClassTitle">方法名称</td>
    <td><input type="text" name="methodName" class="txtClass2" value="<%=s[1]%>"> <font color="red">*</font></td>
  </tr>
  <tr>
    <td class="tdClassTitle">说明</td>
    <td><input type="text" name="desc" class="txtClass2" value="<%=s[3]%>"></td>
  </tr>    
</table>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td>参数类型</td>  
    <td>传值类型</td> 
    <td>值</td>    
    <td>说明</td>       
  </tr>
<%
  String s_id[] = {"value","field"};
  String s_name[] = {"传值","字段名"};
  int i = 0;
  while (i<5) {
	  s2 = new String[4];
	  if (iter != null && iter.hasNext()) {
	  	  s2 = (String[])iter.next();
	  } 
	  if (s2 == null || s2[0] == null || s2[0].equals("") ) {
		  s2 = new String[4];
		  SzConvert.initialArray(s2, "");
	  }

	  i++;
%>
  <tr>
    <td><input type="text" name="className_<%=i %>" class="txtClass1" value="<%=s2[0]%>"></td>
    <td><%=SzPageHelp.radio("type_" + i, s_id, s_name, s2[1]) %></td>
    <td><input type="text" name="value_<%=i %>" class="txtClass120" value="<%=s2[2]%>"></td>
    <td><input type="text" name="desc_<%=i %>" class="txtClass1" value="<%=s2[3]%>"></td>        
  </tr>
<%	  
  }
%>
  <input type="hidden" name="count" value="<%=i %>">
</table>
</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="../../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {

    //检查是否可以保存
    if (!notSpace(formName.id, "名称")) {
      return false;
    }
    //名称只能为字母数字下划线
    if (!isLetterOrNumOrLine(formName.id.value)) {
      alert("名称只能是字母数字下划线");
      formUpdate.relateName.focus();
      return false;
    }   
    if (!notSpace(formName.moduleName, "所属模块")) {
      return false;
    }
    if (!notSpace(formName.className, "所属java类")) {
      return false;
    }        
    if (!notSpace(formName.methodName, "方法名称")) {
      return false;
    }    
    if (!isLetterOrNumOrLine(formName.methodName.value)) {
      alert("方法名称只能是字母数字下划线");
      formUpdate.relateName.focus();
      return false;
    } 
    formName.action = "control.jsp";
    formName.submit();
  }
  
 
</script>
<script language="javascript">  
  function SelectWin(vModuleNameObject) {
    var url = "../module_select.jsp?moduleNameObject=" + vModuleNameObject; 
    window.showModalDialog(url,window,"status=no;dialogWidth=300px;dialogHeight=370px");  
  }   
</script>

</body>
