Example #1
0
 public ServeService(IContactService contactService,
                     IContactRelationshipService contactRelationshipService,
                     IOpportunityService opportunityService,
                     MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                     IParticipantService participantService,
                     IGroupParticipantService groupParticipantService,
                     IGroupService groupService,
                     ICommunicationService communicationService,
                     IAuthenticationService authenticationService,
                     IConfigurationWrapper configurationWrapper,
                     IApiUserService apiUserService,
                     IResponseService responseService)
 {
     _contactService = contactService;
     _contactRelationshipService = contactRelationshipService;
     _opportunityService = opportunityService;
     _eventService = eventService;
     _participantService = participantService;
     _groupParticipantService = groupParticipantService;
     _groupService = groupService;
     _communicationService = communicationService;
     _authenticationService = authenticationService;
     _configurationWrapper = configurationWrapper;
     _apiUserService = apiUserService;
     _responseService = responseService;
 }
Example #2
0
 public TripService(IEventParticipantService eventParticipant,
                    IDonationService donationService,
                    IGroupService groupService,
                    IFormSubmissionService formSubmissionService,
                    MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                    IDonorService donorService,
                    IPledgeService pledgeService,
                    ICampaignService campaignService,
                    IPrivateInviteService privateInviteService,
                    ICommunicationService communicationService,
                    IContactService contactService,
                    IContactRelationshipService contactRelationshipService,
                    IConfigurationWrapper configurationWrapper,
                    IPersonService personService,
                    IServeService serveService,
                    IDestinationService destinationService)
 {
     _eventParticipantService = eventParticipant;
     _donationService = donationService;
     _groupService = groupService;
     _formSubmissionService = formSubmissionService;
     _mpEventService = eventService;
     _mpDonorService = donorService;
     _mpPledgeService = pledgeService;
     _campaignService = campaignService;
     _privateInviteService = privateInviteService;
     _communicationService = communicationService;
     _contactService = contactService;
     _contactRelationshipService = contactRelationshipService;
     _configurationWrapper = configurationWrapper;
     _personService = personService;
     _serveService = serveService;
     _destinationService = destinationService;
 }
Example #3
0
        public void ConnectToRabbitMQ(string customResponseTopic)
        {
            
            IDictionary<String, String> customProps = new Dictionary<string, string>();
            customProps.Add("VirtualHost", "TestEnv");
            customProps.Add("UserName", "finsharp");
            customProps.Add("Password", "streamcipher");
            
            var config2 = new DefaultCommunicationServiceConfig.Builder()
                {
                    SetDefaultExceptionHandler = (ex) => Logger.Error(this, "Messaging error", ex),
                    SetFormatter = new Utf8Formatter(),
                    SetServiceBusAddress = "localhost",
                    SetTotalSenderChannels = 3,
                    SetTotalReceiverChannels = 1,
                    SetConnectionIdPrefix = _peerName,
                    SetUniqueResponseTopic = customResponseTopic + "." +_peerName,
                    ImportCustomProps = customProps
                }.Build();

            CommSvc2 = new DefaultCommunicationService(config2,
                                                            new PoolableRabbitSenderChannelFactory(config2),
                                                            new PoolableRabbitReceiverChannelFactory(config2));
            CommSvc2.Start();
        }
Example #4
0
 public AccountService(IConfigurationWrapper configurationWrapper, ICommunicationService communicationService, IAuthenticationService authenticationService, ISubscriptionsService subscriptionService)
 {
     this._configurationWrapper = configurationWrapper;
     this._communicationService = communicationService;
     this._authenticationService = authenticationService;
     this._subscriptionsService = subscriptionService;
 }
Example #5
0
        public DonorService(IMinistryPlatformService ministryPlatformService, IProgramService programService, ICommunicationService communicationService, IAuthenticationService authenticationService, IContactService contactService,  IConfigurationWrapper configuration, ICryptoProvider crypto)
            : base(authenticationService, configuration)
        {
            _ministryPlatformService = ministryPlatformService;
            _programService = programService;
            _communicationService = communicationService;
            _contactService = contactService;
            _crypto = crypto;

            _donorPageId = configuration.GetConfigIntValue("Donors");
            _donationPageId = configuration.GetConfigIntValue("Donations");
            _donationDistributionPageId = configuration.GetConfigIntValue("Distributions");
            _donorAccountsPageId = configuration.GetConfigIntValue("DonorAccounts");
            _findDonorByAccountPageViewId = configuration.GetConfigIntValue("FindDonorByAccountPageView");
            _donationStatusesPageId = configuration.GetConfigIntValue("DonationStatus");
            _donorLookupByEncryptedAccount = configuration.GetConfigIntValue("DonorLookupByEncryptedAccount");
            _myHouseholdDonationDistributions = configuration.GetConfigIntValue("MyHouseholdDonationDistributions");
            _recurringGiftBySubscription = configuration.GetConfigIntValue("RecurringGiftBySubscription");
            _recurringGiftPageId = configuration.GetConfigIntValue("RecurringGifts");
            _myDonorPageId = configuration.GetConfigIntValue("MyDonor");
            _myHouseholdDonationRecurringGifts = configuration.GetConfigIntValue("MyHouseholdDonationRecurringGifts");
            _myHouseholdRecurringGiftsApiPageView = configuration.GetConfigIntValue("MyHouseholdRecurringGiftsApiPageView");
            _myHouseholdPledges = configuration.GetConfigIntValue("MyHouseholdPledges");

            _dateTimeFormat = new DateTimeFormatInfo
            {
                AMDesignator = "am",
                PMDesignator = "pm"
            };

        }
Example #6
0
 public UserController(IUserService userService, ICommunicationService communicationService, ILoggerService loggerService)
 {
     this.userService = userService;
     this.communicationService = communicationService;
     this.loggerService = loggerService;
     _repo = new AuthRepository();
 }
Example #7
0
 public GroupService(IMinistryPlatformService ministryPlatformService, IConfigurationWrapper configurationWrapper, IAuthenticationService authenticationService, ICommunicationService communicationService, IContactService contactService, IContentBlockService contentBlockService)
     : base(authenticationService, configurationWrapper)
 {
     this.ministryPlatformService = ministryPlatformService;
     this._configurationWrapper = configurationWrapper;
     this._communicationService = communicationService;
     this._contactService = contactService;
     this._contentBlockService = contentBlockService;
 }
        public ListPageViewModel(ICommunicationService communicationService,
            IMessageBoxService messageBoxService)
        {
            this.communicationService = communicationService;
            this.messageBoxService = messageBoxService;

            this.AppearingCommand = new DelegateCommand(async () => await this.AppearingAsync());

            this.ItemSelectedCommand = new DelegateCommand<SelectedItemChangedEventArgs>((evt) => this.ItemSelected(evt));
        }
 public EmailCommunication(ICommunicationService communicationService, 
     IPersonService personService, 
     IContactService contactService,
     IConfigurationWrapper configurationWrapper)
 {
     _communicationService = communicationService;
     _personService = personService;
     _contactService = contactService;
     _configurationWrapper = configurationWrapper;
     DefaultContactEmailId = _configurationWrapper.GetConfigIntValue("DefaultContactEmailId");
 }
        private ApprovalActionDefinition(Builder builder)
            : base(builder)
        {
#if !SILVERLIGHT
            _dynamicTypeManager = builder.DynamicTypeManager;
            _communicationService = builder.CommunicationService;
            _personManager = builder.PersonManager;
#endif

            _approvalFieldName = builder.ApprovalFieldName;
#if !SILVERLIGHT
            _rules = new ReadOnlyCollection<IActionRule>(builder.Rule != null ? new[] { builder.Rule } : new IActionRule[0]);
            _dataContext = builder.DataContext;
#endif
        }
Example #11
0
 // private DivineBotDialog divineDialog;
  public MessageController(IDivineRepositories repositories,
      ICommunicationService msgService, IMemoryCache cache,
      IDivineLogger logger, IHttpContextAccessor _httpContextAccessor
     /* DivineBotDialog divineBotDialog*/)
      : base(repositories, logger, _httpContextAccessor)
  {
      this.msgRepo = repositories.MessageRepo;
      this.msgService = msgService;
      this.membersRepo = repositories.MemberRepo;
      this.lookupRepo = repositories.LookupRepo;
      this.cache = cache;
      this.attendanceRepo = repositories.AttendanceRepo;
      //this.divineDialog = divineBotDialog;
      this.repositories = repositories;
  }
        private AssignmentActionDefinition(Builder builder)
            : base(builder)
        {
#if !SILVERLIGHT
            _dynamicTypeManager = builder.DynamicTypeManager;
            _personManager = builder.PersonManager;
            _communicationService = builder.CommunicationService;
#endif

            _dueDateFieldName = builder.DueDateFieldName;
            _isNotification = builder.IsNotification;

#if !SILVERLIGHT
            _dataContext = builder.DataContext;
            _rules = new ReadOnlyCollection<IActionRule>(builder.Rules.ToArray());
#endif
        }
Example #13
0
 public DonationService(IMinistryPlatformService ministryPlatformService, IDonorService donorService, ICommunicationService communicationService, IPledgeService pledgeService, IConfigurationWrapper configuration, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService = ministryPlatformService;
     _donorService = donorService;
     _communicationService = communicationService;
     _pledgeService = pledgeService;
     _donationsPageId = configuration.GetConfigIntValue("Donations");
     _donationDistributionPageId = configuration.GetConfigIntValue("Distributions");
     _donorMessageTemplateId = configuration.GetConfigIntValue("DonorMessageTemplateId");
     _distributionPageId = configuration.GetConfigIntValue("Distributions");
     _batchesPageId = configuration.GetConfigIntValue("Batches");
     _depositsPageId = configuration.GetConfigIntValue("Deposits");
     _paymentProcessorErrorsPageId = configuration.GetConfigIntValue("PaymentProcessorEventErrors");
     _tripDistributionsPageView = configuration.GetConfigIntValue("TripDistributionsView");
     _gpExportPageView = configuration.GetConfigIntValue("GPExportView");
     _processingProgramId = configuration.GetConfigIntValue("ProcessingProgramId");
     _scholarshipPaymentTypeId = configuration.GetConfigIntValue("ScholarshipPaymentTypeId");
     _tripDonationMessageTemplateId = configuration.GetConfigIntValue("TripDonationMessageTemplateId");
 }
Example #14
0
 public EventService(TranslationEventService eventService,
                     IGroupService groupService,
                     ICommunicationService communicationService,
                     IContactService contactService,
                     IContentBlockService contentBlockService,
                     IConfigurationWrapper configurationWrapper,
                     IApiUserService apiUserService,
                     IContactRelationshipService contactRelationshipService,
                     IGroupParticipantService groupParticipantService, IParticipantService participantService)
 {
     _eventService = eventService;
     _groupService = groupService;
     _communicationService = communicationService;
     _contactService = contactService;
     _contentBlockService = contentBlockService;
     _configurationWrapper = configurationWrapper;
     _apiUserService = apiUserService;
     _contactRelationshipService = contactRelationshipService;
     _groupParticipantService = groupParticipantService;
     _participantService = participantService;
 }
 public ChildcareService(IEventParticipantService eventParticipantService,
                         ICommunicationService communicationService,
                         IConfigurationWrapper configurationWrapper,
                         IContactService contactService,
                         MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                         IParticipantService participantService,
                         IServeService serveService,
                         IDateTime dateTimeWrapper,
                         IApiUserService apiUserService, Interfaces.IEventService crdsEventService)
 {
     _eventParticipantService = eventParticipantService;
     _communicationService = communicationService;
     _configurationWrapper = configurationWrapper;
     _contactService = contactService;
     _crdsEventService = crdsEventService;
     _eventService = eventService;
     _participantService = participantService;
     _serveService = serveService;
     _dateTimeWrapper = dateTimeWrapper;
     _apiUserService = apiUserService;
 }
        public CheckScannerController(IConfigurationWrapper configuration,
                                      ICheckScannerService checkScannerService,
                                      IAuthenticationService authenticationService,
                                      ICommunicationService communicationService,
                                      ICryptoProvider cryptoProvider,
                                      IMessageQueueFactory messageQueueFactory = null,
                                      IMessageFactory messageFactory = null)
        {
            _checkScannerService = checkScannerService;
            _authenticationService = authenticationService;
            _communicationService = communicationService;
            _cryptoProvider = cryptoProvider;

            var b = configuration.GetConfigValue("CheckScannerDonationsAsynchronousProcessingMode");
            _asynchronous = b != null && bool.Parse(b);
            if (_asynchronous)
            {
                var donationsQueueName = configuration.GetConfigValue("CheckScannerDonationsQueueName");
                // ReSharper disable once PossibleNullReferenceException
                _donationsQueue = messageQueueFactory.CreateQueue(donationsQueueName, QueueAccessMode.Send);
                _messageFactory = messageFactory;
            }
        }
Example #17
0
        /// <summary>
        /// Async component for informing client of which neighbors exist
        /// </summary>
        /// <remarks>
        /// This needs to run asynchronously, as a network timeout may block the thread for a long while
        /// </remarks>
        /// <param name="remoteClient"></param>
        /// <param name="a"></param>
        /// <param name="regionHandle"></param>
        /// <param name="endPoint"></param>
        private bool InformClientOfNeighbor(UUID AgentID, ulong requestingRegion, AgentCircuitData circuitData, GridRegion neighbor,
                                            uint TeleportFlags, AgentData agentData, out string reason)
        {
            if (neighbor == null)
            {
                reason = "Could not find neighbor to inform";
                return(false);
            }
            m_log.Info("[AgentProcessing]: Starting to inform client about neighbor " + neighbor.RegionName);

            //Notes on this method
            // 1) the SimulationService.CreateAgent MUST have a fixed CapsUrl for the region, so we have to create (if needed)
            //       a new Caps handler for it.
            // 2) Then we can call the methods (EnableSimulator and EstatablishAgentComm) to tell the client the new Urls
            // 3) This allows us to make the Caps on the grid server without telling any other regions about what the
            //       Urls are.

            ISimulationService SimulationService = m_registry.RequestModuleInterface <ISimulationService>();

            if (SimulationService != null)
            {
                ICapsService       capsService = m_registry.RequestModuleInterface <ICapsService>();
                IClientCapsService clientCaps  = capsService.GetClientCapsService(AgentID);

                IRegionClientCapsService oldRegionService = clientCaps.GetCapsService(neighbor.RegionHandle);

                //If its disabled, it should be removed, so kill it!
                if (oldRegionService != null && oldRegionService.Disabled)
                {
                    clientCaps.RemoveCAPS(neighbor.RegionHandle);
                    oldRegionService = null;
                }

                bool newAgent = oldRegionService == null;
                IRegionClientCapsService otherRegionService = clientCaps.GetOrCreateCapsService(neighbor.RegionHandle,
                                                                                                CapsUtil.GetCapsSeedPath(CapsUtil.GetRandomCapsObjectPath()), circuitData);

                if (!newAgent)
                {
                    //Note: if the agent is already there, send an agent update then
                    bool result = true;
                    if (agentData != null)
                    {
                        result = SimulationService.UpdateAgent(neighbor, agentData);
                        if (result)
                        {
                            oldRegionService.Disabled = false;
                        }
                    }
                    reason = "";
                    return(result);
                }

                ICommunicationService commsService = m_registry.RequestModuleInterface <ICommunicationService>();
                if (commsService != null)
                {
                    circuitData.OtherInformation["UserUrls"] = commsService.GetUrlsForUser(neighbor, circuitData.AgentID);
                }

                bool regionAccepted = SimulationService.CreateAgent(neighbor, circuitData,
                                                                    TeleportFlags, agentData, out reason);
                if (regionAccepted)
                {
                    //If the region accepted us, we should get a CAPS url back as the reason, if not, its not updated or not an Aurora region, so don't touch it.
                    if (reason != "")
                    {
                        OSDMap responseMap = (OSDMap)OSDParser.DeserializeJson(reason);
                        OSDMap SimSeedCaps = (OSDMap)responseMap["CapsUrls"];
                        otherRegionService.AddCAPS(SimSeedCaps);
                    }

                    IEventQueueService EQService = m_registry.RequestModuleInterface <IEventQueueService>();

                    EQService.EnableSimulator(neighbor.RegionHandle,
                                              neighbor.ExternalEndPoint.Address.GetAddressBytes(),
                                              neighbor.ExternalEndPoint.Port, AgentID,
                                              neighbor.RegionSizeX, neighbor.RegionSizeY, requestingRegion);

                    // EnableSimulator makes the client send a UseCircuitCode message to the destination,
                    // which triggers a bunch of things there.
                    // So let's wait
                    Thread.Sleep(300);
                    EQService.EstablishAgentCommunication(AgentID, neighbor.RegionHandle,
                                                          neighbor.ExternalEndPoint.Address.GetAddressBytes(),
                                                          neighbor.ExternalEndPoint.Port, otherRegionService.CapsUrl, neighbor.RegionSizeX,
                                                          neighbor.RegionSizeY,
                                                          requestingRegion);

                    m_log.Info("[AgentProcessing]: Completed inform client about neighbor " + neighbor.RegionName);
                }
                else
                {
                    m_log.Error("[AgentProcessing]: Failed to inform client about neighbor " + neighbor.RegionName + ", reason: " + reason);
                    return(false);
                }
                return(true);
            }
            reason = "SimulationService does not exist";
            m_log.Error("[AgentProcessing]: Failed to inform client about neighbor " + neighbor.RegionName + ", reason: " + reason + "!");
            return(false);
        }
Example #18
0
 public TimedDailyDigest(ICommunicationService commmunicationService)
 {
     _commmunicationService = commmunicationService;
 }
 public CommunicationFeature(ICommunicationService communicationService)
 {
     _communicationService = communicationService;
 }
Example #20
0
 public AutomationEngine(ICachingService cachingService, IIndexingService indexingService,
                         IAdvancedSearchService advancedSearchService, IContactService contactService, IWorkflowService workflowService,
                         IAccountService accountService, ITagService tagService, ICampaignService campaignService, ILeadScoreService leadScoreService,
                         IPublishSubscribeService pubSubService, IOpportunitiesService opportunityService, ICommunicationService communicationService)
 {
     this.cachingService        = cachingService;
     this.indexingService       = indexingService;
     this.advancedSearchService = advancedSearchService;
     this.contactService        = contactService;
     this.workflowService       = workflowService;
     this.accountService        = accountService;
     this.tagService            = tagService;
     this.campaignService       = campaignService;
     this.leadScoreService      = leadScoreService;
     this.pubSubService         = pubSubService;
     this.communicationService  = communicationService;
     this.opportunityService    = opportunityService;
 }
Example #21
0
 public DeleteUserHandler(IRepository repository, IAuthService authService, ICommunicationService communicationService)
 {
     _repository           = repository;
     _authService          = authService;
     _communicationService = communicationService;
 }
Example #22
0
 public ContactController(ICommunicationService communicationService)
 {
     _communicationService = communicationService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommunicationController"/> class.
 /// </summary>
 /// <param name="communicationService">The injected communication service.</param>
 public CommunicationController(ICommunicationService communicationService)
 {
     this.communicationService = communicationService;
 }
Example #24
0
 public ResendActivationCodeStrategy(IConfigurationService configurationService, ICommunicationService communicationService,
                                     ICandidateReadRepository candidateReadRepository, ICodeGenerator codeGenerator,
                                     IUserReadRepository userReadRepository, IUserWriteRepository userWriteRepository)
 {
     _communicationService     = communicationService;
     _candidateReadRepository  = candidateReadRepository;
     _codeGenerator            = codeGenerator;
     _userReadRepository       = userReadRepository;
     _userWriteRepository      = userWriteRepository;
     _activationCodeExpiryDays = configurationService.Get <UserAccountConfiguration>().ActivationCodeExpiryDays;
 }
Example #25
0
 public ServicesModel(ICommunicationService serv)
 {
     _communicationService = serv;
 }
 public PutGroupMemberCredentialsHandler(IRepository repository, ICommunicationService communicationService)
 {
     _repository           = repository;
     _communicationService = communicationService;
 }
Example #27
0
 public ScheduleController(IConfiguration config, IScheduleService scheduleService, IAddDateService addDateService, IAddMedicineService addMedicineService, ICommunicationService communicationService, IValiDateService valiDateService)
 {
     _config               = config;
     _scheduleService      = scheduleService;
     _communicationService = communicationService;
     _addDateService       = addDateService;
     _addMedicineService   = addMedicineService;
     _valiDateService      = valiDateService;
 }
Example #28
0
        public static void ProcessCallQueueItem(CallQueueItem cqi)
        {
            try
            {
                if (cqi != null && cqi.Call != null && cqi.Call.HasAnyDispatches())
                {
                    if (_communicationService == null)
                    {
                        _communicationService = Bootstrapper.GetKernel().Resolve <ICommunicationService>();
                    }

                    if (_callsService == null)
                    {
                        _callsService = Bootstrapper.GetKernel().Resolve <ICallsService>();
                    }

                    List <int> groupIds = new List <int>();

                    /* Trying to see if I can eek out a little perf here now that profiles are in Redis. Previously the
                     * the parallel operation would cause EF errors. This shouldn't be the case now because profiles are
                     * cached and GetProfileForUser operations will hit that first.
                     */
                    if (cqi.Profiles == null || !cqi.Profiles.Any())
                    {
                        if (_userProfilesService == null)
                        {
                            _userProfilesService = Bootstrapper.GetKernel().Resolve <IUserProfileService>();
                        }

                        cqi.Profiles = _userProfilesService.GetAllProfilesForDepartment(cqi.Call.DepartmentId).Select(x => x.Value).ToList();
                    }

                    if (cqi.CallDispatchAttachmentId > 0)
                    {
                        //var callsService = Bootstrapper.GetKernel().Resolve<ICallsService>();
                        cqi.Call.ShortenedAudioUrl = _callsService.GetShortenedAudioUrl(cqi.Call.CallId, cqi.CallDispatchAttachmentId);
                    }

                    cqi.Call.ShortenedCallUrl = _callsService.GetShortenedCallLinkUrl(cqi.Call.CallId);

                    try
                    {
                        cqi.Call.CallPriority = _callsService.GetCallPrioritesById(cqi.Call.DepartmentId, cqi.Call.Priority, false);
                    }
                    catch { /* Doesn't matter */ }

                    var dispatchedUsers = new HashSet <string>();

                    // Dispatch Personnel
                    if (cqi.Call.Dispatches != null && cqi.Call.Dispatches.Any())
                    {
                        Parallel.ForEach(cqi.Call.Dispatches, d =>
                        {
                            dispatchedUsers.Add(d.UserId);

                            try
                            {
                                var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == d.UserId);

                                if (profile != null)
                                {
                                    _communicationService.SendCall(cqi.Call, d, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                }
                            }
                            catch (SocketException sex)
                            {
                            }
                        });
                    }

                    if (_departmentGroupsService == null)
                    {
                        _departmentGroupsService = Bootstrapper.GetKernel().Resolve <IDepartmentGroupsService>();
                    }

                    // Dispatch Groups
                    if (cqi.Call.GroupDispatches != null && cqi.Call.GroupDispatches.Any())
                    {
                        foreach (var d in cqi.Call.GroupDispatches)
                        {
                            if (!groupIds.Contains(d.DepartmentGroupId))
                            {
                                groupIds.Add(d.DepartmentGroupId);
                            }

                            var members = _departmentGroupsService.GetAllMembersForGroup(d.DepartmentGroupId);

                            foreach (var member in members)
                            {
                                if (!dispatchedUsers.Contains(member.UserId))
                                {
                                    dispatchedUsers.Add(member.UserId);
                                    try
                                    {
                                        var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                        _communicationService.SendCall(cqi.Call, new CallDispatch()
                                        {
                                            UserId = member.UserId
                                        }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                    }
                                    catch (SocketException sex)
                                    {
                                    }
                                    catch (Exception ex)
                                    {
                                        Logging.LogException(ex);
                                    }
                                }
                            }
                        }
                    }

                    // Dispatch Units
                    if (cqi.Call.UnitDispatches != null && cqi.Call.UnitDispatches.Any())
                    {
                        if (_unitsService == null)
                        {
                            _unitsService = Bootstrapper.GetKernel().Resolve <IUnitsService>();
                        }

                        foreach (var d in cqi.Call.UnitDispatches)
                        {
                            var unit = _unitsService.GetUnitById(d.UnitId);

                            if (unit != null && unit.StationGroupId.HasValue)
                            {
                                if (!groupIds.Contains(unit.StationGroupId.Value))
                                {
                                    groupIds.Add(unit.StationGroupId.Value);
                                }
                            }

                            _communicationService.SendUnitCall(cqi.Call, d, cqi.DepartmentTextNumber, cqi.Address);

                            var unitAssignedMembers = _unitsService.GetCurrentRolesForUnit(d.UnitId);

                            if (unitAssignedMembers != null && unitAssignedMembers.Count() > 0)
                            {
                                foreach (var member in unitAssignedMembers)
                                {
                                    if (!dispatchedUsers.Contains(member.UserId))
                                    {
                                        dispatchedUsers.Add(member.UserId);
                                        try
                                        {
                                            var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                            _communicationService.SendCall(cqi.Call, new CallDispatch()
                                            {
                                                UserId = member.UserId
                                            }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                        }
                                        catch (SocketException sex)
                                        {
                                        }
                                        catch (Exception ex)
                                        {
                                            Logging.LogException(ex);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (unit.StationGroupId.HasValue)
                                {
                                    var members = _departmentGroupsService.GetAllMembersForGroup(unit.StationGroupId.Value);

                                    foreach (var member in members)
                                    {
                                        if (!dispatchedUsers.Contains(member.UserId))
                                        {
                                            dispatchedUsers.Add(member.UserId);
                                            try
                                            {
                                                var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                                _communicationService.SendCall(cqi.Call, new CallDispatch()
                                                {
                                                    UserId = member.UserId
                                                }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                            }
                                            catch (SocketException sex)
                                            {
                                            }
                                            catch (Exception ex)
                                            {
                                                Logging.LogException(ex);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    // Dispatch Roles
                    if (cqi.Call.RoleDispatches != null && cqi.Call.RoleDispatches.Any())
                    {
                        if (_rolesService == null)
                        {
                            _rolesService = Bootstrapper.GetKernel().Resolve <IPersonnelRolesService>();
                        }

                        foreach (var d in cqi.Call.RoleDispatches)
                        {
                            var members = _rolesService.GetAllMembersOfRole(d.RoleId);

                            foreach (var member in members)
                            {
                                if (!dispatchedUsers.Contains(member.UserId))
                                {
                                    dispatchedUsers.Add(member.UserId);
                                    try
                                    {
                                        var profile = cqi.Profiles.FirstOrDefault(x => x.UserId == member.UserId);
                                        _communicationService.SendCall(cqi.Call, new CallDispatch()
                                        {
                                            UserId = member.UserId
                                        }, cqi.DepartmentTextNumber, cqi.Call.DepartmentId, profile, cqi.Address);
                                    }
                                    catch (SocketException sex)
                                    {
                                    }
                                    catch (Exception ex)
                                    {
                                        Logging.LogException(ex);
                                    }
                                }
                            }
                        }
                    }

                    // Send Call Print to Printer
                    if (_printerProvider == null)
                    {
                        _printerProvider = Bootstrapper.GetKernel().Resolve <IPrinterProvider>();
                    }

                    Dictionary <int, DepartmentGroup> fetchedGroups = new Dictionary <int, DepartmentGroup>();
                    if (cqi.Call.Dispatches != null && cqi.Call.Dispatches.Any())
                    {
                        foreach (var d in cqi.Call.Dispatches)
                        {
                            var group = _departmentGroupsService.GetGroupForUser(d.UserId, cqi.Call.DepartmentId);

                            if (group != null)
                            {
                                if (!groupIds.Contains(group.DepartmentGroupId))
                                {
                                    groupIds.Add(group.DepartmentGroupId);
                                }

                                if (!fetchedGroups.ContainsKey(group.DepartmentGroupId))
                                {
                                    fetchedGroups.Add(group.DepartmentGroupId, group);
                                }
                            }
                        }
                    }

                    foreach (var groupId in groupIds)
                    {
                        try
                        {
                            DepartmentGroup group = null;

                            if (fetchedGroups.ContainsKey(groupId))
                            {
                                group = fetchedGroups[groupId];
                            }
                            else
                            {
                                group = _departmentGroupsService.GetGroupById(groupId);
                            }

                            if (!String.IsNullOrWhiteSpace(group.PrinterData) && group.DispatchToPrinter)
                            {
                                var printerData = JsonConvert.DeserializeObject <DepartmentGroupPrinter>(group.PrinterData);
                                var apiKey      = SymmetricEncryption.Decrypt(printerData.ApiKey, Config.SystemBehaviorConfig.ExternalLinkUrlParamPassphrase);
                                var callUrl     = _callsService.GetShortenedCallPdfUrl(cqi.Call.CallId, true, groupId);

                                var printJob = _printerProvider.SubmitPrintJob(apiKey, printerData.PrinterId, "CallPrint", callUrl);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogException(ex);
                        }
                    }
                }
            }
            finally
            {
                _communicationService = null;
            }
        }
Example #29
0
 public Say(ICommunicationService commsService)
     : base(commsService)
 {
 }
 public PostAddUserToDefaultGroupsHandler(IRepository repository, IUserService userService, ICommunicationService communicationService)
 {
     _repository           = repository;
     _userService          = userService;
     _communicationService = communicationService;
 }
Example #31
0
 public RegistrationChasers(ICommunicationService communicationService)
 {
     _communicationService = communicationService;
 }
 public TimedTaskReminder(ICommunicationService commmunicationService)
 {
     _commmunicationService = commmunicationService;
 }
Example #33
0
 public LoginModel(ICommunicationService serv)
 {
     _communicationService = serv;
 }
 public BDXLeadAdapterProvider(int accountId, int leadAdapterAndAccountMapID, ILeadAdaptersRepository leadAdaptersRepository, IServiceProviderRepository serviceProviderRepository,
                               IImportDataRepository importDataRepository, ISearchService <Contact> searchService, IUnitOfWork unitOfWork,
                               ICustomFieldService customFieldService, ICachingService cacheService, ICommunicationService communicationService, IMailGunService mailGunService, IContactService contactService)
     : base(accountId, leadAdapterAndAccountMapID, LeadAdapterTypes.BDX, leadAdaptersRepository, importDataRepository, searchService, unitOfWork,
            customFieldService, cacheService, serviceProviderRepository, mailGunService, contactService)
 {
     Logger.Current.Verbose("Enter into BDXLeadAdapterProvider");
     this.mailGunService         = mailGunService;
     this.searchService          = searchService;
     this.contactService         = contactService;
     this.importDataRepository   = importDataRepository;
     this.leadAdaptersRepository = leadAdaptersRepository;
 }
Example #35
0
 public AccountController(ICommunicationService communicationService)
 {
     _communicationService = communicationService;
 }
Example #36
0
 public RequestEmailReminderStrategy(ICandidateReadRepository candidateReadRepository, ICommunicationService communicationService)
 {
     _candidateReadRepository = candidateReadRepository;
     _communicationService    = communicationService;
 }
Example #37
0
 public BacklogController(IMapper mapper, ICommunicationService communicationService)
 {
     _mapper = mapper;
     _communicationService = communicationService;
 }
 public HomeFinderLeadAdapterProvider(int accountId, int leadAdapterAndAccountMapID, ILeadAdaptersRepository leadAdaptersRepository, IServiceProviderRepository serviceProviderRepository,
                                      IImportDataRepository importDataRepository, ISearchService <Contact> searchService, IUnitOfWork unitOfWork,
                                      ICustomFieldService customFieldService, ICachingService cacheService, ICommunicationService communicationService, IMailGunService mailGunService, IContactService contactService)
     : base(accountId, leadAdapterAndAccountMapID, LeadAdapterTypes.HomeFinder, leadAdaptersRepository, importDataRepository, searchService, unitOfWork,
            customFieldService, cacheService, serviceProviderRepository, mailGunService, contactService)
 {
     this.mailGunService            = mailGunService;
     this.searchService             = searchService;
     this.contactService            = contactService;
     this.importDataRepository      = importDataRepository;
     this.leadAdaptersRepository    = leadAdaptersRepository;
     this.serviceProviderRepository = serviceProviderRepository;
     this.customFieldService        = customFieldService;
     this.cacheService = cacheService;
 }
 public MessageController(IMessageService messageService, ICommunicationService communicationService) : base(messageService)
 {
     this.messageService       = messageService;
     this.communicationService = communicationService;
 }
Example #40
0
 public CreateModel(ICommunicationService serv)
 {
     _communicationservice = serv;
 }
 public MasterConfigurationController(UserManager <ApplicationUser> userManager, IBasePage basePage, IMasterConfiguration masterConfiguration, ICommunicationService communicationService)
 {
     _userManager          = userManager;
     _masterConfiguration  = masterConfiguration;
     _communicationService = communicationService;
 }
Example #42
0
 public PutUpdateJobStatusToDoneHandler(IRepository repository, ICommunicationService communicationService, IJobService jobService)
 {
     _repository           = repository;
     _communicationService = communicationService;
     _jobService           = jobService;
 }
Example #43
0
 public MainWindowViewModel(ICommunicationService service)
 {
     this.communicationService = service;
     service.NewMessage       += this.NewMessage;
     this.jsonToken            = new ObservableCollection <JToken>();
 }
Example #44
0
 public SendEmailState(int workflowId, int stateId, string body, string subject, int from, IWorkflowService workflowService, ICommunicationService communicationService)
     : base(stateId)
 {
     this.WorkflowId           = workflowId;
     this.Body                 = body;
     this.Subject              = subject;
     this.FromEmailId          = from;
     this.workflowService      = workflowService;
     this.communicationService = communicationService;
 }
 public TimedNewRequestNotification(ICommunicationService commmunicationService)
 {
     _commmunicationService = commmunicationService;
 }
Example #46
0
 public UserManagementService(IUserManagementRepository userRepository, IMapper mapper, ICommunicationService sendMail, ISalesForcePushObject salesForcePushObject)
 {
     _userRepository       = userRepository;
     _mapper               = mapper;
     _mail                 = sendMail;
     _salesForcePushObject = salesForcePushObject;
 }
Example #47
0
		public CommunicationController(ICommunicationService communicationService)
		{
			if (ReferenceEquals(null, communicationService)) throw new ArgumentNullException("communicationService");

			_communicationService = communicationService;
		}
Example #48
0
 public ActionItemManager(
     IDynamicTypeManager dynamicTypeManager,
     IPersonManager personManager,
     ICommunicationService communicationService,
     ILogger logger,
     IApprovalManager approvalManager)
 {
     _dynamicTypeManager = dynamicTypeManager;
     _personManager = personManager;
     _communicationService = communicationService;
     _logger = logger;
     _approvalManager = approvalManager;
 }