public ActionResult Edit([Bind(Include = "Id,Title,Description,ProjectId,TicketTypeId,TicketPriorityId,TicketStatusId,AssignedToUserId,OwnerUserId,Created")] Ticket ticket)
 {
     if (ModelState.IsValid)
     {
         var oldTicket = db.Tickets.AsNoTracking().FirstOrDefault(t => t.Id == ticket.Id);
         db.Entry(ticket).State = EntityState.Modified;
         ticket.Updated         = DateTime.Now;
         NotifyHelper.ManageNotification(oldTicket, ticket);
         HistoryHelper.SaveHistory(oldTicket, ticket);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AssignedToUserId = new SelectList(db.Users, "Id", "FullName", ticket.AssignedToUserId);
     ViewBag.TicketTypeId     = new SelectList(db.TicketTypes, "Id", "Name", ticket.OwnerUserId);
     ViewBag.ProjectId        = new SelectList(db.Projects, "Id", "Name", ticket.ProjectId);
     ViewBag.TicketPriorityId = new SelectList(db.TicketPriorities, "Id", "Name", ticket.TicketPriorityId);
     ViewBag.TicketStatusId   = new SelectList(db.TicketStatus, "Id", "Name", ticket.TicketStatusId);
     return(View(ticket));
 }