public AssignedToReportResult AssignedToReport(AssignedToReportParams Params)
        {
            var searchCriteria = new TicketSearchParams
            {
                Assignment = new Assignment
                {
                    Employee = Params.AssignedTo
                },
                ExcludeTicketStatusList = new List <string>
                {
                    TicketStatus.Closed.ToString().PascalCaseToDescription(),
                TicketStatus.ClosedDuplicate.ToString().PascalCaseToDescription(),
                TicketStatus.ClosedTooLate.ToString().PascalCaseToDescription(),
                },
                IsForwardOrder = true
            };
            var items = searchCriteria.Search(requestState).ToAssignedToReport();

            foreach (var item in items)
            {
                item.Reasons = CleanReasons(item.Reasons);
            }
            return(new AssignedToReportResult
            {
                OpenTicketCount = items.Count(),
                Report = new AssignedToReport
                {
                    Items = items
                }
            });
        }
Exemple #2
0
        public AssignedToReportModel(ServicesProxy servicesProxy, User defaultEmployee = null)
        {
            Header           = new AssignedToReportTableItem();
            PostReportParams = new AssignedToReportParams();
            usersResult      = servicesProxy.UserService.GetUsers();

            if (servicesProxy.RequestState != null && servicesProxy.RequestState.UserDetails != null)
            {
                SelectedEmployee = defaultEmployee ?? usersResult.GetUser(servicesProxy.RequestState.UserDetails.Id);
            }

            if (SelectedEmployee == null)
            {
                SelectedEmployee = new User();
            }

            ReportParams = new AssignedToReportParams
            {
                AssignedTo = SelectedEmployee
            };

            Result = servicesProxy.ReportService.AssignedToReport(ReportParams);
        }
Exemple #3
0
        public AssignedToReportResult AssignedToReport(AssignedToReportParams Params)
        {
            UserResult userResult = null;

            if (Params != null && Params.AssignedTo != null && (Params.AssignedTo.Id == null || Params.AssignedTo.Username == null))
            {
                userResult = servicesProxy.UserService.GetUser(Params.AssignedTo.Id);
                if (!userResult.OK)
                {
                    userResult = servicesProxy.UserService.GetUser(Params.AssignedTo.Username);
                }
                if (userResult.OK)
                {
                    Params.AssignedTo = userResult.User;
                }
            }
            var reportResult = reportRepository.AssignedToReport(Params);

            if (userResult != null)
            {
                reportResult.MergeResults(userResult);
            }
            return(reportResult);
        }
 public JsonResult AssignedTo(AssignedToReportParams ReportParams)
 {
     return(Json(ServicesProxy.ReportService.AssignedToReport(ReportParams), JsonRequestBehavior.AllowGet));
 }