コード例 #1
0
ファイル: Auction.cs プロジェクト: DzmitryLvov/OnlineAuction
 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;
     }
 }
コード例 #2
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);
 }
コード例 #3
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);
 }
コード例 #4
0
ファイル: Auction.cs プロジェクト: DzmitryLvov/OnlineAuction
 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);
 }