public ActionResult TicketAssign(string id)
        {
            ViewBag.UserId = id;
            var occupiedTickets = ticketHelper.ListUserTickets(id).Select(p => p.Id);
            var currentProjTix  = ticketHelper.GetMyProjectTickets(id);

            ViewBag.AllTickets = new MultiSelectList(currentProjTix, "Id", "Title", occupiedTickets);
            return(View());
        }
        // GET: Admin
        public ActionResult TicketAssign(string id)
        {
            TicketsHelper ticketHelper = new TicketsHelper();
            //Get a list of tickets i am already assigned to
            var myTicketIds = ticketHelper.ListUserTickets(id).Select(t => t.Id);

            ViewBag.UserId     = id;
            ViewBag.AllTickets = new MultiSelectList(db.Tickets, "Id", "Title", myTicketIds);
            return(View());
        }
        public ActionResult DevSubTicketComments()
        {
            var ticketComments = new List <TicketComment>(); //empty list of ticket attachments
            var tickets        = ticketHelper.ListUserTickets(User.Identity.GetUserId());

            foreach (var ticket in tickets)                    //loop through tickets user is assigned to
            {
                foreach (var comment in ticket.TicketComments) //loop through attachment of those tickets
                {
                    ticketComments.Add(comment);               //add to empty attachment list
                }
            }
            return(View("Index", ticketComments));
        }
        public ActionResult TicketAssign(string UserId, List <int> AllTickets)
        {
            TicketsHelper ticketHelper = new TicketsHelper();

            //First use the Project helper to remove this user from all Tickets
            foreach (var ticket in ticketHelper.ListUserTickets(UserId))
            {
                ticketHelper.RemoveUserFromTicket(UserId, ticket.Id);
            }
            //Next add the user to the selected Projects (AllTickets)
            if (AllTickets != null)
            {
                foreach (var ticketId in AllTickets)
                {
                    ticketHelper.AddUserToTicket(UserId, ticketId);
                }
            }
            return(RedirectToAction("UserIndex", "AdminUser"));
        }
 public ActionResult MyTickets()
 {
     return(View("Index", tixHelper.ListUserTickets(User.Identity.GetUserId()).ToList()));
 }
Esempio n. 6
0
        public ActionResult MyTickets()
        {
            var userId = User.Identity.GetUserId();

            return(View(ticketHelper.ListUserTickets(userId)));
        }
 public ActionResult MyIndex() //Shows all tickets by user
 {
     return(View("Index", ticketHelper.ListUserTickets(User.Identity.GetUserId())));
 }