用户名由001,002,003改为op,audit等等

Eight
lhiven 3 months ago
parent f2daf4fe26
commit 14a91828ee

@ -33,15 +33,24 @@ namespace Rs.MotionPlat
private void btnLogin_Click(object sender, EventArgs e) private void btnLogin_Click(object sender, EventArgs e)
{ {
/*
OP
AUDIT
PM
ENGINEER
ADMIN
*/
string username = cboxUsers.SelectedItem.ToString(); string username = cboxUsers.SelectedItem.ToString();
string userpwd = txtPassword.Text.Trim(); string userpwd = txtPassword.Text.Trim();
if(username=="001") if(username==EUserLevel.OP.ToString())
{ {
if(userpwd == "1") if(userpwd == "1")
{ {
OnloginSuccessEvent?.Invoke(username); OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Op; GlobalUser.UserLevel = EUserLevel.OP;
GlobalUser.UserName = username; GlobalUser.UserName = username;
DevLog.EventTracker(username, -1, "", "LOGIN");
this.Close(); this.Close();
} }
else else
@ -50,28 +59,46 @@ namespace Rs.MotionPlat
txtPassword.Text = ""; txtPassword.Text = "";
} }
} }
//if (username == "Engineer") else if(username== EUserLevel.AUDIT.ToString())
//{ {
// if (userpwd == "2") if (userpwd == "1")
// { {
// OnloginSuccessEvent?.Invoke(username); OnloginSuccessEvent?.Invoke(username);
// GlobalUser.UserLevel = EUserLevel.Engineer; GlobalUser.UserLevel = EUserLevel.AUDIT;
// GlobalUser.UserName = username; GlobalUser.UserName = username;
// this.Close(); DevLog.EventTracker(username, -1, "", "LOGIN");
// } this.Close();
// else }
// { else
// Msgbox.ShowTipDialog(EButtonType.Ok, "userpwd error,please input again"); {
// txtPassword.Text = ""; Msgbox.ShowTipDialog(EButtonType.Ok, "userpwd error,please input again");
// } txtPassword.Text = "";
//} }
else if (username == "002") }
else if (username == EUserLevel.PM.ToString())
{
if (userpwd == "1")
{
OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.PM;
GlobalUser.UserName = username;
DevLog.EventTracker(username, -1, "", "LOGIN");
this.Close();
}
else
{
Msgbox.ShowTipDialog(EButtonType.Ok, "userpwd error,please input again");
txtPassword.Text = "";
}
}
else if (username == EUserLevel.ENGINEER.ToString())
{ {
if (userpwd == "dxd") if (userpwd == "dxd")
{ {
OnloginSuccessEvent?.Invoke(username); OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Vender; GlobalUser.UserLevel = EUserLevel.ENGINEER;
GlobalUser.UserName = username; GlobalUser.UserName = username;
DevLog.EventTracker(username, -1, "", "LOGIN");
this.Close(); this.Close();
} }
else else
@ -80,13 +107,14 @@ namespace Rs.MotionPlat
txtPassword.Text = ""; txtPassword.Text = "";
} }
} }
else if (username == "003") else if (username == EUserLevel.ADMIN.ToString())
{ {
if (userpwd == "lhiven") if (userpwd == "lhiven")
{ {
OnloginSuccessEvent?.Invoke(username); OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Admin; GlobalUser.UserLevel = EUserLevel.ADMIN;
GlobalUser.UserName = username; GlobalUser.UserName = username;
DevLog.EventTracker(username, -1, "", "LOGIN");
this.Close(); this.Close();
} }
else else

@ -55,9 +55,11 @@
this.cboxUsers.ForeColor = System.Drawing.Color.White; this.cboxUsers.ForeColor = System.Drawing.Color.White;
this.cboxUsers.FormattingEnabled = true; this.cboxUsers.FormattingEnabled = true;
this.cboxUsers.Items.AddRange(new object[] { this.cboxUsers.Items.AddRange(new object[] {
"001", "OP",
"002", "AUDIT",
"003"}); "PM",
"ENGINEER",
"ADMIN"});
this.cboxUsers.Location = new System.Drawing.Point(135, 77); this.cboxUsers.Location = new System.Drawing.Point(135, 77);
this.cboxUsers.Name = "cboxUsers"; this.cboxUsers.Name = "cboxUsers";
this.cboxUsers.Size = new System.Drawing.Size(172, 28); this.cboxUsers.Size = new System.Drawing.Size(172, 28);

Loading…
Cancel
Save