private void buttonRemoveType_Click(object sender, EventArgs e) { DishPresenter.RemoveType(removedType); listBoxTypes.ClearSelected(); buttonRemoveType.Visible = false; Initialize(); }
private void Initialize() { listBoxTypes.Items.Clear(); foreach (var type in DishPresenter.GetAllType()) { listBoxTypes.Items.Add(type); } }
private void buttonAddDish_Click(object sender, EventArgs e) { if (textBoxDescription.Text != "" && textBoxNameDish.Text != "" && maskedTextBoxPrice.Text != "" && maskedTextBoxTimeCooking.Text != "") { Dish newDish = new Dish(id, textBoxNameDish.Text, comboBoxTypeDish.Text, int.Parse(maskedTextBoxPrice.Text), int.Parse(maskedTextBoxTimeCooking.Text), textBoxDescription.Text, directoryPicture); DishPresenter.AddDish(newDish); } else { MessageBox.Show("Все поля являются обязательным для заполнения, кроме картинки", "Error"); } }
public FormAddDish() { InitializeComponent(); comboBoxTypeDish.DataSource = DishPresenter.GetAllType(); while (true) { if (DishPresenter.GetDishes().Exists(x => x.Id == id)) { id++; } else { break; } } }
private void buttonAutharization_Click(object sender, EventArgs e) { DishPresenter.Autharization(textBoxLogin, textBoxPassword); }
private void buttonAddType_Click(object sender, EventArgs e) { DishPresenter.AddType(textBoxAddType.Text); }