//Chọn chức vụ dưới gridcontrol -> đưa lên comboboxchucvu public void ChonChucVu(FormNhanVien fnv) { var chucvutam = fnv.gridView1.GetRowCellValue(fnv.gridView1.FocusedRowHandle, "MACV").ToString(); var cv = data.Database().CHUCVUs.SingleOrDefault(c => c.MACV == chucvutam); fnv.comboBoxchucvu.Text = cv.TENCV; }
private void barButnhanvien_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FormNhanVien nv = new FormNhanVien(); nv.MdiParent = this; nv.Show(); }
//Load gridcontrol public void LoadChucVu(FormNhanVien fnv) { var cv = data.Database().CHUCVUs.ToList(); fnv.comboBoxchucvu.DataSource = cv; fnv.comboBoxchucvu.DisplayMember = "TENCV"; fnv.comboBoxchucvu.ValueMember = "MACV"; }
public void LoadData(FormNhanVien fnv) { var nv = data.Database().NHANVIENs.ToList(); fnv.gridControlNhanVien.DataSource = nv; //Load Mã Nhân Viên int dem = 10; int kyso = (int)data.Database().RETURN_KYSO("NV"); int len = kyso.ToString().Length; dem = dem - 2 - len; string kq = "NV"; for (int i = 1; i <= dem; i++) { kq += "0"; } fnv.txtmanhanvien.Text = kq + kyso.ToString(); }