Пример #1
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            BL_DangNhap dangNhap = new BL_DangNhap();
            string      MaNV     = "";

            BL_DangNhap.AccountType accountType = BL_DangNhap.AccountType.Employee;
            bool result = dangNhap.Select(txtUserName.Text.Trim(), txtPassword.Text.Trim(), ref MaNV, ref accountType, ref error);

            if (result)
            {
                this.Hide();
                FrmMain main = new FrmMain(MaNV, accountType);
                main.ShowDialog();
                if (exit == false)
                {
                    this.Show();
                    txtUserName.Clear();
                    txtPassword.Clear();
                    txtUserName.Focus();
                }
            }
            else
            {
                MessageBox.Show("Thông tin đăng nhập không chính xác. Mời nhập lại!", "Lỗi đăng nhập", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtUserName.Clear();
                txtPassword.Clear();
                txtUserName.Focus();
            }
        }
Пример #2
0
 public FrmDoiMatKhau(string tendangnhap)
 {
     InitializeComponent();
     blDangNhap       = new BL_DangNhap(this);
     this.tendangnhap = tendangnhap;
 }
Пример #3
0
 public FrmDangNhap()
 {
     InitializeComponent();
     blDangNhap = new BL_DangNhap(this);
     Reset();
 }