예제 #1
0
        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));
        }
예제 #2
0
        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));
        }