private void frmPhongMay_Load(object sender, EventArgs e) { listPH = p.GetAllPhongHoc(); bsPH.DataSource = listPH; //buoc 1 dgrPhongHoc.DataSource = bsPH; // buoc 2 bindingNavigatorPhongHoc.BindingSource = bsPH; // buoc 3 FormatLuoi(dgrPhongHoc); }
private void btnThemPhong_Click(object sender, EventArgs e) { frmPhongMay frm = new LinQThucHanhComputer.frmPhongMay(); //frm.MdiParent = this.MdiParent; if (frm.ShowDialog() == DialogResult.OK) { IEnumerable <tblPhonghoc> dsP = p.GetAllPhongHoc(); LoadPhongToTree(trePhong, dsP); } }
private void frmTimKiemAutocomlet_Load(object sender, EventArgs e) { radTheoMa.Checked = true; p = new clsPhongHoc(); m = new clsMayTinh(); lvwDSMay.LargeImageList = imgLon; lvwDSMay.SmallImageList = imgNho; TaoTieuDeCot(lvwDSMay); IEnumerable <tblPhonghoc> dsP = p.GetAllPhongHoc(); lstDSPhong.DisplayMember = "TenPhong"; //ten field hien ra lstDSPhong.ValueMember = "msPhong"; // ten field ma chon ten lay ma lstDSPhong.DataSource = dsP; // nguon du lieu txtDULieuTim.AutoCompleteMode = AutoCompleteMode.Suggest; txtDULieuTim.AutoCompleteSource = AutoCompleteSource.CustomSource; }
private void frmQLComputer_Load(object sender, EventArgs e) { btnLuu.Enabled = false; btnSua.Enabled = false; btnXoa.Enabled = false; lvwDSMay.LargeImageList = imgLon; lvwDSMay.SmallImageList = imgNho; TaoTieuDeCot(lvwDSMay); nGoc = new TreeNode("Danh Sach Phong"); p = new clsPhongHoc(); m = new clsMayTinh(); trePhong.ImageList = imgTree;//co 2 hinh IEnumerable <tblPhonghoc> ds = p.GetAllPhongHoc(); LoadPhongToTree(trePhong, ds); }