public void AssetAdd_Load(object sender, EventArgs e) { List <Locale> list = localeDao.getLocales(); LocaleCB.DataSource = list; LocaleCB.DisplayMember = "LocaleName"; LocaleCB.ValueMember = "LocaleId"; List <Supplier> list1 = supplierDao.getSuppliers(); SupplierCB.DataSource = list1; SupplierCB.DisplayMember = "SupplierName"; SupplierCB.ValueMember = "SupplierId"; List <PropertyClass> list2 = assetsClassDao.getPCList(); AssetsClassCB.DataSource = list2; AssetsClassCB.DisplayMember = "PcName"; AssetsClassCB.ValueMember = "PcId"; List <Brand> list3 = brandDao.getBrands(); BrandCB.DataSource = list3; BrandCB.DisplayMember = "BrandName"; BrandCB.ValueMember = "BrandId"; }
private void initData() { dataGridView1.Rows.Clear(); LocaleDao dao = new LocaleDao(); List <Locale> list = dao.getLocales(); foreach (Locale locale in list) { int index = dataGridView1.Rows.Add(); dataGridView1.Rows[index].Tag = locale; dataGridView1.Rows[index].Cells[0].Value = locale.LocaleId; dataGridView1.Rows[index].Cells[1].Value = locale.LocaleType; dataGridView1.Rows[index].Cells[2].Value = locale.LocaleName; dataGridView1.Rows[index].Cells[3].Value = locale.LocaleState; dataGridView1.Rows[index].Cells[4].Value = locale.LocaleExplain; } }