private void View_AddNewPrice(object sender, EventArgs e) { var check = new PriceValidation(View.Price, View.Discount); if (!check.IsValid) { View.WarningMessage(check.WarningMessage); return; } var price = new Ceny(); FillInPriceFromView(price); db.Prices.Add(price); SaveDBChanges(); }
private void View_UpdatePrice(object sender, EventArgs e) { var check = new PriceValidation(View.Price, View.Discount); if (!check.IsValid) { View.WarningMessage(check.WarningMessage); return; } var price = GetPriceById(View.Id); FillInPriceFromView(price); SaveDBChanges(); }