private void LoadData() { dtgvNhanVien.DataSource = Employee.GetEmployeeList().Tables[0].DefaultView; cbJob.DataSource = Job.GetJobList().Tables[0].DefaultView; cbJob.DisplayMember = "Tên Công Việc"; cbJob.ValueMember = "Mã Công Việc"; cbUserName.DataSource = Account.GetAccountList().Tables[0].DefaultView; cbUserName.DisplayMember = "UserName"; cbUserName.ValueMember = "UserName"; }
private void LoadData() { dtgvDSTU.DataSource = Drink.GetDrinkList().Tables[0].DefaultView; cbLoaiTU.DataSource = DrinkCate.GetDrinkCategoryList().Tables[0].DefaultView; cbLoaiTU.DisplayMember = "Tên Mục"; cbLoaiTU.ValueMember = "Mã Mục"; cbLoaiTU.SelectedIndex = 0; cbCustomer.DataSource = Customer.GetCustomerList().Tables[0].DefaultView; cbCustomer.DisplayMember = "Họ Tên"; cbCustomer.ValueMember = "Mã KH"; cbEmployee.DataSource = Employee.GetEmployeeList().Tables[0].DefaultView; cbEmployee.DisplayMember = "Họ Tên"; cbEmployee.ValueMember = "Mã NV"; cbLoaiHD.DataSource = ExportBill.GetBillType().Tables[0].DefaultView; cbLoaiHD.DisplayMember = "Tên Loại"; cbLoaiHD.ValueMember = "Mã Loại"; txt_MaHD.Text = ExportBill.GetNextHoaDon(); }
private void cbTable_SelectedIndexChanged(object sender, EventArgs e) { string category = cbTable.SelectedItem.ToString(); switch (category) { case "Customers": { DisplayTable(cbSearchAttr, dtgvTable, Customers, Customer.GetCustomerList()); break; } case "Drinks": { DisplayTable(cbSearchAttr, dtgvTable, Drinks, Drink.GetDrinkList()); break; } case "Elements": { DisplayTable(cbSearchAttr, dtgvTable, Elements, Element.GetElementList()); break; } case "Employees": { DisplayTable(cbSearchAttr, dtgvTable, Employees, Employee.GetEmployeeList()); break; } case "ImportBills": { DisplayTable(cbSearchAttr, dtgvTable, ImportBills, ImportBill.GetAllBills()); break; } case "ExportBills": { DisplayTable(cbSearchAttr, dtgvTable, ExportBills, ExportBill.GetAllBills()); break; } case "Jobs": { DisplayTable(cbSearchAttr, dtgvTable, Jobs, Job.GetJobList()); break; } case "Suppliers": { DisplayTable(cbSearchAttr, dtgvTable, Suppliers, Supplier.GetSupplierList()); break; } case "Accounts": { DisplayTable(cbSearchAttr, dtgvTable, Accounts, Account.GetAccountList()); break; } } }