private void btn_Edit_Click(object sender, EventArgs e) { var selectedItem = listViewDrinks.SelectedItems[0]; Drink selectedDrink = drinks.Where(t => t.Name == selectedItem.Text).FirstOrDefault(); DrinkDialog drinkDialog = new DrinkDialog(selectedDrink); drinkDialog.Show(); btn_Edit_Drink.Enabled = false; btn_Add_Drink.Enabled = false; }
private void btn_Add_Drink_Click(object sender, EventArgs e) { DrinkDialog drinkDialog = new DrinkDialog(); drinkDialog.Show(); }