Exemplo n.º 1
0
        public ActionResult Edit(StoreMappingModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageStores))
            {
                return(AccessDeniedView());
            }

            var storeMapping = _storeMappingService.GetStoreMappingById(model.Id);

            if (storeMapping == null)
            {
                //No store found with the specified id
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                storeMapping = model.ToEntity(storeMapping);
                _storeMappingService.UpdateStoreMapping(storeMapping);

                SuccessNotification(_localizationService.GetResource("Admin.Configuration.Stores.Updated"));
                return(continueEditing ? RedirectToAction("Edit", new { id = storeMapping.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the store mapping record
 /// </summary>
 /// <param name="storeMapping">Store mapping</param>
 public void UpdateStoreMapping([FromBody] StoreMapping storeMapping)
 {
     _storeMappingService.UpdateStoreMapping(storeMapping);
 }