private void FrmTuyChonTaikhoanDangNhap_Load(object sender, EventArgs e)
        {
            blNhanVien         = new BL_NhanVien(this);
            blQuyen            = new BL_Quyen(this);
            blTaiKhoanDangNhap = new BL_TaiKhoanDangNhap(this);
            //Lấy quyền
            DataTable quyen = blQuyen.LayDanhSachQuyen();

            cbQuyen.DataSource    = quyen;
            cbQuyen.DisplayMember = "TENQUYEN";
            cbQuyen.ValueMember   = "ID_QUYEN";

            if (loaiTuyChon == 1)
            {
                this.Text = "THÊM MỚI TÀI KHOẢN";
                //Lấy nhân viên
                DataTable nhanVienChuaCoTaiKhoan = blNhanVien.LayNhanVienChuaCoTaiKhoan();
                cbNhanVien.DataSource    = nhanVienChuaCoTaiKhoan;
                cbNhanVien.DisplayMember = "TENNHANVIEN";
                cbNhanVien.ValueMember   = "ID_NHANVIEN";
            }
            else
            {
                this.Text          = "CẬP NHẬT TÀI KHOẢN";
                cbNhanVien.Enabled = false;
                //Nhân viên
                cbNhanVien.SelectedText  = row.Cells["TENNHANVIEN"].Value.ToString();
                cbNhanVien.SelectedValue = Int32.Parse(row.Cells["ID_NHANVIEN"].Value.ToString());
                txtTenDangNhap.Text      = row.Cells["TENDANGNHAP"].Value.ToString();
                cbQuyen.SelectedValue    = Int32.Parse(row.Cells["ID_QUYEN"].Value.ToString());
                //cbQuyen.SelectedText = row.Cells["TENQUYEN"].Value.ToString();
            }
        }
Exemplo n.º 2
0
 public FrmTaiKhoanDangNhap()
 {
     InitializeComponent();
     blTaiKhoanDangNhap = new BL_TaiKhoanDangNhap(this);
     blNhanVien         = new BL_NhanVien(this);
 }