private void frmNhanVien_Load(object sender, EventArgs e)
        {
            try { 
            QUANLYXEKHACHEntities db = new QUANLYXEKHACHEntities();
            cbQuyenHan.DataSource = db.tblPhanQuyens.Select(t => t.TenQuyen).ToList();
            cbLoaiNV.Items.Clear();
            cbLoaiNV.DataSource = db.tblLoaiNhanViens.Select(t => t.TenLoaiNhanVien).ToList();

            BLL_NhanVien temp = new BLL_NhanVien();
            txtMaNhanVien.Text = temp.getLastestIndex().ToString();
            LoadDataGridView();
            }
            catch { }
        }
예제 #2
0
        private void frmNhanVien_Load(object sender, EventArgs e)
        {
            try { 
            QUANLYXEKHACHEntities db = new QUANLYXEKHACHEntities();
            cbQuyenHan.DataSource = db.tblPhanQuyens.Select(t => t.TenQuyen).ToList();
            cbLoaiNV.Items.Clear();
            cbLoaiNV.DataSource = db.tblLoaiNhanViens.Select(t => t.TenLoaiNhanVien).ToList();

            BLL_NhanVien temp = new BLL_NhanVien();
            txtMaNhanVien.Text = temp.getLastestIndex().ToString();
            LoadDataGridView();
            
            Gan_click();
            if (cbPass.Checked)
            {
                this.txtMatKhau.UseSystemPasswordChar = false;
            }
            else
            {
                this.txtMatKhau.UseSystemPasswordChar = true;
            }
            }
            catch { }
        }
 public void reset()
 {
     this.txtMaNhanVien.Text = "";
     this.txtTenNhanVien.Text = "";
     this.txtDiaChi.Text = "";           
     this.dtNgaySinh.Text = "";
     this.txtCMND.Text = "";
     this.cbLoaiNV.Text = "";
     this.txtTaiKhoan.Text = "";
     this.txtMatKhau.Text = "";
     this.cbQuyenHan.Text = "";
     LoadDataGridView();
     BLL_NhanVien temp = new BLL_NhanVien();
     txtMaNhanVien.Text = temp.getLastestIndex().ToString();
     dgvNhanVien.Enabled = true;
     btxoa.Enabled = true;
     // Gan_click();
 }