优化用户登录

master
lhiven 1 year ago
parent 5457349137
commit 130d5672b1

@ -28,7 +28,7 @@ namespace Rs.MotionPlat.Commom
} }
public static bool IsOp() public static bool IsOp()
{ {
if (!string.IsNullOrEmpty(UserName) && UserName == "操作员") if (!string.IsNullOrEmpty(UserName) && UserName == "Op")
{ {
return true; return true;
} }
@ -37,7 +37,7 @@ namespace Rs.MotionPlat.Commom
public static bool IsVender() public static bool IsVender()
{ {
if (!string.IsNullOrEmpty(UserName) && UserName == "厂商") if (!string.IsNullOrEmpty(UserName) && UserName == "Vender")
{ {
return true; return true;
} }
@ -45,7 +45,7 @@ namespace Rs.MotionPlat.Commom
} }
public static bool IsSuper() public static bool IsSuper()
{ {
if(!string.IsNullOrEmpty(UserName) && UserName=="超级用户") if(!string.IsNullOrEmpty(UserName) && UserName=="Admin")
{ {
return true; return true;
} }

@ -2181,6 +2181,7 @@ namespace Rs.MotionPlat.Flow
default: default:
break; break;
} }
Thread.Sleep(1);
} }
} }

@ -3166,6 +3166,7 @@ namespace Rs.MotionPlat.Flow
break; break;
} }
Thread.Sleep(1);
} }
} }

@ -36,7 +36,6 @@ namespace Rs.MotionPlat
this.FormBorderStyle = FormBorderStyle.None; this.FormBorderStyle = FormBorderStyle.None;
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea; this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
} }
void CloseSubWindow() void CloseSubWindow()
@ -194,15 +193,31 @@ namespace Rs.MotionPlat
form.Show(this); form.Show(this);
} }
else if (button == btnPermission) else if (button == btnPermission)
{
if(btnPermission.ShowText.IndexOf("-")>0)
{
DialogResult dr = Msg.ShowQuestion("Are you sure to exit login?");
if(dr== DialogResult.OK)
{
GlobalUser.UserName = "";
btnPermission.ShowText=btnPermission.ShowText.Substring(0,btnPermission.ShowText.IndexOf("-"));
}
}
else
{ {
selectedButton = null; selectedButton = null;
BaseFormHeader form; UserForm form;
form = new UserForm(); form = new UserForm();
form.OnloginSuccessEvent += (uname) => {
btnPermission.ShowText += $"-({uname})";
};
form.StartPosition = FormStartPosition.CenterScreen; form.StartPosition = FormStartPosition.CenterScreen;
form.Opacity = 1; form.Opacity = 1;
form.TopMost = true; form.TopMost = true;
form.ShowDialog(this); form.ShowDialog(this);
} }
}
else if (button == btnLanguage) else if (button == btnLanguage)
{ {
selectedButton = null; selectedButton = null;
@ -225,7 +240,10 @@ namespace Rs.MotionPlat
} }
} }
private void Form_OnloginSuccessEvent(string obj)
{
throw new NotImplementedException();
}
private void ShowBtn(string btnname) private void ShowBtn(string btnname)
{ {

@ -111,16 +111,16 @@
// //
// panel8 // panel8
// //
resources.ApplyResources(this.panel8, "panel8");
this.panel8.Controls.Add(this.btnMain); this.panel8.Controls.Add(this.btnMain);
resources.ApplyResources(this.panel8, "panel8");
this.panel8.Name = "panel8"; this.panel8.Name = "panel8";
// //
// btnMain // btnMain
// //
resources.ApplyResources(this.btnMain, "btnMain");
this.btnMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnMain.ButtonType = Rs.Controls.EButtonType.Main; this.btnMain.ButtonType = Rs.Controls.EButtonType.Main;
this.btnMain.Cursor = System.Windows.Forms.Cursors.Hand; this.btnMain.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnMain, "btnMain");
this.btnMain.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnMain.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnMain.ForeColor = System.Drawing.Color.White; this.btnMain.ForeColor = System.Drawing.Color.White;
this.btnMain.Name = "btnMain"; this.btnMain.Name = "btnMain";
@ -134,16 +134,16 @@
// //
// panel9 // panel9
// //
resources.ApplyResources(this.panel9, "panel9");
this.panel9.Controls.Add(this.btnRecipe); this.panel9.Controls.Add(this.btnRecipe);
resources.ApplyResources(this.panel9, "panel9");
this.panel9.Name = "panel9"; this.panel9.Name = "panel9";
// //
// btnRecipe // btnRecipe
// //
resources.ApplyResources(this.btnRecipe, "btnRecipe");
this.btnRecipe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnRecipe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnRecipe.ButtonType = Rs.Controls.EButtonType.Recipe; this.btnRecipe.ButtonType = Rs.Controls.EButtonType.Recipe;
this.btnRecipe.Cursor = System.Windows.Forms.Cursors.Hand; this.btnRecipe.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnRecipe, "btnRecipe");
this.btnRecipe.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnRecipe.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnRecipe.ForeColor = System.Drawing.Color.White; this.btnRecipe.ForeColor = System.Drawing.Color.White;
this.btnRecipe.Name = "btnRecipe"; this.btnRecipe.Name = "btnRecipe";
@ -157,16 +157,16 @@
// //
// panel10 // panel10
// //
resources.ApplyResources(this.panel10, "panel10");
this.panel10.Controls.Add(this.btnSystem); this.panel10.Controls.Add(this.btnSystem);
resources.ApplyResources(this.panel10, "panel10");
this.panel10.Name = "panel10"; this.panel10.Name = "panel10";
// //
// btnSystem // btnSystem
// //
resources.ApplyResources(this.btnSystem, "btnSystem");
this.btnSystem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnSystem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnSystem.ButtonType = Rs.Controls.EButtonType.System; this.btnSystem.ButtonType = Rs.Controls.EButtonType.System;
this.btnSystem.Cursor = System.Windows.Forms.Cursors.Hand; this.btnSystem.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnSystem, "btnSystem");
this.btnSystem.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnSystem.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnSystem.ForeColor = System.Drawing.Color.White; this.btnSystem.ForeColor = System.Drawing.Color.White;
this.btnSystem.Name = "btnSystem"; this.btnSystem.Name = "btnSystem";
@ -180,16 +180,16 @@
// //
// panel11 // panel11
// //
resources.ApplyResources(this.panel11, "panel11");
this.panel11.Controls.Add(this.btnAbout); this.panel11.Controls.Add(this.btnAbout);
resources.ApplyResources(this.panel11, "panel11");
this.panel11.Name = "panel11"; this.panel11.Name = "panel11";
// //
// btnAbout // btnAbout
// //
resources.ApplyResources(this.btnAbout, "btnAbout");
this.btnAbout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnAbout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnAbout.ButtonType = Rs.Controls.EButtonType.About; this.btnAbout.ButtonType = Rs.Controls.EButtonType.About;
this.btnAbout.Cursor = System.Windows.Forms.Cursors.Hand; this.btnAbout.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnAbout, "btnAbout");
this.btnAbout.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnAbout.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnAbout.ForeColor = System.Drawing.Color.White; this.btnAbout.ForeColor = System.Drawing.Color.White;
this.btnAbout.Name = "btnAbout"; this.btnAbout.Name = "btnAbout";
@ -203,16 +203,16 @@
// //
// panel12 // panel12
// //
resources.ApplyResources(this.panel12, "panel12");
this.panel12.Controls.Add(this.btnData); this.panel12.Controls.Add(this.btnData);
resources.ApplyResources(this.panel12, "panel12");
this.panel12.Name = "panel12"; this.panel12.Name = "panel12";
// //
// btnData // btnData
// //
resources.ApplyResources(this.btnData, "btnData");
this.btnData.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnData.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnData.ButtonType = Rs.Controls.EButtonType.Language; this.btnData.ButtonType = Rs.Controls.EButtonType.Language;
this.btnData.Cursor = System.Windows.Forms.Cursors.Hand; this.btnData.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnData, "btnData");
this.btnData.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnData.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnData.ForeColor = System.Drawing.Color.White; this.btnData.ForeColor = System.Drawing.Color.White;
this.btnData.Name = "btnData"; this.btnData.Name = "btnData";
@ -226,16 +226,16 @@
// //
// panel13 // panel13
// //
resources.ApplyResources(this.panel13, "panel13");
this.panel13.Controls.Add(this.btnLanguage); this.panel13.Controls.Add(this.btnLanguage);
resources.ApplyResources(this.panel13, "panel13");
this.panel13.Name = "panel13"; this.panel13.Name = "panel13";
// //
// btnLanguage // btnLanguage
// //
resources.ApplyResources(this.btnLanguage, "btnLanguage");
this.btnLanguage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnLanguage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnLanguage.ButtonType = Rs.Controls.EButtonType.Data; this.btnLanguage.ButtonType = Rs.Controls.EButtonType.Calib;
this.btnLanguage.Cursor = System.Windows.Forms.Cursors.Hand; this.btnLanguage.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnLanguage, "btnLanguage");
this.btnLanguage.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnLanguage.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnLanguage.ForeColor = System.Drawing.Color.White; this.btnLanguage.ForeColor = System.Drawing.Color.White;
this.btnLanguage.Name = "btnLanguage"; this.btnLanguage.Name = "btnLanguage";
@ -249,16 +249,16 @@
// //
// panel14 // panel14
// //
resources.ApplyResources(this.panel14, "panel14");
this.panel14.Controls.Add(this.btnPermission); this.panel14.Controls.Add(this.btnPermission);
resources.ApplyResources(this.panel14, "panel14");
this.panel14.Name = "panel14"; this.panel14.Name = "panel14";
// //
// btnPermission // btnPermission
// //
resources.ApplyResources(this.btnPermission, "btnPermission");
this.btnPermission.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnPermission.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnPermission.ButtonType = Rs.Controls.EButtonType.Permission; this.btnPermission.ButtonType = Rs.Controls.EButtonType.Permission;
this.btnPermission.Cursor = System.Windows.Forms.Cursors.Hand; this.btnPermission.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnPermission, "btnPermission");
this.btnPermission.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnPermission.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnPermission.ForeColor = System.Drawing.Color.White; this.btnPermission.ForeColor = System.Drawing.Color.White;
this.btnPermission.Name = "btnPermission"; this.btnPermission.Name = "btnPermission";
@ -272,16 +272,16 @@
// //
// panel15 // panel15
// //
resources.ApplyResources(this.panel15, "panel15");
this.panel15.Controls.Add(this.btnQuit); this.panel15.Controls.Add(this.btnQuit);
resources.ApplyResources(this.panel15, "panel15");
this.panel15.Name = "panel15"; this.panel15.Name = "panel15";
// //
// btnQuit // btnQuit
// //
resources.ApplyResources(this.btnQuit, "btnQuit");
this.btnQuit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104))))); this.btnQuit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(52)))), ((int)(((byte)(104)))));
this.btnQuit.ButtonType = Rs.Controls.EButtonType.Quit; this.btnQuit.ButtonType = Rs.Controls.EButtonType.Quit;
this.btnQuit.Cursor = System.Windows.Forms.Cursors.Hand; this.btnQuit.Cursor = System.Windows.Forms.Cursors.Hand;
resources.ApplyResources(this.btnQuit, "btnQuit");
this.btnQuit.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnQuit.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnQuit.ForeColor = System.Drawing.Color.White; this.btnQuit.ForeColor = System.Drawing.Color.White;
this.btnQuit.Name = "btnQuit"; this.btnQuit.Name = "btnQuit";
@ -295,7 +295,6 @@
// //
// panel1 // panel1
// //
resources.ApplyResources(this.panel1, "panel1");
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(46)))), ((int)(((byte)(46)))), ((int)(((byte)(46))))); this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(46)))), ((int)(((byte)(46)))), ((int)(((byte)(46)))));
this.panel1.Controls.Add(this.panel7); this.panel1.Controls.Add(this.panel7);
this.panel1.Controls.Add(this.panel6); this.panel1.Controls.Add(this.panel6);
@ -305,12 +304,13 @@
this.panel1.Controls.Add(this.panelEx2); this.panel1.Controls.Add(this.panelEx2);
this.panel1.Controls.Add(this.tableLayoutPanel3); this.panel1.Controls.Add(this.tableLayoutPanel3);
this.panel1.Controls.Add(this.panelEx1); this.panel1.Controls.Add(this.panelEx1);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
// //
// panel7 // panel7
// //
resources.ApplyResources(this.panel7, "panel7");
this.panel7.Controls.Add(this.lblMonitorFlow); this.panel7.Controls.Add(this.lblMonitorFlow);
resources.ApplyResources(this.panel7, "panel7");
this.panel7.Name = "panel7"; this.panel7.Name = "panel7";
// //
// lblMonitorFlow // lblMonitorFlow
@ -321,8 +321,8 @@
// //
// panel6 // panel6
// //
resources.ApplyResources(this.panel6, "panel6");
this.panel6.Controls.Add(this.lblInitializeState); this.panel6.Controls.Add(this.lblInitializeState);
resources.ApplyResources(this.panel6, "panel6");
this.panel6.Name = "panel6"; this.panel6.Name = "panel6";
// //
// lblInitializeState // lblInitializeState
@ -333,8 +333,8 @@
// //
// panel5 // panel5
// //
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Controls.Add(this.lblMemory); this.panel5.Controls.Add(this.lblMemory);
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Name = "panel5"; this.panel5.Name = "panel5";
// //
// lblMemory // lblMemory
@ -345,8 +345,8 @@
// //
// panel4 // panel4
// //
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.lblTurnoverFlow); this.panel4.Controls.Add(this.lblTurnoverFlow);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4"; this.panel4.Name = "panel4";
// //
// lblTurnoverFlow // lblTurnoverFlow
@ -357,8 +357,8 @@
// //
// panel3 // panel3
// //
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.lblDischargeFlow); this.panel3.Controls.Add(this.lblDischargeFlow);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3"; this.panel3.Name = "panel3";
// //
// lblDischargeFlow // lblDischargeFlow
@ -369,8 +369,8 @@
// //
// panelEx2 // panelEx2
// //
resources.ApplyResources(this.panelEx2, "panelEx2");
this.panelEx2.Controls.Add(this.lblRunState); this.panelEx2.Controls.Add(this.lblRunState);
resources.ApplyResources(this.panelEx2, "panelEx2");
this.panelEx2.Name = "panelEx2"; this.panelEx2.Name = "panelEx2";
// //
// lblRunState // lblRunState
@ -400,14 +400,14 @@
// //
// panelEx1 // panelEx1
// //
resources.ApplyResources(this.panelEx1, "panelEx1");
this.panelEx1.Controls.Add(this.panel2); this.panelEx1.Controls.Add(this.panel2);
resources.ApplyResources(this.panelEx1, "panelEx1");
this.panelEx1.Name = "panelEx1"; this.panelEx1.Name = "panelEx1";
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.lblVersion); this.panel2.Controls.Add(this.lblVersion);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// lblVersion // lblVersion

File diff suppressed because it is too large Load Diff

@ -57,6 +57,7 @@
this.cboxEnableWorkEnviromentCheck = new System.Windows.Forms.CheckBox(); this.cboxEnableWorkEnviromentCheck = new System.Windows.Forms.CheckBox();
this.cboxDisableNPressCheck = new System.Windows.Forms.CheckBox(); this.cboxDisableNPressCheck = new System.Windows.Forms.CheckBox();
this.cboxEnableTestFixtureFiberCheck = new System.Windows.Forms.CheckBox(); this.cboxEnableTestFixtureFiberCheck = new System.Windows.Forms.CheckBox();
this.cboxEnableIndexTimeStatistics = new System.Windows.Forms.CheckBox();
this.cboxRunSpace = new System.Windows.Forms.CheckBox(); this.cboxRunSpace = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox10 = new System.Windows.Forms.GroupBox(); this.groupBox10 = new System.Windows.Forms.GroupBox();
@ -115,7 +116,6 @@
this.txtControlCenterPort = new System.Windows.Forms.TextBox(); this.txtControlCenterPort = new System.Windows.Forms.TextBox();
this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox(); this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox();
this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox(); this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox();
this.cboxEnableIndexTimeStatistics = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.groupBox8.SuspendLayout(); this.groupBox8.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@ -363,6 +363,13 @@
this.cboxEnableTestFixtureFiberCheck.UseVisualStyleBackColor = true; this.cboxEnableTestFixtureFiberCheck.UseVisualStyleBackColor = true;
this.cboxEnableTestFixtureFiberCheck.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged); this.cboxEnableTestFixtureFiberCheck.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged);
// //
// cboxEnableIndexTimeStatistics
//
resources.ApplyResources(this.cboxEnableIndexTimeStatistics, "cboxEnableIndexTimeStatistics");
this.cboxEnableIndexTimeStatistics.Name = "cboxEnableIndexTimeStatistics";
this.cboxEnableIndexTimeStatistics.UseVisualStyleBackColor = true;
this.cboxEnableIndexTimeStatistics.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged);
//
// cboxRunSpace // cboxRunSpace
// //
resources.ApplyResources(this.cboxRunSpace, "cboxRunSpace"); resources.ApplyResources(this.cboxRunSpace, "cboxRunSpace");
@ -694,6 +701,7 @@
this.groupBox4.Controls.Add(this.cboxEnableExceptionHandlingNozzle); this.groupBox4.Controls.Add(this.cboxEnableExceptionHandlingNozzle);
this.groupBox4.Controls.Add(this.cboxEnableScanBarCodeByDownCamera); this.groupBox4.Controls.Add(this.cboxEnableScanBarCodeByDownCamera);
resources.ApplyResources(this.groupBox4, "groupBox4"); resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.ForeColor = System.Drawing.Color.White;
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
// //
@ -814,13 +822,6 @@
this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera"; this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera";
this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true; this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true;
// //
// cboxEnableIndexTimeStatistics
//
resources.ApplyResources(this.cboxEnableIndexTimeStatistics, "cboxEnableIndexTimeStatistics");
this.cboxEnableIndexTimeStatistics.Name = "cboxEnableIndexTimeStatistics";
this.cboxEnableIndexTimeStatistics.UseVisualStyleBackColor = true;
this.cboxEnableIndexTimeStatistics.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged);
//
// CommonConfig // CommonConfig
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");

@ -124,13 +124,13 @@ namespace Rs.MotionPlat.SysConfig
{ {
dataGridView1.DataSource = dt; dataGridView1.DataSource = dt;
} }
if (GlobalUser.IsVender()) if (GlobalUser.IsSuper())
{ {
dataGridView1.Visible = true; groupBox4.Visible = true;
} }
else else
{ {
dataGridView1.Visible = false; groupBox4.Visible = false;
} }
} }
private void btnSaveSpeedParam_Click(object sender, EventArgs e) private void btnSaveSpeedParam_Click(object sender, EventArgs e)

@ -2533,7 +2533,7 @@
<value>4</value> <value>4</value>
</data> </data>
<data name="groupBox4.Text" xml:space="preserve"> <data name="groupBox4.Text" xml:space="preserve">
<value>groupBox4</value> <value>Menu</value>
</data> </data>
<data name="&gt;&gt;groupBox4.Name" xml:space="preserve"> <data name="&gt;&gt;groupBox4.Name" xml:space="preserve">
<value>groupBox4</value> <value>groupBox4</value>
@ -2623,6 +2623,6 @@
<value>CommonConfig</value> <value>CommonConfig</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=3.20.24.10, Culture=neutral, PublicKeyToken=null</value> <value>Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=3.20.24.14, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
</root> </root>

@ -14,6 +14,8 @@ namespace Rs.MotionPlat
{ {
public partial class UserForm : BaseFormHeader public partial class UserForm : BaseFormHeader
{ {
public event Action<string> OnloginSuccessEvent;
public UserForm() public UserForm()
{ {
InitializeComponent(); InitializeComponent();
@ -33,10 +35,11 @@ namespace Rs.MotionPlat
{ {
string username = cboxUsers.SelectedItem.ToString(); string username = cboxUsers.SelectedItem.ToString();
string userpwd = txtPassword.Text.Trim(); string userpwd = txtPassword.Text.Trim();
if(username=="操作员") if(username=="Op")
{ {
if(userpwd == "123") if(userpwd == "123")
{ {
OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Op; GlobalUser.UserLevel = EUserLevel.Op;
GlobalUser.UserName = username; GlobalUser.UserName = username;
this.Close(); this.Close();
@ -47,10 +50,11 @@ namespace Rs.MotionPlat
txtPassword.Text = ""; txtPassword.Text = "";
} }
} }
else if (username == "超级用户") else if (username == "Admin")
{ {
if (userpwd == "lhiven@123") if (userpwd == "lhiven@123")
{ {
OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Admin; GlobalUser.UserLevel = EUserLevel.Admin;
GlobalUser.UserName = username; GlobalUser.UserName = username;
this.Close(); this.Close();
@ -61,10 +65,11 @@ namespace Rs.MotionPlat
txtPassword.Text = ""; txtPassword.Text = "";
} }
} }
else if (username == "厂商") else if (username == "Vender")
{ {
if (userpwd == "rs@rs") if (userpwd == "rs@rs")
{ {
OnloginSuccessEvent?.Invoke(username);
GlobalUser.UserLevel = EUserLevel.Vender; GlobalUser.UserLevel = EUserLevel.Vender;
GlobalUser.UserName = username; GlobalUser.UserName = username;
this.Close(); this.Close();

@ -50,13 +50,14 @@
// cboxUsers // cboxUsers
// //
this.cboxUsers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); this.cboxUsers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36)))));
this.cboxUsers.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboxUsers.Font = new System.Drawing.Font("宋体", 15F); this.cboxUsers.Font = new System.Drawing.Font("宋体", 15F);
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[] {
"操作员", "Op",
"超级用户", "Admin",
"厂商"}); "Vender"});
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);
@ -108,6 +109,7 @@
// //
// UserForm // UserForm
// //
this.AcceptButton = this.btnLogin;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(389, 236); this.ClientSize = new System.Drawing.Size(389, 236);

Loading…
Cancel
Save