public IActionResult EditPopup(ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(Content("Access denied")); } var sbw = _shippingByWeightService.GetById(model.Id); if (sbw == null) { //No record found with the specified id return(RedirectToAction("Configure")); } sbw.StoreId = model.StoreId; sbw.WarehouseId = model.WarehouseId; sbw.CountryId = model.CountryId; sbw.StateProvinceId = model.StateProvinceId; sbw.Zip = model.Zip == "*" ? null : model.Zip; sbw.ShippingMethodId = model.ShippingMethodId; sbw.From = model.From; sbw.To = model.To; sbw.AdditionalFixedCost = model.AdditionalFixedCost; sbw.RatePerWeightUnit = model.RatePerWeightUnit; sbw.PercentageRateOfSubtotal = model.PercentageRateOfSubtotal; sbw.LowerWeightLimit = model.LowerWeightLimit; _shippingByWeightService.UpdateShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; return(View("~/Plugins/Shipping.ByWeight/Views/EditPopup.cshtml", model)); }
public async Task <IActionResult> EditPopup(ShippingByWeightModel model) { var sbw = await _shippingByWeightService.GetById(model.Id); if (sbw == null) { //No record found with the specified id return(RedirectToAction("Configure")); } sbw.StoreId = model.StoreId; sbw.WarehouseId = model.WarehouseId; sbw.CountryId = model.CountryId; sbw.StateProvinceId = model.StateProvinceId; sbw.Zip = model.Zip == "*" ? null : model.Zip; sbw.ShippingMethodId = model.ShippingMethodId; sbw.From = model.From; sbw.To = model.To; sbw.AdditionalFixedCost = model.AdditionalFixedCost; sbw.RatePerWeightUnit = model.RatePerWeightUnit; sbw.PercentageRateOfSubtotal = model.PercentageRateOfSubtotal; sbw.LowerWeightLimit = model.LowerWeightLimit; await _shippingByWeightService.UpdateShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; return(View("~/Plugins/Shipping.ByWeight/Views/EditPopup.cshtml", model)); }
public ActionResult EditPopup(string btnId, string formId, ShippingByWeightModel model) { var sbw = _shippingByWeightService.GetById(model.Id); if (sbw == null) { //No record found with the specified id return(RedirectToAction("Configure")); } sbw.CountryId = model.CountryId; sbw.StateProvinceId = model.StateProvinceId; sbw.Zip = model.Zip == "*" ? null : model.Zip; sbw.ShippingMethodId = model.ShippingMethodId; sbw.From = model.From; sbw.To = model.To; sbw.AdditionalFixedCost = model.AdditionalFixedCost; sbw.RatePerWeightUnit = model.RatePerWeightUnit; sbw.PercentageRateOfSubtotal = model.PercentageRateOfSubtotal; sbw.LowerWeightLimit = model.LowerWeightLimit; _shippingByWeightService.UpdateShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("Nop.Plugin.Shipping.ByWeight.Views.ShippingByWeight.EditPopup", model)); }
public ActionResult EditRateByWeighPopup(string btnId, string formId, ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(RedirectToAction("AccessDenied", "Security", new { pageUrl = this.Request.RawUrl })); } var sbw = _shippingByWeightService.GetById(model.Id); if (sbw == null) { //no record found with the specified id return(RedirectToAction("Configure")); } sbw.StoreId = model.StoreId; sbw.WarehouseId = model.WarehouseId; sbw.CountryId = model.CountryId; sbw.StateProvinceId = model.StateProvinceId; sbw.Zip = model.Zip == "*" ? null : model.Zip; sbw.ShippingMethodId = model.ShippingMethodId; sbw.From = model.From; sbw.To = model.To; sbw.AdditionalFixedCost = model.AdditionalFixedCost; sbw.RatePerWeightUnit = model.RatePerWeightUnit; sbw.PercentageRateOfSubtotal = model.PercentageRateOfSubtotal; sbw.LowerWeightLimit = model.LowerWeightLimit; _shippingByWeightService.UpdateShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("~/Plugins/Shipping.JDFreight/Views/EditRateByWeightPopup.cshtml", model)); }
public ActionResult RateUpdate(ShippingByWeightModel model, GridCommand command) { var sbw = _shippingByWeightService.GetById(model.Id); sbw.From = model.From; sbw.To = model.To; sbw.UsePercentage = model.UsePercentage; sbw.ShippingChargeAmount = model.ShippingChargeAmount; sbw.ShippingChargePercentage = model.ShippingChargePercentage; _shippingByWeightService.UpdateShippingByWeightRecord(sbw); return(RatesList(command)); }
public ActionResult RateUpdate(ShippingByWeightModel model, GridCommand command) { var sbw = _shippingByWeightService.GetById(model.Id); sbw.From = model.From; sbw.To = model.To; sbw.UsePercentage = model.UsePercentage; sbw.Zip = model.Zip == "*" ? null : model.Zip; sbw.ShippingChargeAmount = model.ShippingChargeAmount; sbw.ShippingChargePercentage = model.ShippingChargePercentage; sbw.SmallQuantitySurcharge = model.SmallQuantitySurcharge; sbw.SmallQuantityThreshold = model.SmallQuantityThreshold; _shippingByWeightService.UpdateShippingByWeightRecord(sbw); return(RatesList(command)); }