public ActionResult CallQueueReport(CallQueueReportModelFilter filter = null, int pageNumber = 1) { int totalRecords; var model = _callQueueService.GetCallQueueReport(pageNumber, _pageSize, filter, out totalRecords); if (model == null) { model = new CallQueueReportListModel(); } model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.AssignedToOrgRoleUserId, filter.CallQueueId }); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }
public CallQueueReportListModel Create(IEnumerable <CallQueueAssignment> callQueueAssignments, IEnumerable <CallQueue> callQueues, IEnumerable <OrderedPair <long, string> > idNamePairs, IEnumerable <CallQueueCustomerStats> totalCustomerStats, IEnumerable <CallQueueCustomerStats> contactedCustomerStats) { var model = new CallQueueReportListModel(); var collection = new List <CallQueueReportModel>(); callQueueAssignments.ToList().ForEach(cqa => { var idNamePair = idNamePairs.Where(inp => inp.FirstValue == cqa.AssignedOrgRoleUserId).Select(inp => inp).Single(); var callQueue = callQueues.Where(cq => cq.Id == cqa.CallQueueId).Select(cq => cq).Single(); var totalCustomerStat = totalCustomerStats.Where(tcs => tcs.CallQueueId == cqa.CallQueueId && tcs.AssignedToOrgRoleUserId == cqa.AssignedOrgRoleUserId).Select(tcs => tcs).SingleOrDefault(); var contactedCustomerStat = contactedCustomerStats.Where(ccs => ccs.CallQueueId == cqa.CallQueueId && ccs.AssignedToOrgRoleUserId == cqa.AssignedOrgRoleUserId).Select(ccs => ccs).SingleOrDefault(); var callQueueReportModel = new CallQueueReportModel() { AgentName = idNamePair.SecondValue, QueueName = callQueue.Name, TotalCustomerAssigned = totalCustomerStat != null ? totalCustomerStat.Count : 0, TotalCustomerContacted = contactedCustomerStat != null ? contactedCustomerStat.Count : 0 }; collection.Add(callQueueReportModel); }); model.Collection = collection; return(model); }
public ActionResult CallQueueReportCompleted(string id, CallQueueReportListModel model) { if (id == null) { return(Content("Model can't be null.")); } if (model == null || model.Collection == null || model.Collection.Count() < 1) { return(Content("Model can't be null.")); } RemoveProcess(id); var exporter = ExportableDataGeneratorProcessManager <ViewModelBase, ModelFilterBase> .GetCsvExporter <CallQueueReportModel>(); var message = WriteCsv(string.Format("CallQueueReport_{0}.csv", id), exporter, model.Collection, RequestSubcriberChannelNames.CallQueueReportQueue, RequestSubcriberChannelNames.CallQueueReportChannel); return(Content(message)); }