public void PollForQueueReGeneration()
        {
            try
            {
                _logger.Info("Entering Health Plan Confirmation Queue Regeneration Polling Agent.");
                var callQueue   = _callQueueRepository.GetCallQueueByCategory(HealthPlanCallQueueCategory.AppointmentConfirmation);
                var criterias   = _healthPlanCallQueueCriteriaRepository.GetHealthPlanCallQueueCriteriaNotGenerated(callQueue.Id);
                var healthPlans = _corporateAccountRepository.GetAllHealthPlan();

                foreach (var criteria in criterias)
                {
                    try
                    {
                        _healthPlanCallQueueAssignmentRepository.DeleteByCriteriaId(criteria.Id);

                        if (criteria.HealthPlanId.HasValue)
                        {
                            var healthPlan = healthPlans.FirstOrDefault(x => x.Id == criteria.HealthPlanId);

                            if (healthPlan != null)
                            {
                                _healthPlanCallRoundService.SaveHealthPlanConfirmationCustomerCallQueue(healthPlan, criteria, callQueue, _logger);
                            }

                            criteria.IsQueueGenerated       = true;
                            criteria.LastQueueGeneratedDate = DateTime.Now;
                            _healthPlanCallQueueCriteriaRepository.Save(criteria);
                        }
                    }
                    catch (Exception ex)
                    {
                        _logger.Error(string.Format("Error regenerating confirmation queue for HealthPlanId: {0} CallQueueId: {1} CriteriaId : {2}", criteria.HealthPlanId, callQueue.Id, criteria.Id));
                        _logger.Error(string.Format("Message : {0} \nStack Trace : {1}", ex.Message, ex.StackTrace));
                    }
                }

                _logger.Info("Completed Health Plan Confirmation Queue Regeneration Polling Agent.");
            }
            catch (Exception ex)
            {
                _logger.Error(string.Format("Message {0} stack trace: {1} ", ex.Message, ex.StackTrace));
            }
        }
コード例 #2
0
 public IEnumerable <HealthPlanCallQueueCriteria> GetHealthPlanCallQueueCriteriaNotGenerated(long callQueueId)
 {
     return(_healthPlanCallQueueCriteriaRepository.GetHealthPlanCallQueueCriteriaNotGenerated(callQueueId));
 }