public RedirectToRouteResult Add(AddPriceBreakModel model) { var priceBreak = _productVariantService.AddPriceBreak(model); // product is edited by the webpage controller as it is a webpage return(RedirectToAction("Edit", "Webpage", new { id = priceBreak.ProductVariant.Product.Id })); }
public PriceBreak AddPriceBreak(AddPriceBreakModel model) { var productVariant = _session.Get <ProductVariant>(model.Id); var priceBreak = new PriceBreak { ProductVariant = productVariant, Quantity = model.Quantity, Price = model.Price }; productVariant.PriceBreaks.Add(priceBreak); _session.Transact(session => session.SaveOrUpdate(priceBreak)); return(priceBreak); }
public RedirectResult Add(AddPriceBreakModel model) { var priceBreak = _productVariantService.AddPriceBreak(model); return(Redirect(priceBreak.ProductVariant.EditUrl)); }