public virtual IActionResult Create()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageStores))
            {
                return(AccessDeniedView());
            }

            //prepare model
            var model = _storeModelFactory.PrepareStoreModel(new StoreModel(), null);

            return(View(model));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageUserStore))
            {
                return(AccessDeniedView());
            }

            var store = _storeService.GetStoreById(id);

            if (store == null)
            {
                return(RedirectToAction("List"));
            }

            var model = await _storeModelFactory.PrepareStoreModel(null, store);

            return(View(model));
        }