Exemplo n.º 1
0
        //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 = "装配区";
                }
            }
        }
Exemplo n.º 2
0
        public FrmLogin()
        {
            InitializeComponent();
            //绑定用户列表
            cbUser.DataSource = BllUserLogin.GetUserNameList();


            //AccessSystem or = new AccessSystem();
            //or.AddOptrsAndRoles();
        }
Exemplo n.º 3
0
 //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;
     }
 }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
 public FrmLogin()
 {
     InitializeComponent();
     cbUser.DataSource = BllUserLogin.GetUserNameList();
 }
Exemplo n.º 6
0
 public FrmLogin()
 {
     InitializeComponent();
     //BackgroundImage = Properties.Resources.background;
     cbUser.DataSource = BllUserLogin.GetUserNameList();
 }