public async Task<ActionResult> AddDiscountedListing(int id) { AddEditDiscountedListingViewModel model = new AddEditDiscountedListingViewModel(); model.DiscountedListing.ListingID = id; model.LoggedInUser = await storeService.GetCurrentUser(); model.FullNavList = CreateStoreControllerAdminNavList(); return View(model); }
public async Task<ActionResult> AddDiscountedListing(AddEditDiscountedListingViewModel model) { model.LoggedInUser = await storeService.GetCurrentUser(); model.FullNavList = CreateStoreControllerAdminNavList(); if (ModelState.IsValid == false) { return View(model); } storeService.AddDiscountedListing(model.DiscountedListing, model.DaysDealLast); return RedirectToAction("AdminListings"); }