public ActionResult AddPopup(string btnId, string formId, ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(Content("Access denied")); } var sbw = new ShippingByWeightExtendedRecord { StoreId = model.StoreId, WarehouseId = model.WarehouseId, CountryId = model.CountryId, StateProvinceId = model.StateProvinceId, Zip = model.Zip == "*" ? null : model.Zip, ShippingMethodId = model.ShippingMethodId, From = model.From, To = model.To, AdditionalFixedCost = model.AdditionalFixedCost, RatePerWeightUnit = model.RatePerWeightUnit, PercentageRateOfSubtotal = model.PercentageRateOfSubtotal, LowerWeightLimit = model.LowerWeightLimit }; _ShippingByWeightExtendedService.InsertShippingByWeightExtendedRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("~/Plugins/SPC.Shipping.ShippingByWeightExtended/Views/ShippingByWeightExtended/AddPopup.cshtml", model)); }
public virtual void DeleteShippingByWeightExtendedRecord(ShippingByWeightExtendedRecord ShippingByWeightExtendedRecord) { if (ShippingByWeightExtendedRecord == null) { throw new ArgumentNullException("ShippingByWeightExtendedRecord"); } _sbwRepository.Delete(ShippingByWeightExtendedRecord); _cacheManager.RemoveByPattern(SHIPPINGBYWEIGHT_PATTERN_KEY); }