public async Task <IActionResult> Details(int lotId, int saleId, string countryCode) { var user = await this.userManager.GetUserAsync(this.HttpContext.User); var lot = await this.auctionService.GetLotAsync(lotId, saleId, countryCode, user.UserName); var viewModel = new LotDetailsViewModel { Lot = lot, CountryCode = countryCode }; return(View(viewModel)); }
public ActionResult ManageLotStatus(LotDetailsViewModel viewModel) { var lot = _lotService.GetLotEntity(viewModel.Id); if (!viewModel.IsConfirm) { lot.IsConfirm = true; } if (viewModel.IsBlocked) { lot.IsBlocked = true; lot.BlockReason = viewModel.BlockReason; } else { lot.IsBlocked = false; } _lotService.UpdateLot(lot); return(RedirectToAction("LotDetails", "Lot", new { id = lot.Id })); }