public ActionResult GetShippingList(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageProducts)) { return(null); } var model = new ProductShippingByProductModel(); var records = _ShippingByWeightExtendedService.GetProductMapToShippingMethodForProduct(id); model.shippingMethods = records.Select(x => { var m = new ProductShippingByProductMethodsModel { shippingMethodId = x.shippingMethodId, shippingMethodName = x.shippingMethodName, freeShipping = x.freeShipping }; return(m); }).ToList(); model.productId = id; return(PartialView("~/Plugins/SPC.Shipping.ShippingByWeightExtended/Views/ProductAdmin/Configure.cshtml", model)); }
public void Save(ProductShippingByProductModel model) { IEnumerable <Domain.ProductMapToShippingMethodRecord> records = model.shippingMethods.Select(x => { var m = new Domain.ProductMapToShippingMethodRecord { shippingMethodId = x.shippingMethodId, productId = model.productId, freeShipping = x.freeShipping }; return(m); } ); _ShippingByWeightExtendedService.UpdateProductMapToShippingMethodRecords(records); }