private string GetCashierName() { string selectedCashierName; if (selectedCashierId > 0) { entities.Cashier cashier = cashiers.FindOne(selectedCashierId); selectedCashierName = cashier.GetName(); } else { selectedCashierName = "Основной"; } return(selectedCashierName); }
private bool AddCashier() { if (addCashierNameBox.Text == "") { MessageBox.Show("Имя обязательно"); return(false); } entities.Cashier cashier = new entities.Cashier(0, addCashierNameBox.Text); cashiers.SaveWithSql(cashier); cashiersProvider.Add(cashier); cashiersGridView.Update(); addCashierNameBox.Text = ""; MessageBox.Show("Сохранено"); return(true); }
private void SelectFormCashier(entities.Cashier cashier) { selectedCashier = cashier; cashierBox.Visible = true; cashierNameBox.Text = cashier.GetName(); }