public ActionResult CreateTicketPage(Ticket ticket, int ProjectId, int TypeId, int PropertyId) { if (ModelState.IsValid) { ticket.OwnerId = User.Identity.GetUserId(); ticket.ProjectId = ProjectId; ticket.TicketTypeId = TypeId; ticket.TicketStatus = db.Statuses.First(s => s.Name == "Unassigned"); ticket.TicketPropertyId = PropertyId; ticket.Created = DateTime.Now; TicketHelper.CreateTicket(db, ticket); ViewBag.ProjectId = new SelectList(db.Projects, "Id", "Title"); ViewBag.TypeId = new SelectList(db.Types, "Id", "Name"); ViewBag.PropertyId = new SelectList(db.Properties, "Id", "Name"); return(RedirectToAction("Index", "Manage")); } return(View(ticket)); }