Exemple #1
0
        public async Task <ActionResult> EditAuction(AddEditAuctionViewModel model)
        {
            model.LoggedInUser = await auctionService.GetCurrentUser();

            model.FullNavList = CreateAuctionAdminNavList();

            if (ModelState.IsValid)
            {
                auctionService.EditAuction(model.Auction);
            }
            else
            {
                model.Auction = auctionService.GetAuctionByID(model.Auction.AuctionID);

                return(View(model));
            }

            model.Auction = auctionService.GetAuctionByID(model.Auction.AuctionID);

            ModelState.Clear();

            return(View(model));
        }