Beispiel #1
0
        public ActionResult AllTickets([DataSourceRequest] DataSourceRequest request)
        {
            var allTickets = this.Data.Tickets.All().Select(TicketListViewModel.FromTicket);
            var listOfAllTickets = new List<TicketListReturnViewModel>();

            foreach (var ticket in allTickets)
            {
                var curentTicket = new TicketListReturnViewModel()
                {
                    Id = ticket.Id,
                    Title = ticket.Title,
                    Author = ticket.Author,
                    Category = ticket.Category,
                    Priority = Enum.GetName(typeof(Priority), ticket.Priority)
                };

                listOfAllTickets.Add(curentTicket);
            }

            return Json(listOfAllTickets.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
Beispiel #2
0
        public ActionResult TicketsList()
        {
            var allTickets = this.Data.Tickets.All().Select(TicketListViewModel.FromTicket);
            var listOfAllTickets = new List<TicketListReturnViewModel>();

            foreach (var ticket in allTickets)
            {
                var curentTicket = new TicketListReturnViewModel()
                {
                    Id = ticket.Id,
                    Title = ticket.Title,
                    Author = ticket.Author,
                    Category = ticket.Category,
                    Priority = Enum.GetName(typeof(Priority), ticket.Priority)
                };

                listOfAllTickets.Add(curentTicket);
            }

            return View(listOfAllTickets);
        }