public virtual ActionResult Edit(TicketViewModel model) { if (ModelState.IsValid) { _ticketHandler.Update(model.CreateTicketDomain()); _ticketHandler.Commit(); return(RedirectToAction("Index")); } return(View(model)); }
public virtual ActionResult Create([Bind(Include = "Title, Description, ProductId")] TicketViewModel model) { if (ModelState.IsValid) { model.OwnerId = _currentUser.GetUserId(); _ticketHandler.Add(model.CreateTicketDomain()); _ticketHandler.Commit(); return(RedirectToAction("Index")); } model.AllProducts = _productHandler.GetAll().Select(ProductViewModelFactory.Create); return(View(model)); }