public ActionResult Create(CreateAuctionViewModel model) { if (ModelState.IsValid) { try { _auctionFacade.Create(Guid.NewGuid(), model.ProductId, model.Start, model.End); } catch (AuctionException e) { TempData["Error"] = e.Message; } } return RedirectToAction("Index", "Product"); }
public ActionResult Create(Guid productId) { var product = _productFacade.Get(productId); if (product != null) { var auction = new CreateAuctionViewModel() { ProductId = product.Id, ProductName = product.Name, Start = DateTime.Now, End = DateTime.Now.AddDays(1) }; return View(auction); } return RedirectToAction("Index", "Product"); }