Beispiel #1
0
        // GET: Tickets
        public ActionResult Index()
        {
            ViewBag.MySolutions = _context.Tickets.Where(t => t.employeeNumber.Equals(User.Identity.Name) &&
                                                         t.solution != null && t.ticketstatus == false)
                                  .ToList().Count();
            ViewBag.KnowledgeBase = _context.Tickets.Where(x => x.solution != null && x.ticketstatus == false).ToList().Count();
            HelpDeskLogic hdl = new HelpDeskLogic();
            TicketReportPerParticipant        tr            = hdl.getAllTickets();
            TicketReportPerParticipant        AdminTickets  = hdl.GetParticipantReport(User.Identity.Name);
            List <TicketReportPerParticipant> TicketsFilter = new List <TicketReportPerParticipant>();

            TicketsFilter.Add(tr);
            TicketsFilter.Add(AdminTickets);
            ViewBag.OverDueTickets = hdl.GetOverDueTickets().Count.ToString();
            ViewBag.ControllerName = "HelpDesk";
            ViewData["Role"]       = User.IsInRole("Administrator");
            return(View(TicketsFilter));
        }
        //
        // GET: /Dashboard/
        public ActionResult Dashboard()
        {
            int s = 0;

            ViewBag.getAssets   = list.Assets().Count;
            ViewBag.getEmployee = list.Employees().Count;
            HelpDeskLogic hdl = new HelpDeskLogic();

            ViewBag.AllTickets = hdl.getAllTickets();

            ViewBag.TicketParticipant = hdl.GetParticipantReport(User.Identity.Name);
            foreach (Stock st in context.Stocks.ToList())
            {
                s += st.quantity;
            }
            ViewBag.getStock = s;
            var ticketsPerDevice = new TicketsByDevicesReport();

            ticketsPerDevice.AssignTickets();
            return(View(ticketsPerDevice));;
        }