Exemplo n.º 1
0
        public bool UpdateCustomerDetailOnCallQueueResponse(CallQueueCustomerPubViewModel pub)
        {
            IDatabase   db  = RedisConnection.ConnectionMultiplexer.GetDatabase(_settings.RedisDatabaseKey);
            ISubscriber sub = RedisConnection.ConnectionMultiplexer.GetSubscriber();

            var serialisedObject = Newtonsoft.Json.JsonConvert.SerializeObject(pub);

            db.ListLeftPush(RequestSubcriberChannelNames.CallQueueCustomerUpdateCustomerFlagQueue, serialisedObject);
            try
            {
                sub.Publish(RequestSubcriberChannelNames.CallQueueCustomerUpdateCustomerFlagChannel, "");
            }
            catch (Exception ex)
            {
                var length = db.ListLength(RequestSubcriberChannelNames.CallQueueCustomerUpdateCustomerFlagQueue);
                if (length > 0)
                {
                    _logger.Error("Queue name:" + RequestSubcriberChannelNames.CallQueueCustomerUpdateCustomerFlagQueue + " and Length:" + length);
                    db.ListLeftPop(RequestSubcriberChannelNames.CallQueueCustomerUpdateCustomerFlagQueue);
                }

                _logger.Error("Exception occurred while publishing Update Customer Detail. Message: " + ex.Message);
                _logger.Error("Stack Trace: " + ex.StackTrace);
            }

            return(true);
        }
        public CallQueueCustomerPubViewModel GetCallQueueCustomerPubViewModel(Customer customer, Address address)
        {
            var callQueueCustomer = new CallQueueCustomerPubViewModel
            {
                CustomerId             = customer.CustomerId,
                FirstName              = customer.Name.FirstName,
                MiddleName             = customer.Name.MiddleName,
                LastName               = customer.Name.LastName,
                PhoneCell              = customer.MobilePhoneNumber != null ? customer.MobilePhoneNumber.AreaCode + customer.MobilePhoneNumber.Number : "",
                PhoneHome              = customer.HomePhoneNumber != null ? customer.HomePhoneNumber.AreaCode + customer.HomePhoneNumber.Number : "",
                PhoneOffice            = customer.OfficePhoneNumber != null ? customer.OfficePhoneNumber.AreaCode + customer.OfficePhoneNumber.Number : "",
                DoNotContactTypeId     = customer.DoNotContactTypeId,
                DoNotContactReasonId   = customer.DoNotContactReasonId,
                DoNotContactUpdateDate = customer.DoNotContactUpdateDate,
                ActivityId             = customer.ActivityId,
                //IsEligible = customer.IsEligible,                         //while updating Eligibility status , we are Updating it for CQC too
                IsIncorrectPhoneNumber = customer.IsIncorrectPhoneNumber,
                IsLanguageBarrier      = customer.IsLanguageBarrier,
                ZipCode = address.ZipCode.Zip,
                ZipId   = address.ZipCode.Id,
                Tag     = customer.Tag,
                DoNotContactUpdateSource       = customer.DoNotContactUpdateSource,
                IncorrectPhoneNumberMarkedDate = customer.IncorrectPhoneNumberMarkedDate,
                LanguageBarrierMarkedDate      = customer.LanguageBarrierMarkedDate,
                LanguageId = customer.LanguageId
            };

            return(callQueueCustomer);
        }
Exemplo n.º 3
0
 private void UpdateCallQueueCustomer(CallQueueCustomerPubViewModel customer)
 {
     _callQueueCustomerRepository.UpdateCustomerField(customer);
 }