Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }