public ActionResult DeleteLot(LotModel Model) { if (Auction.DeleteLot(Model)) { return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "Fail while model deleting."); return(Index(Model)); }
public ActionResult DeleteLot(LotViewModel model) { var lotid = Convert.ToInt32(Request.Cookies["LotId"].Value); if (Auction.DeleteLot(lotid)) { return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "Fail while model deleting."); return(RedirectToAction("Index", new { id = lotid })); }