//1.读取用户输入 //todo 登录不用下拉框,用户名不重复 private void btnLogin_Click(object sender, EventArgs e) { var ul = new BllUserLogin(); if (ul.CheckLogin(cbUser.Text, tbPassword.Text)) { DialogResult = DialogResult.OK; var usr = BllUserLogin.GetUser(cbUser.Text); UserStatics.OptrName = usr.Name; UserStatics.OptrId = usr.Id; UserStatics.OptrType = usr.MainOptrType; if (UserStatics.OptrType == "Test") { UserStatics.WorkShop = "测试区"; } if (UserStatics.OptrType == "Package") { UserStatics.WorkShop = "塑封区"; } if (UserStatics.OptrType == "Assembly") { UserStatics.WorkShop = "装配区"; } } }
public FrmLogin() { InitializeComponent(); //绑定用户列表 cbUser.DataSource = BllUserLogin.GetUserNameList(); //AccessSystem or = new AccessSystem(); //or.AddOptrsAndRoles(); }
//1.读取用户输入 //todo 登录不用下拉框,用户名不重复 private void btnLogin_Click(object sender, EventArgs e) { if (BllUserLogin.CheckLogin(cbUser.Text, tbPassword.Text)) { DialogResult = DialogResult.OK; var usr = BllUserLogin.GetUser(cbUser.Text); UserStatics.OptrName = usr.Name; UserStatics.ChineseName = usr.ChineseName; UserStatics.OptrId = usr.Id; UserStatics.OptrType = usr.MainOptrType; } }
private void btnLogin_Click(object sender, EventArgs e) { if (cbUser.Text != "root" && cbUser.Text != "TestAdmin" && cbUser.Text != "PackageAdmin") { MessageBox.Show("该功能只有管理员能够使用,请联系管理员"); Application.Exit(); } var ul = new BllUserLogin(); if (ul.CheckLogin(cbUser.Text, tbPassword.Text)) { DialogResult = DialogResult.OK; var usr = BllUserLogin.GetUserName(cbUser.Text); Common.UserStatics.Username = usr.Name; Common.UserStatics.UserId = usr.Id; } }
public FrmLogin() { InitializeComponent(); cbUser.DataSource = BllUserLogin.GetUserNameList(); }
public FrmLogin() { InitializeComponent(); //BackgroundImage = Properties.Resources.background; cbUser.DataSource = BllUserLogin.GetUserNameList(); }