private void AddProductToProfile(object sender, EventArgs e) { if (((sender as Button).Parent as SearchedProducts_Control).IsValidWeight) // walidacja textboxa z waga { Product_mass = ((sender as Button).Parent as SearchedProducts_Control).Product_Mass; IndexMeal = Meals.FindIndex(x => x.MealName == Meal_ComboBox.Text); IsFinished = true; this.Close(); } else { new GiveUserInfo_Form(true, "Wprowadzono nieprawidłową masę produktu"); } }
public ProductInMeal_Control(Product_Mass product) { InitializeComponent(); Product = product; OwnInitializeComponents(); }