Beispiel #1
0
 public ActionResult Create(PlaceBidViewModel model)
 {
     try
     {
         if (model.Bid.Name == "") {
             return View(model.Bid);
         } else {
             // TODO: Add insert logic here
             if (ModelState.IsValid) {
                 _repo.AddBidToItem(model.Bid, _repo.GetAuctionItemById(model.AccountId));
                 return RedirectToAction("Index", "AuctionItems");
             } else {
                 return View();
             }
         }
     }
     catch
     {
         return View(model.Bid);
     }
 }
        public ActionResult PlaceBid(PlaceBidViewModel model)
        {
            _repo.PlaceBid(model.Bid, _repo.GetAuctionItemById(model.AuctionItemId));

            return RedirectToAction("Index", "AuctionItems");
        }