public ActionResult CreateLot(CreateLotModel model) { object image = Request.Files[0]; if (ModelState.IsValid) { if (Auction.CreateLot(model, HttpContext.User.Identity.Name, image)) { return(RedirectToAction("Index", "Home")); } } ModelState.AddModelError("", ""); return(View(model)); }
public ActionResult CreateLot(CreateLotModel model) { object image = Request.Files[0]; if (ModelState.IsValid) { var errormsg = Auction.CreateLot(model, HttpContext.User.Identity.Name, image); if (String.IsNullOrWhiteSpace(errormsg)) { return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", errormsg); } return(View(model)); }