Beispiel #1
0
 public void DangNhap()
 {
     if (m_FrmDangNhap == null || m_FrmDangNhap.IsDisposed)
     {
         m_FrmDangNhap = new FormDangNhap();
     }
     if (m_FrmDangNhap.ShowDialog() == DialogResult.OK)
     {
         string kq = BUS_PHANQUYEN.DangNhap(m_FrmDangNhap.txtUser.Text.ToString(), m_FrmDangNhap.txtPass.Text.ToString());
         if (kq == "MQ001")
         {
             Admin();
         }
         else
         {
             if (kq == "MQ002")
             {
                 User();
             }
             else
             {
                 m_FrmDangNhap.Hide();
                 if (MessageBox.Show("Đăng nhập không thành công", "error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
                 {
                     ;
                 }
                 {
                     m_FrmDangNhap = new FormDangNhap();
                     DangNhap();
                 }
             }
         }
     }
 }
 private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         BUS_PHANQUYEN.Xoa_TaiKhoan(txtMaNV.Text);
         DialogResult dr = MessageBox.Show("Xoa thành công");
         if (dr == DialogResult.OK)
         {
             FormPhanQuyen_Load(sender, e);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Loi");
     }
 }
 private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         PhanQuyenInfo nv = new PhanQuyenInfo(cmbMaQuyen.Text, txtMaNV.Text, txtMatKhau.Text, txtTenDN.Text);
         BUS_PHANQUYEN.Sua_TaiKhoan(nv);
         DialogResult dr = MessageBox.Show("Sua thành công");
         if (dr == DialogResult.OK)
         {
             FormPhanQuyen_Load(sender, e);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Loi");
     }
 }
 private void FormPhanQuyen_Load(object sender, EventArgs e)
 {
     grcPhanQuyen.DataSource = BUS_PHANQUYEN.HienThi_All();
 }