Beispiel #1
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            string taikhoan = txtTaiKhoan.Text.Trim();
            string matkhau  = txtMatKhau.Text;
            var    rs       = dangNhapBUS.dangNhap(taikhoan, matkhau);

            if (rs != null)
            {
                this.Close();
                var lst = PhanQuyenBUS.GetList(rs.VaiTro);
                foreach (var roleForm in lst)
                {
                    Globalvar.DictMyRoleForm.Add(roleForm.MaForm, roleForm);
                }
                Globalvar.TK.MaTK   = rs.MaTK;
                Globalvar.TK.VaiTro = rs.VaiTro;
            }
            else
            {
                this.Close();
                login frm = new login();
                MessageBox.Show("sai tài khoản hoặc mật khẩu");
                frm.ShowDialog();
            }
        }