Exemple #1
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            if (loginBUS.IsValid(txtUserName.Text, txtPassword.Text))
            {
                DataTable data = new DataTable();
                data = loginBUS.GetAccountType(txtUserName.Text);
                int MaChucVu = 0;
                int MaNV     = 0;

                foreach (DataRow row in data.Rows)
                {
                    MaChucVu = int.Parse(row["MaChucVu"].ToString());
                    MaNV     = int.Parse(row["MaNV"].ToString());
                }
                frmMainForm frmMain = new frmMainForm(MaChucVu, MaNV);
                this.Hide();
                frmMain.ShowDialog();
                this.Show();
            }
            else
            {
                if (string.IsNullOrEmpty(txtUserName.Text) || string.IsNullOrEmpty(txtPassword.Text))
                {
                    XtraMessageBox.Show("TÊN TÀI KHOẢN HOẶC MẬT KHẨU KHÔNG ĐÚNG! ", "Notificantions", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemple #2
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     if (loginBUS.IsValid(txtID.Text, txtPassWord.Text))
     {
         Form1 form = new Form1();
         form.Account_type = loginBUS.GetAccountType(txtID.Text);
         form.Show();
         this.Hide();
     }
 }