public ListModelBase <GmsExcludedCustomerViewModel, OutboundCallQueueFilter> GetExcludedCustomers(int pageNumber, int pageSize, ModelFilterBase filter, out int totalRecords) { var outboundCallQueueFilter = filter as OutboundCallQueueFilter ?? new OutboundCallQueueFilter(); var organization = _organizationRepository.GetOrganizationbyId(outboundCallQueueFilter.HealthPlanId); CallQueue callQueue = null; var criteria = _healthPlanCallQueueCriteriaRepository.GetById(outboundCallQueueFilter.CriteriaId); callQueue = _callQueueRepository.GetById(outboundCallQueueFilter.CallQueueId > 0 ? outboundCallQueueFilter.CallQueueId : criteria.CallQueueId); outboundCallQueueFilter.CallQueueId = callQueue.Id; _healthPlanOutboundCallQueueService.GetAccountCallQueueSettingForCallQueue(outboundCallQueueFilter); var excludedCustomers = _gmsExcludedCustomerRepository.GetExcludedCallQueueCustomers(pageNumber, pageSize, outboundCallQueueFilter, callQueue, outboundCallQueueFilter.SuppressionType, out totalRecords); var model = new ExcludedCustomerListModel { Filter = outboundCallQueueFilter }; var customerIds = excludedCustomers.Where(x => x.CustomerId.HasValue).Select(x => x.CustomerId.Value).ToArray(); if (!customerIds.IsNullOrEmpty()) { var customers = _customerRepository.GetCustomers(customerIds); var customTags = _corporateCustomerCustomTagRepository.GetByCustomerIds(customerIds); model.Collection = Create(excludedCustomers, customers, customTags, organization); return(model); } model.Collection = Create(excludedCustomers, null, null, organization); return(model); }
public ActionResult ExcludedCustomersCompleted(string id, ExcludedCustomerListModel model) { if (id == null) { return(Content("Model can't be null.")); } if (model == null || model.Collection == null || !model.Collection.Any()) { return(Content("Model can't be null.")); } RemoveProcess(id); var exporter = ExportableDataGeneratorProcessManager <ViewModelBase, ModelFilterBase> .GetCsvExporter <GmsExcludedCustomerViewModel>(); var message = WriteCsv(string.Format("ExcludedCustomerReport{0}.csv", Guid.NewGuid()), exporter, model.Collection, RequestSubcriberChannelNames.ExcludedCustomerReportQueue, RequestSubcriberChannelNames.ExcludedCustomerReportChannel); return(Content(message)); }
public ActionResult ExcludedCustomers(OutboundCallQueueFilter filter = null, int pageNumber = 1) { int totalRecords; filter = filter ?? new OutboundCallQueueFilter(); var model = _gmsExcludedCustomerService.GetExcludedCustomers(pageNumber, _pageSize, filter, out totalRecords); var currentAction = ControllerContext.RouteData.Values["action"].ToString(); var routeValueDictionary = GetRouteValueDictionaryForCallQueueCustomerReportModel(filter); Func <int, string> urlFunc = pn => Url.Action(currentAction, AddRouteValueDictionary(routeValueDictionary, pn)); var excludedCustomerListModel = new ExcludedCustomerListModel { Collection = model.Collection, Filter = model.Filter, PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc) }; excludedCustomerListModel = _gmsExcludedCustomerService.SetHeaderData(filter, excludedCustomerListModel); return(View(excludedCustomerListModel)); }
public ExcludedCustomerListModel SetHeaderData(OutboundCallQueueFilter filter, ExcludedCustomerListModel model) { var organization = _organizationRepository.GetOrganizationbyId(filter.HealthPlanId); CallQueue callQueue = null; var criteria = _healthPlanCallQueueCriteriaRepository.GetById(filter.CriteriaId); callQueue = _callQueueRepository.GetById(filter.CallQueueId > 0 ? filter.CallQueueId : criteria.CallQueueId); var criteriaName = string.Empty; if (filter.CampaignId.HasValue && filter.CampaignId.Value > 0) { var campagin = _campaignRepository.GetById(filter.CampaignId.Value); criteriaName = campagin.Name; } model.CallQueueType = callQueue.Name; model.HealthPlanName = organization.Name; model.SuppressionType = filter.SuppressionType.GetDescription(); model.CriteriaName = string.IsNullOrEmpty(criteria.CriteriaName) ? criteriaName : criteria.CriteriaName; return(model); }