public void Save() { var model = DiscountService.GetDiscountModel(Discount.Id); model.Discount.Description = Description; model.Products = new List <DiscountProduct>(DiscountProducts.Where(o => o.Discount > 0.0m).Select(o => o.DiscountProduct)); model.Customers = new List <DiscountCustomer>(DiscountCustomers.Where(o => o.Selected).Select(o => o.DiscountCustomer)); DiscountService.UpdateDiscountModel(model); Close(); }
public void Save() { var model = new DiscountModel { Discount = new Discount { Description = Description }, Products = new List <DiscountProduct>(DiscountProducts.Where(o => o.Discount > 0.0m).Select(o => o.DiscountProduct)), Customers = new List <DiscountCustomer>(DiscountCustomers.Where(o => o.Selected).Select(o => o.DiscountCustomer)) }; DiscountService.InsertDiscountModel(model); Close(); }