<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.organize.*" %>
<%@ include file="/sessionInfo.jsp"%>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
%>
<%
    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    //读取数据
    SzLoginInfo loginInfo = null;
    if (!sKEY.equals("0")) {
        SzLogin login = new SzLogin();
        loginInfo = (SzLoginInfo)login.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (loginInfo == null) {
        loginInfo = new SzLoginInfo();
    }
    //读取数据
    SzUserInfo szUserInfo = null;
    if (!sKEY.equals("0")) {
        SzUser szUser = new SzUser();
        szUserInfo = (SzUserInfo)szUser.getInfoByCond("YGDL=" + sKEY);
    }

    if (szUserInfo == null) {
        szUserInfo = new SzUserInfo();
        szUserInfo.setYGBH(SzKey.getInstance().genNextKey("YG", "YG", 4));
    }
    int iGSID = loginInfo.getDLGSID();
%>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
<%@ include file="/share/title.jsp"%>
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="DLID" value="<%=loginInfo.getDLID()%>">
  <input type="hidden" name="YGID" value="<%=szUserInfo.getYGID()%>">
  <input type="hidden" name="DLBM" value="<%=loginInfo.getDLBM()%>">
  <input type="hidden" name="DLZW" value="<%=loginInfo.getDLZW()%>">
<table width="100%">
  <tr>
    <td>
      <input type="button" name="btnSave" class="btnClass" value="保存" OnClick="javascript:FormSave(formUpdate, 'control.jsp');">
      <input type="button" name="btnBack" class="btnClass" value="返回" OnClick="javascript:FormSubmit(formHidden, 'index.jsp');">
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">所属公司</td>
    <td colspan="3">
      <%=SzPageHelp.idSelectTree2("SZXT_JTGS","GSID","GSMC","GSBH", "DLGSID", iGSID, "txtClass2")%>   
    </td>
  </tr> 
  <tr>
    <td width="100" align="right">登陆帐号</td>
    <td><input type="text" name="DLZH" value="<%=loginInfo.getDLZH()%>"></td>

    <td width="100" align="right">用户姓名</td>
    <td><input type="text" name="DLXM" value="<%=loginInfo.getDLXM()%>"></td>
  </tr>
  <tr>
    <td width="100" align="right">登陆密码</td>
    <td><input type="password" name="DLMM" value=""></td>

    <td width="100" align="right">使用状态</td>
    <td>
      <input type="radio" name="DLBZ" value="0" <% if(loginInfo.getDLBZ() == 0 ) { %> checked <% } %> >可用&nbsp;
      <input type="radio" name="DLBZ" value="1" <% if(loginInfo.getDLBZ() == 1 ) { %> checked <% } %> >禁用&nbsp;
    </td>
  </tr>
</table>
<br>

</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
</form>
<script language="javascript">
  //第一个表示对象，form，第二个表示字符串
  function FormSubmit(oFormName, vUrl) {
    oFormName.action = vUrl;
    oFormName.submit();
  }
</script>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.DLGSID, "所属公司")) {
      return false;
    } 
    //检查是否可以保存
    if (!notNum(formName.DLGSID, "所属公司")) {
      return false;
    }    
    if (!notSpace(formName.DLZH, "登陆帐号")) {
      return false;
    } 
    if (!notSpace(formName.DLXM, "用户姓名")) {
      return false;
    }             

    //提交
    formName.action = url;
    formName.submit();
  }
</script>