📄 user_operate.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.util.Date" %>
<%@ page language="java" import="java.util.Hashtable,java.util.ArrayList,java.util.Iterator" %>
<%@ page errorPage="/error/error.jsp" %>
<jsp:useBean id="Users" class="bean.users.UsersBean" />
<jsp:useBean id="Organ" class="bean.TreeCom.TreeBean" />
<HTML>
<HEAD>
<TITLE>用户信息维护</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html"; charset="gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="js/checkdata.js" type="text/javascript"></script>
</HEAD>
<script language="JavaScript">
function CheckSubmit(){
temp=document.all("UserCode").value;
temp.replace(" ","");
if (temp=="") document.all("UserCode").value=temp;
temp=document.all("UserName").value;
temp.replace(" ","");
if (temp=="") document.all("UserName").value=temp;
temp=document.all("UserPwd").value;
temp.replace(" ","");
if (temp=="") document.all("UserPwd").value=temp;
temp=document.all("Remark").value;
temp.replace(" ","");
temp.replace(0x0D,"");
if (temp=="") document.all("Remark").value=temp;
if ( (document.all("UserCode").value.length==0))
{
window.alert("请输入用户工号!");
document.all("UserCode").focus();
return false;
}
if (getLength(document.all("UserCode").value)>30)
{
window.alert("用户工号长度不能超过30位!");
document.all("UserCode").focus();
return false;
}
if ( (document.all("UserName").value.length==0))
{
window.alert("请输入用户姓名!");
document.all("UserName").focus();
return false;
}
if (getLength(document.all("UserName").value)>20)
{
window.alert("用户姓名长度不能超过20位!");
document.all("UserName").focus();
return false;
}
if ( (document.all("UserPwd").value.length==0))
{
window.alert("请输入用户密码!");
document.all("UserPwd").focus();
return false;
}
if (getLength(document.all("UserPwd").value)>15)
{
window.alert("用户密码长度不能超过15位!");
document.all("UserPwd").focus();
return false;
}
if ( document.all("OrganID").selectedIndex < 0 ){
window.alert("请选择用户部门单位!");
document.all("OrganID").focus();
return false;
}
document.all("TOrganID").value = document.all("OrganID").options[document.all("OrganID").selectedIndex].value;
if (getLength(document.all("Remark").value)>100)
{
window.alert("用户说明长度不能超过100位!");
document.all("Remark").focus();
return false;
}
document.all("TUserCode").value=document.all("UserCode").value;
document.all("TUserName").value=document.all("UserName").value;
document.all("TUserPwd").value=document.all("UserPwd").value;
document.all("TRemark").value=document.all("Remark").value;
return true;
}
function ResetValue(s){
document.all("UserCode").value=document.all("TUserCode").value;
document.all("UserName").value=document.all("TUserName").value;
document.all("UserPwd").value=document.all("TUserPwd").value;
document.all("Remark").value=document.all("TRemark").value;
for(i=0;i<document.all("OrganID").length;i++)
if (document.all("OrganID").options[i].value == s){
document.all("OrganID").selectedIndex = i;
break;
}
}
function ResetValue1(s){
document.all("UserCode").value="";
document.all("UserName").value="";
document.all("UserPwd").value="";
document.all("Remark").value="";
for(i=0;i<document.all("OrganID").length;i++)
if (document.all("OrganID").options[i].value == s){
document.all("OrganID").selectedIndex = i;
break;
}
}
function modUser(){
r=CheckSubmit();
if (r) {
ask=confirm("你确定修改该记录吗?\n\n点“确定”继续,点“取消”返回");
if (ask){
sHref="User_Operate1.jsp?TUserID="+document.all("TUserID").value
+"&TUserCode="+document.all("TUserCode").value
+"&TUserName="+document.all("TUserName").value
+"&TUserPwd="+document.all("TUserPwd").value
+"&TRemark="+document.all("TRemark").value
+"&TOrganID="+document.all("TOrganID").value
+"&TAction="+document.all("TAction").value;
window.open(sHref,"_self","left=0,top=0,width=2, height=2,status=no,menubar=no,location=no,resizable=no,alwaysRaised=yes,z-look=yes,depended=yes");
}
}
}
function addUser(){
r=CheckSubmit();
if (r) {
sHref="User_Operate1.jsp?TUserID="+document.all("TUserID").value
+"&TUserCode="+document.all("TUserCode").value
+"&TUserName="+document.all("TUserName").value
+"&TUserPwd="+document.all("TUserPwd").value
+"&TRemark="+document.all("TRemark").value
+"&TOrganID="+document.all("TOrganID").value
+"&TAction="+document.all("TAction").value;
window.open(sHref,"_self","left=0,top=0,width=2, height=2,status=no,menubar=no,location=no,resizable=no,alwaysRaised=yes,z-look=yes,depended=yes");
}
}
</script>
<%
byte bt[];
String sOrganID = request.getParameter("TOrganID");
String sOrganName = request.getParameter("TOrganName");
bt = sOrganName.getBytes("iso-8859-1");
sOrganName = new String(bt);
String sUserID = request.getParameter("TUserID");
String sAction = request.getParameter("TAction");
int i = 0;
String sUserCode = "";
String sUserName = "";
String sUserPwd = "";
String sModifyDate = "";
String sRemark = "";
String sDate = "";
String sTime = "";
ArrayList list = Users.getUsers(sOrganID,sUserID);
Iterator itr = list.iterator();
if (itr.hasNext()) {
Hashtable ht = (Hashtable) itr.next();
i=i+1;
sUserID=ht.get("UserId").toString();
sUserID=sUserID.trim();
if (sUserID.length()==0) sUserID="";
sUserCode=ht.get("UserCode").toString();
sUserCode=sUserCode.trim();
if (sUserCode.length()==0) sUserCode="";
sUserName=ht.get("UserName").toString();
sUserName=sUserName.trim();
if (sUserName.length()==0) sUserName="";
sUserPwd=ht.get("UserPwd").toString();
sUserPwd=sUserPwd.trim();
if (sUserPwd.length()==0) sUserPwd="";
sModifyDate=ht.get("ModifyDate").toString();
sModifyDate=sModifyDate.trim();
if (sModifyDate.length()==0) {
sModifyDate="";
}
else{
sDate=sModifyDate.substring(0,sModifyDate.indexOf(" "));
//sTime=sModifyDate.substring(sModifyDate.indexOf(" ")+1,sModifyDate.length());
//sModifyDate=sDate+"_"+sTime;
}
sRemark=ht.get("Remark").toString();
sRemark=sRemark.trim();
if (sRemark.length()==0) sRemark="";
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -