private Task BuildViewModel(ProductPartViewModel model, ProductPart part)
        {
            model.ContentItem = part.ContentItem;
            model.Sku         = part.Sku;
            model.ProductPart = part;

            return(Task.CompletedTask);
        }
Esempio n. 2
0
        //Update
        public async override Task <IDisplayResult> UpdateAsync(ProductPart part, IUpdateModel updater, UpdatePartEditorContext context)
        {
            var viewModel = new ProductPartViewModel();
            await updater.TryUpdateModelAsync(viewModel, Prefix);

            part.UnitPrice = viewModel.UnitPrice;
            part.Sku       = viewModel.Sku;
            return(await EditAsync(part, context));
        }
        private Task BuildViewModel(ProductPartViewModel model, ProductPart part)
        {
            model.ContentItem = part.ContentItem;
            model.Sku         = part.Sku;
            model.ProductPart = part;

            model.Attributes = _productAttributeService.GetProductAttributeFields(part.ContentItem);

            return(Task.CompletedTask);
        }
        private Task BuildViewModel(ProductPartViewModel model, ProductPart part)
        {
            model.ContentItem = part.ContentItem;
            model.Sku         = part.Sku;
            model.ProductPart = part;

            model.Attributes = _productAttributeService.GetProductAttributeFields(part.ContentItem);

            // TODO: filter out of inventory products here as well when we have inventory management
            // model.CanBeBought = ...;

            return(Task.CompletedTask);
        }