Ejemplo n.º 1
0
        private void btDangNhap_Click(object sender, EventArgs e)
        {
            TaiKhoan_DTO tk = new TaiKhoan_DTO();

            if (txtMatKhau.Text == "" || txtTaiKhoan.Text == "")
            {
                MessageBox.Show("Vui long khong de trong tai khoan hoac mat khau");
            }
            else
            {
                tk.TaiKhoan = txtTaiKhoan.Text;
                tk.MatKhau  = txtMatKhau.Text;
                if (busTaiKhoan.DangNhap(tk))
                {
                    FrmMain.taikhoan = tk.TaiKhoan;
                    DataTable dt = busTaiKhoan.KiemTraQuyen(tk.TaiKhoan);
                    Quyen = dt.Rows[0][0].ToString();
                    MessageBox.Show("Đăng nhập thành công");
                    FrmMain.session = 1;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Đăng nhập không thành công, kiểm tra lại email hoặc mật khẩu");
                    txtTaiKhoan.Text = null;
                    txtMatKhau.Text  = null;
                    txtTaiKhoan.Focus();
                }
            }
        }
Ejemplo n.º 2
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            TaiKhoan_BUS tK_BUS = new TaiKhoan_BUS();

            if (tK_BUS.DangNhap(txtTK.Text, txtMK.Text))
            {
                MessageBox.Show("Đăng nhập thành công vào hẹ thống", "Thông Báo");
                frmGiaoDien frm = new frmGiaoDien();
                this.Hide();
                frm.Show();
            }
            else
            {
                MessageBox.Show("Đăng nhập thất bại", "Thông Báo");
            }
        }