Пример #1
0
        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 }));
        }
Пример #2
0
        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);
        }
Пример #3
0
        public RedirectResult Add(AddPriceBreakModel model)
        {
            var priceBreak = _productVariantService.AddPriceBreak(model);

            return(Redirect(priceBreak.ProductVariant.EditUrl));
        }