private void Tai_Thong_Tin_Chuc_Vu() { ChucVuBUS ChucVuBUS = new ChucVuBUS(); DataTable dsChucVu = ChucVuBUS.LayDanhSachChucVu(); dgvChucVu.DataSource = dsChucVu; }
private void Tai_Thong_Tin() { dtpNgaySinh.Format = DateTimePickerFormat.Custom; dtpNgaySinh.CustomFormat = "MMMM dd yyyy"; dtpNgayTiepNhan.Format = DateTimePickerFormat.Custom; dtpNgayTiepNhan.CustomFormat = "MMMM dd yyyy"; BangCapBUS bangCapBUS = new BangCapBUS(); DataTable dsBangCap = bangCapBUS.LayDanhSachBangCap(); cbbBangCap.DataSource = dsBangCap; cbbBangCap.DisplayMember = dsBangCap.Columns[1].ColumnName; cbbBangCap.ValueMember = dsBangCap.Columns[0].ColumnName; BoPhanBUS boPhanBUS = new BoPhanBUS(); DataTable dsBoPhan = boPhanBUS.LayDanhSachBoPhan(); cbbBoPhan.DataSource = dsBoPhan; cbbBoPhan.DisplayMember = dsBoPhan.Columns[1].ColumnName; cbbBoPhan.ValueMember = dsBoPhan.Columns[0].ColumnName; ChucVuBUS chucVuBUS = new ChucVuBUS(); DataTable dsChucVu = chucVuBUS.LayDanhSachChucVu(); cbbChucVu.DataSource = dsChucVu; cbbChucVu.DisplayMember = dsChucVu.Columns[1].ColumnName; cbbChucVu.ValueMember = dsChucVu.Columns[0].ColumnName; NhanVienBUS nhanVienBUS = new NhanVienBUS(); txtMaNhanVien.Text = nhanVienBUS.LayMaNhanVienMoi(); }
void Tai_Thong_Tin() { NhanVienBUS nhanVienBUS = new NhanVienBUS(); dsNhanVien = nhanVienBUS.LayDanhSachNhanVien(); if (LanDauDoDuLieu == 0) { TinhTrangNhanVienBUS tinhTrangNhanVienBUS = new TinhTrangNhanVienBUS(); DataTable dsTTNV = tinhTrangNhanVienBUS.LayDanhSachTinhTrangNhanVien(); DataGridViewComboBoxColumn dgvComboTinhTrangNhanVien = new DataGridViewComboBoxColumn(); dgvComboTinhTrangNhanVien.DataSource = dsTTNV; dgvComboTinhTrangNhanVien.DisplayMember = dsTTNV.Columns[1].ColumnName; dgvComboTinhTrangNhanVien.ValueMember = dsTTNV.Columns[0].ColumnName; dgvComboTinhTrangNhanVien.DataPropertyName = "MaTTNV"; dgvComboTinhTrangNhanVien.HeaderText = "Tình Trạng"; dgvComboTinhTrangNhanVien.Width = 50; dgvDanhSachNhanVien.Columns.Add(dgvComboTinhTrangNhanVien); BangCapBUS bangCapBUS = new BangCapBUS(); DataTable dsBangCap = bangCapBUS.LayDanhSachBangCap(); DataGridViewComboBoxColumn dgvComboBangCap = new DataGridViewComboBoxColumn(); dgvComboBangCap.DataSource = dsBangCap; dgvComboBangCap.DisplayMember = dsBangCap.Columns[1].ColumnName; dgvComboBangCap.ValueMember = dsBangCap.Columns[0].ColumnName; dgvComboBangCap.DataPropertyName = "MaBangCap"; dgvComboBangCap.HeaderText = "Bằng cấp"; dgvComboBangCap.Width = 50; dgvDanhSachNhanVien.Columns.Add(dgvComboBangCap); BoPhanBUS boPhanBUS = new BoPhanBUS(); DataTable dsBoPhan = boPhanBUS.LayDanhSachBoPhan(); DataGridViewComboBoxColumn dgvComboBoPhan = new DataGridViewComboBoxColumn(); dgvComboBoPhan.DataSource = dsBoPhan; dgvComboBoPhan.DisplayMember = dsBoPhan.Columns[1].ColumnName; dgvComboBoPhan.ValueMember = dsBoPhan.Columns[0].ColumnName; dgvComboBoPhan.DataPropertyName = "MaBoPhan"; dgvComboBoPhan.HeaderText = "Bộ phận"; dgvComboBoPhan.Width = 50; dgvDanhSachNhanVien.Columns.Add(dgvComboBoPhan); ChucVuBUS chucVuBUS = new ChucVuBUS(); DataTable dsChucVu = chucVuBUS.LayDanhSachChucVu(); DataGridViewComboBoxColumn dgvComboChucVu = new DataGridViewComboBoxColumn(); dgvComboChucVu.DataSource = dsChucVu; dgvComboChucVu.DisplayMember = dsChucVu.Columns[1].ColumnName; dgvComboChucVu.ValueMember = dsChucVu.Columns[0].ColumnName; dgvComboChucVu.DataPropertyName = "MaChucVu"; dgvComboChucVu.HeaderText = "Chức vụ"; dgvComboChucVu.Width = 50; dgvDanhSachNhanVien.Columns.Add(dgvComboChucVu); LanDauDoDuLieu++; } dgvDanhSachNhanVien.DataSource = dsNhanVien; }