private void CashierChooseForm_Load(object sender, EventArgs e) { foreach (entities.Cashier cashier in cashiers.GetList()) { Item item = new Item(cashier.GetName(), cashier.GetId()); cashiersList.Items.Add(item); cashiersList.SelectedItem = item; } }
private void CashiersBookForm_Load(object sender, EventArgs e) { cashiers = new repositories.Cashier(db); dataMapper = new services.DataMapper(db); dataMapper.FillCashiers(cashiers); foreach (entities.Cashier cashier in cashiers.GetList()) { cashiersProvider.Add(cashier); } if (cashiersProvider.Count > 0) { SelectFormCashier(cashiersProvider[0]); } cashiersGridView.DataSource = cashiersProvider; cashiersGridView.Update(); }