示例#1
0
 public static string CreateLot(CreateLotModel model, string ownername, object image)
 {
     try
     {
         if (dataAccess.CreateLot(ownername, model.Name, model.Description, model.ActualDate, model.StartCurrency, model.SelectedIds,image)) ;
         return null;
     }
     catch (Exception e)
     {
         return e.InnerException.Message;
     }
 }
 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);
 }
示例#4
0
 public static bool CreateLot(CreateLotModel model, string ownername, object image)
 {
     return dataAccess.CreateLot(ownername,model.Name, model.Description, model.ActualDate, model.Currency,model.LotType, image);
 }