public ActionResult Edit([Bind(Include = "Id,Comment,Created,TicketId,UserId")] TicketComment ticketComment)
        {
            if (ModelState.IsValid)
            {
                TicketCommentHelper.Edit(ticketComment.Id, ticketComment.Comment);
                db.SaveChanges();
                return(RedirectToAction("Index", new { ticketId = ticketComment.TicketId }));
            }

            return(View(ticketComment));
        }
        public ActionResult Create([Bind(Include = "Id,Comment,Created,TicketId,UserId")] TicketComment ticketComment)
        {
            if (ModelState.IsValid)
            {
                TicketCommentHelper.Create(ticketComment.Comment, ticketComment.TicketId, User.Identity.GetUserId());
                return(RedirectToAction("Index", "Tickets", new { userId = User.Identity.GetUserId() }));
            }

            ViewBag.TicketId = new SelectList(TicketHelper.GetTickets(), "Id", "Title", ticketComment.TicketId);
            return(View(ticketComment));
        }
        // GET: TicketComments/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketComment ticketComment = TicketCommentHelper.GetTicketComment(id);

            if (ticketComment == null)
            {
                return(HttpNotFound());
            }
            return(View(ticketComment));
        }
        // GET: TicketComments
        public ActionResult Index(int?ticketId)
        {
            var ticketComments = TicketCommentHelper.GetTicketCommentsByTicket(ticketId);

            return(View(ticketComments.ToList()));
        }
 public ActionResult DeleteConfirmed(int id, int?ticketId)
 {
     TicketCommentHelper.Delete(id);
     return(RedirectToAction("Index", new { ticketId }));
 }