コード例 #1
0
        public async Task<ActionResult> EditListing(AddEditListingViewModel model)
        {
            model.LoggedInUser = await storeService.GetCurrentUser();
            model.FullNavList = CreateStoreControllerAdminNavList();

            if (ModelState.IsValid == false)
            {
                return View(model);
            }

            storeService.EditListing(model.Listing);

            return RedirectToAction("AdminListings");
        }
コード例 #2
0
        public async Task<ActionResult> EditListing(int id)
        {
            AddEditListingViewModel model = new AddEditListingViewModel();

            model.Listing = storeService.GetListingByID(id);

            model.LoggedInUser = await storeService.GetCurrentUser();
            model.FullNavList = CreateStoreControllerAdminNavList();

            return View(model);
        }