public ActionResult AddPopup(string btnId, string formId, ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(Content("Access denied")); } var sbw = new ShippingByWeightRecord() { 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 }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("Nop.Plugin.Shipping.ByWeight.Views.ShippingByWeight.AddPopup", model)); }
public IActionResult AddPopup(ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(Content("Access denied")); } var sbw = new ShippingByWeightRecord { 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 }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; return(View("~/Plugins/Shipping.ByWeight/Views/AddPopup.cshtml", model)); }
public ActionResult AddRateByWeighPopup(string btnId, string formId, ShippingByWeightModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings)) { return(RedirectToAction("AccessDenied", "Security", new { pageUrl = this.Request.RawUrl })); } var sbw = new ShippingByWeightRecord { 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 }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("~/Plugins/Shipping.JDFreight/Views/AddRateByWeightPopup.cshtml", model)); }
public ActionResult AddShippingByWeightRecord(ShippingByWeightListModel model) { if (!ModelState.IsValid) { return(Configure()); } var sbw = new ShippingByWeightRecord() { StoreId = model.AddStoreId, ShippingMethodId = model.AddShippingMethodId, CountryId = model.AddCountryId, Zip = model.AddZip, //StateProvinceId = 0, From = model.AddFrom, To = model.AddTo, UsePercentage = model.AddUsePercentage, ShippingChargeAmount = model.AddShippingChargeAmount, ShippingChargePercentage = model.AddShippingChargePercentage, SmallQuantitySurcharge = model.SmallQuantitySurcharge, SmallQuantityThreshold = model.SmallQuantityThreshold, }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); return(Configure()); }
public ActionResult AddShippingRate(ShippingByWeightListModel model) { var sbw = new ShippingByWeightRecord() { ShippingMethodId = model.AddShippingMethodId, CountryId = model.AddCountryId, StateProvinceId = model.AddStateProvinceId, Zip = model.AddZip, From = model.AddFrom, To = model.AddTo, UsePercentage = model.AddUsePercentage, ShippingChargeAmount = model.AddShippingChargeAmount, ShippingChargePercentage = model.AddShippingChargePercentage }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); return(Json(new { Result = true })); }
public async Task <IActionResult> AddPopup(ShippingByWeightModel model) { var sbw = new ShippingByWeightRecord { 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 }; await _shippingByWeightService.InsertShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; return(View("~/Plugins/Shipping.ByWeight/Views/AddPopup.cshtml", model)); }
public ActionResult AddShippingByWeightRecord(ShippingByWeightListModel model) { if (!ModelState.IsValid) { return(Configure()); } var sbw = new ShippingByWeightRecord() { ShippingMethodId = model.AddShippingMethodId, CountryId = model.AddCountryId, From = model.AddFrom, To = model.AddTo, UsePercentage = model.AddUsePercentage, ShippingChargeAmount = model.AddShippingChargeAmount, ShippingChargePercentage = model.AddShippingChargePercentage }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); return(Configure()); }
public ActionResult AddPopup(string btnId, string formId, ShippingByWeightModel model) { var sbw = new ShippingByWeightRecord() { 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 }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); ViewBag.RefreshPage = true; ViewBag.btnId = btnId; ViewBag.formId = formId; return(View("Nop.Plugin.Shipping.ByWeight.Views.ShippingByWeight.AddPopup", model)); }
public ActionResult AddShippingByWeightRecord(ShippingByWeightListModel model) { var sbw = new ShippingByWeightRecord() { StoreId = model.AddStoreId, ShippingMethodId = model.AddShippingMethodId, CountryId = model.AddCountryId, Zip = model.AddZip, //StateProvinceId = 0, From = model.AddFrom, To = model.AddTo, UsePercentage = model.AddUsePercentage, ShippingChargeAmount = model.AddShippingChargeAmount, ShippingChargePercentage = model.AddShippingChargePercentage, SmallQuantitySurcharge = model.SmallQuantitySurcharge, SmallQuantityThreshold = model.SmallQuantityThreshold, }; _shippingByWeightService.InsertShippingByWeightRecord(sbw); NotifySuccess(T("Plugins.Shipping.ByWeight.AddNewRecord.Success")); return(Json(new { Result = true })); }