Пример #1
0
 public CheckScannerBatchProcessor(ICheckScannerService checkScannerService, IEmailCommunication emailService, IConfigurationWrapper configuration)
 {
     _checkScannerService = checkScannerService;
     _emailService        = emailService;
     _checkScannerBatchSuccessTemplateId = configuration.GetConfigIntValue("CheckScannerBatchSuccessTemplateId");
     _checkScannerBatchFailureTemplateId = configuration.GetConfigIntValue("CheckScannerBatchFailureTemplateId");
 }
Пример #2
0
 public AddressRepository(IConfigurationWrapper configurationWrapper, IMinistryPlatformService ministryPlatformService, IApiUserRepository apiUserService)
 {
     _ministryPlatformService = ministryPlatformService;
     _apiUserService          = apiUserService;
     _addressPageId           = configurationWrapper.GetConfigIntValue("Addresses");
     _addressApiPageViewId    = configurationWrapper.GetConfigIntValue("AddressesApiPageView");
 }
Пример #3
0
        public IObservable <int> SendAcceptanceEmail(ContactInvitation contactInvitation)
        {
            var templateId = _confiurationWrapper.GetConfigIntValue("WaiverEmailTemplateId");
            var template   = _communicationRepository.GetTemplate(templateId);

            // get the event name for the waiver...
            return(_eventParticipantRepository.GetEventParticpantByEventParticipantWaiver(contactInvitation.Invitation.SourceId).Select(ep =>
            {
                var mergeData = new Dictionary <string, object>
                {
                    { "Event_Name", ep.EventTitle },
                    { "Confirmation_Url", $"https://{_confiurationWrapper.GetConfigValue("BaseUrl")}/waivers/accept/{contactInvitation.Invitation.InvitationGuid}" }
                };

                var comm = _communicationRepository.GetTemplateAsCommunication(templateId,
                                                                               template.FromContactId,
                                                                               template.FromEmailAddress,
                                                                               template.ReplyToContactId,
                                                                               template.ReplyToEmailAddress,
                                                                               contactInvitation.Contact.ContactId,
                                                                               contactInvitation.Contact.EmailAddress,
                                                                               mergeData);
                return _communicationRepository.SendMessage(comm);
            }));
        }
Пример #4
0
 public ProgramRepository(IMinistryPlatformService ministryPlatformService, IAuthenticationRepository authenticationService, IConfigurationWrapper configurationWrapper)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService        = ministryPlatformService;
     _onlineGivingProgramsPageViewId = configurationWrapper.GetConfigIntValue("OnlineGivingProgramsPageViewId");
     _programsPageId = configurationWrapper.GetConfigIntValue("Programs");
 }
Пример #5
0
        public InvitationService(
            IInvitationRepository invitationRepository,
            ICommunicationRepository communicationService,
            IConfigurationWrapper configuration,
            IGroupRepository groupRepository,
            IParticipantRepository participantRepository,
            IContactRepository contactRepository)
        {
            _invitationRepository  = invitationRepository;
            _communicationService  = communicationService;
            _groupRepository       = groupRepository;
            _participantRepository = participantRepository;
            _contactRepository     = contactRepository;

            _groupInvitationType                = configuration.GetConfigIntValue("GroupInvitationType");
            _groupInvitationEmailTemplate       = configuration.GetConfigIntValue("GroupInvitationEmailTemplate");
            _groupInvitationEmailTemplateCustom = configuration.GetConfigIntValue("GroupInvitationEmailTemplateCustom");
            _tripInvitationType          = configuration.GetConfigIntValue("TripInvitationType");
            _tripInvitationEmailTemplate = configuration.GetConfigIntValue("PrivateInviteTemplate");
            _anywhereGatheringInvitationEmailTemplate = configuration.GetConfigIntValue("AnywhereGatheringInvitationEmailTemplate");
            _anywhereGatheringInvitationTypeId        = configuration.GetConfigIntValue("AnywhereGatheringInvitationType");


            _defaultInvitationEmailTemplate = configuration.GetConfigIntValue("DefaultInvitationEmailTemplate");

            _domainId = configuration.GetConfigIntValue("DomainId");

            _groupRoleLeader = configuration.GetConfigIntValue("GroupRoleLeader");
        }
Пример #6
0
 public ProgramService(IMinistryPlatformService ministryPlatformService, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService = ministryPlatformService;
     _onlineGivingProgramsPageViewId = configurationWrapper.GetConfigIntValue("OnlineGivingProgramsPageViewId");
     _programsPageId = configurationWrapper.GetConfigIntValue("Programs");
 }
Пример #7
0
        //TODO: Put this logic in the Translation Layer?
        public bool SaveCommunicationPrefs(string token, AccountInfo accountInfo)
        {
            var contactId = _authenticationService.GetContactId(token);
            var contact   = _ministryPlatformService.GetRecordDict(_configurationWrapper.GetConfigIntValue("MyContact"), contactId, token);

            try
            {
                var emailsmsDict = getDictionary(new EmailSMSOptOut
                {
                    Contact_ID         = contactId,
                    Bulk_Email_Opt_Out = accountInfo.EmailNotifications,
                    Bulk_SMS_Opt_Out   = accountInfo.TextNotifications
                });
                var mailDict = getDictionary(new MailOptOut
                {
                    Household_ID      = (int)contact["Household_ID"],
                    Bulk_Mail_Opt_Out = accountInfo.PaperlessStatements
                });
                _communicationService.SetEmailSMSPreferences(token, emailsmsDict);
                _communicationService.SetMailPreferences(token, mailDict);
                return(true);
            }
            catch (Exception e)
            {
                _logger.Warn(string.Format("Could not set communication preferences for contact {0}", contactId), e);
                // ReSharper disable once PossibleIntendedRethrow
                throw e;
            }
        }
Пример #8
0
        public EventService(TranslationEventService eventService,
                            IGroupRepository groupService,
                            ICommunicationRepository communicationService,
                            IContactRepository contactService,
                            IContentBlockService contentBlockService,
                            IConfigurationWrapper configurationWrapper,
                            IApiUserRepository apiUserService,
                            IContactRelationshipRepository contactRelationshipService,
                            IGroupParticipantRepository groupParticipantService,
                            IParticipantRepository participantService,
                            IRoomRepository roomService,
                            IEquipmentRepository equipmentService,
                            IEventParticipantRepository eventParticipantService)
        {
            _eventService               = eventService;
            _groupService               = groupService;
            _communicationService       = communicationService;
            _contactService             = contactService;
            _contentBlockService        = contentBlockService;
            _configurationWrapper       = configurationWrapper;
            _apiUserService             = apiUserService;
            _contactRelationshipService = contactRelationshipService;
            _groupParticipantService    = groupParticipantService;
            _participantService         = participantService;
            _roomService             = roomService;
            _equipmentService        = equipmentService;
            _eventParticipantService = eventParticipantService;

            childcareEventTypeID = configurationWrapper.GetConfigIntValue("ChildcareEventType");
            childcareGroupTypeID = configurationWrapper.GetConfigIntValue("ChildcareGroupType");
        }
Пример #9
0
        public ServeService(IContactRepository contactService,
                            IContactRelationshipRepository contactRelationshipService,
                            IOpportunityRepository opportunityService,
                            MinistryPlatform.Translation.Repositories.Interfaces.IEventRepository eventService,
                            IParticipantRepository participantService,
                            IGroupParticipantRepository groupParticipantService,
                            IGroupRepository groupService,
                            ICommunicationRepository communicationService,
                            IAuthenticationRepository authenticationService,
                            IConfigurationWrapper configurationWrapper,
                            IApiUserRepository apiUserService,
                            IResponseRepository 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;
            _serveGroupType          = _configurationWrapper.GetConfigIntValue("ServeGroupType");

            _rsvpYes = _configurationWrapper.GetConfigIntValue("RSVPYesId");
        }
        private List <AttributeDTO> GetAttributesByType(string attributeType)
        {
            var attributeTypeId = _configurationWrapper.GetConfigIntValue(attributeType);
            var attributeTypes  = _attributeService.GetAttributeTypes(attributeTypeId);

            return(attributeTypes.Single().Attributes);
        }
 public PrivateInviteRepository(IMinistryPlatformService ministryPlatformService, IAuthenticationRepository authenticationService, IConfigurationWrapper configurationWrapper)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService = ministryPlatformService;
     _configurationWrapper    = configurationWrapper;
     _tripPrivateInviteId     = _configurationWrapper.GetConfigIntValue("TripPrivateInvite");
     _tripInvitationsPageId   = _configurationWrapper.GetConfigIntValue("TripInvitations");
 }
Пример #12
0
 public PrivateInviteService(IMinistryPlatformService ministryPlatformService, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper)
     : base(authenticationService, configurationWrapper)
 {
     _ministryPlatformService = ministryPlatformService;
     _configurationWrapper = configurationWrapper;
     _tripPrivateInviteId = _configurationWrapper.GetConfigIntValue("TripPrivateInvite");
     _tripInvitationsPageId = _configurationWrapper.GetConfigIntValue("TripInvitations");
 }
Пример #13
0
        public PledgeService(IMinistryPlatformService ministryPlatformService, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper)
            : base(authenticationService, configurationWrapper)
        {
            _ministryPlatformService = ministryPlatformService;

            _pledgePageId = configurationWrapper.GetConfigIntValue("Pledges");
            _myHouseholdPledges = configurationWrapper.GetConfigIntValue("MyHouseholdPledges");
        }
Пример #14
0
        public PledgeRepository(IMinistryPlatformService ministryPlatformService, IMinistryPlatformRestRepository ministryPlatformRestRepository, IAuthenticationRepository authenticationService, IConfigurationWrapper configurationWrapper)
            : base(authenticationService, configurationWrapper)
        {
            _ministryPlatformService        = ministryPlatformService;
            _ministryPlatformRestRepository = ministryPlatformRestRepository;

            _pledgePageId       = configurationWrapper.GetConfigIntValue("Pledges");
            _myHouseholdPledges = configurationWrapper.GetConfigIntValue("MyHouseholdPledges");
        }
Пример #15
0
 public DonationService(MPServices.IDonationRepository mpDonationRepository, MPServices.IDonorRepository mpDonorRepository, IPaymentProcessorService paymentService, MPServices.IContactRepository contactRepository, IConfigurationWrapper config)
 {
     _mpDonationRepository   = mpDonationRepository;
     _mpDonorRepository      = mpDonorRepository;
     _paymentService         = paymentService;
     _contactRepository      = contactRepository;
     _statementTypeFamily    = config.GetConfigIntValue("DonorStatementTypeFamily");
     _bankErrorRefundDonorId = config.GetConfigIntValue("DonorIdForBankErrorRefund");
 }
Пример #16
0
        public StripeEventService(IPaymentProcessorService paymentProcessorService, IDonationService donationService, IPaymentService paymentService, MinistryPlatform.Translation.Repositories.Interfaces.IDonorRepository mpDonorRepository, IConfigurationWrapper configuration)
        {
            _paymentProcessorService = paymentProcessorService;
            _donationService         = donationService;
            _mpDonorRepository       = mpDonorRepository;
            _paymentService          = paymentService;

            _donationStatusDeclined         = configuration.GetConfigIntValue("DonationStatusDeclined");
            _donationStatusDeposited        = configuration.GetConfigIntValue("DonationStatusDeposited");
            _donationStatusSucceeded        = configuration.GetConfigIntValue("DonationStatusSucceeded");
            _batchEntryTypePaymentProcessor = configuration.GetConfigIntValue("BatchEntryTypePaymentProcessor");
        }
Пример #17
0
 public EmailCommunication(ICommunicationRepository communicationService,
                           IPersonService personService,
                           IContactRepository contactService,
                           IConfigurationWrapper configurationWrapper)
 {
     _communicationService = communicationService;
     _personService        = personService;
     _contactService       = contactService;
     _configurationWrapper = configurationWrapper;
     DefaultContactEmailId = _configurationWrapper.GetConfigIntValue("DefaultContactEmailId");
     DomainID            = _configurationWrapper.GetConfigIntValue("DomainId");
     DefaultAuthorUserId = _configurationWrapper.GetConfigIntValue("DefaultAuthorUser");
 }
Пример #18
0
        public FormSubmissionRepository(IMinistryPlatformService ministryPlatformService, IDbConnection dbConnection, IAuthenticationRepository authenticationService, IConfigurationWrapper configurationWrapper, IMinistryPlatformRestRepository ministryPlatformRest)
            : base(authenticationService, configurationWrapper)
        {
            _ministryPlatformService        = ministryPlatformService;
            _ministryPlatformRestRepository = ministryPlatformRest;
            _dbConnection         = dbConnection;
            _configurationWrapper = configurationWrapper;

            _formResponsePageId     = configurationWrapper.GetConfigIntValue("FormResponsePageId");
            _formAnswerPageId       = configurationWrapper.GetConfigIntValue("FormAnswerPageId");
            _formFieldCustomPage    = configurationWrapper.GetConfigIntValue("AllFormFieldsView");
            _formResponseGoTripView = configurationWrapper.GetConfigIntValue("GoTripFamilySignup");
        }
Пример #19
0
 public GroupToolController(Services.Interfaces.IGroupToolService groupToolService,
                            IConfigurationWrapper configurationWrapper,
                            IUserImpersonationService userImpersonationService,
                            IAuthenticationRepository authenticationRepository,
                            IAnalyticsService analyticsService,
                            IGroupService groupService) : base(userImpersonationService, authenticationRepository)
 {
     _groupToolService     = groupToolService;
     _groupService         = groupService;
     _configurationWrapper = configurationWrapper;
     _analyticsService     = analyticsService;
     _defaultGroupTypeId   = _configurationWrapper.GetConfigIntValue("SmallGroupTypeId");
     _defaultRoleId        = _configurationWrapper.GetConfigIntValue("Group_Role_Default_ID");
 }
Пример #20
0
        public void UpdateSkills(int participantId, List <GoSkills> skills, string token)
        {
            MpObjectAttributeConfiguration configuration;

            if (token == String.Empty)
            {
                token         = _apiUserService.GetToken();
                configuration = MpObjectAttributeConfigurationFactory.Contact();
            }
            else
            {
                configuration = MpObjectAttributeConfigurationFactory.MyContact();
            }

            var contactObs = Observable.Start(() => _contactService.GetContactByParticipantId(participantId));

            contactObs.Subscribe(con =>
            {
                var attrs = Observable.Start(() => _objectAttributeService.GetObjectAttributes(token, con.Contact_ID, configuration));

                attrs.Subscribe(attr =>
                {
                    var curSk = attr.MultiSelect
                                .FirstOrDefault(kvp => kvp.Value.AttributeTypeId == _configurationWrapper.GetConfigIntValue("AttributeTypeIdSkills")).Value.Attributes
                                .Where(attribute => attribute.Selected).ToList();

                    var skillsEndDate = SkillsToEndDate(skills, curSk).Select(sk =>
                    {
                        sk.EndDate = DateTime.Now;
                        return(sk);
                    });

                    var addSkills    = SkillsToAdd(skills, curSk).ToList();
                    var allSkills    = addSkills.Concat(skillsEndDate).ToList();
                    var allSkillsObs = allSkills.ToObservable();
                    try
                    {
                        allSkillsObs.ForEachAsync(skill =>
                        {
                            _objectAttributeService.SaveObjectMultiAttribute(token, con.Contact_ID, skill, configuration, true);
                        });
                    }
                    catch (Exception e)
                    {
                        throw new ApplicationException("Updating skills caused an error");
                    }
                });
            });
        }
Пример #21
0
        public GroupService(IGroupRepository mpGroupRepository,
                            IConfigurationWrapper configurationWrapper,
                            IEventRepository eventService,
                            IContactRelationshipRepository contactRelationshipService,
                            IServeService serveService,
                            IParticipantRepository participantService,
                            ICommunicationRepository communicationService,
                            IContactRepository contactService,
                            IObjectAttributeService objectAttributeService,
                            IApiUserRepository apiUserService,
                            IAttributeRepository attributeRepository,
                            IEmailCommunication emailCommunicationService,
                            IUserRepository userRepository,
                            IInvitationRepository invitationRepository,
                            IAttributeService attributeService,
                            IDateTime dateTimeWrapper)

        {
            _mpGroupRepository          = mpGroupRepository;
            _configurationWrapper       = configurationWrapper;
            _eventService               = eventService;
            _contactRelationshipService = contactRelationshipService;
            _serveService               = serveService;
            _participantService         = participantService;
            _communicationService       = communicationService;
            _contactService             = contactService;
            _objectAttributeService     = objectAttributeService;
            _apiUserService             = apiUserService;
            _attributeRepository        = attributeRepository;
            _emailCommunicationService  = emailCommunicationService;
            _userRepository             = userRepository;
            _invitationRepository       = invitationRepository;
            _attributeService           = attributeService;
            _domainId = configurationWrapper.GetConfigIntValue("DomainId");

            _groupRoleDefaultId           = _configurationWrapper.GetConfigIntValue("Group_Role_Default_ID");
            _defaultAuthorUserId          = configurationWrapper.GetConfigIntValue("DefaultAuthorUser");
            _defaultContactEmailId        = _configurationWrapper.GetConfigIntValue("DefaultContactEmailId");
            _journeyGroupTypeId           = configurationWrapper.GetConfigIntValue("JourneyGroupTypeId");
            _groupCategoryAttributeTypeId = configurationWrapper.GetConfigIntValue("GroupCategoryAttributeTypeId");
            _groupTypeAttributeTypeId     = configurationWrapper.GetConfigIntValue("GroupTypeAttributeTypeId");
            _groupAgeRangeAttributeTypeId = configurationWrapper.GetConfigIntValue("GroupAgeRangeAttributeTypeId");
            _groupRoleLeader               = configurationWrapper.GetConfigIntValue("GroupRoleLeader");
            _onsiteGroupTypeId             = _configurationWrapper.GetConfigIntValue("OnsiteGroupTypeId");
            _childcareEventTypeId          = _configurationWrapper.GetConfigIntValue("ChildcareEventType");
            _removeSelfFromGroupTemplateId = _configurationWrapper.GetConfigIntValue("RemoveSelfFromGroupTemplateId");
            _dateTimeWrapper               = dateTimeWrapper;
        }
Пример #22
0
 public FormBuilderService(IFormBuilderRepository mpFormBuilderService,
                           IConfigurationWrapper configurationWrapper)
 {
     _mpFormBuilderService      = mpFormBuilderService;
     _configurationWrapper      = configurationWrapper;
     _undividedGroupsPageViewId = configurationWrapper.GetConfigIntValue("UndividedGroupsPageViewId");
 }
Пример #23
0
 public GoVolunteerService(MPInterfaces.IParticipantRepository participantService,
                           IRegistrationRepository registrationService,
                           MPInterfaces.IContactRepository contactService,
                           IGroupConnectorRepository groupConnectorService,
                           IConfigurationWrapper configurationWrapper,
                           MPInterfaces.IContactRelationshipRepository contactRelationshipService,
                           MPInterfaces.IProjectTypeRepository projectTypeService,
                           IAttributeService attributeService,
                           IGoSkillsService skillsService,
                           MPInterfaces.ICommunicationRepository comunicationService,
                           MPInterfaces.IUserRepository userService)
 {
     _participantService         = participantService;
     _registrationService        = registrationService;
     _contactService             = contactService;
     _groupConnectorService      = groupConnectorService;
     _configurationWrapper       = configurationWrapper;
     _contactRelationshipService = contactRelationshipService;
     _projectTypeService         = projectTypeService;
     _attributeService           = attributeService;
     _otherEquipmentId           = _configurationWrapper.GetConfigIntValue("GoCincinnatiOtherEquipmentAttributeId");
     _skillsService        = skillsService;
     _communicationService = comunicationService;
     _userService          = userService;
 }
Пример #24
0
        private MpCommunication SetupCommunication(int templateId, MpMyContact groupContact, MpMyContact toContact, Dictionary <string, object> mergeData)
        {
            var template       = _communicationService.GetTemplate(templateId);
            var defaultContact = _contactService.GetContactById(_configurationWrapper.GetConfigIntValue("DefaultContactEmailId"));

            return(new MpCommunication
            {
                AuthorUserId = 5,
                DomainId = 1,
                EmailBody = template.Body,
                EmailSubject = template.Subject,
                FromContact = new MpContact {
                    ContactId = defaultContact.Contact_ID, EmailAddress = defaultContact.Email_Address
                },
                ReplyToContact = new MpContact {
                    ContactId = groupContact.Contact_ID, EmailAddress = groupContact.Email_Address
                },
                ToContacts = new List <MpContact> {
                    new MpContact {
                        ContactId = toContact.Contact_ID, EmailAddress = toContact.Email_Address
                    }
                },
                MergeData = mergeData
            });
        }
Пример #25
0
        private void ProcessSynchronizationResultsWithRetries(Dictionary <MpBulkEmailPublication, List <string> > publicationOperations)
        {
            var configurationWaitHours = _configWrapper.GetConfigIntValue("BulkEmailMaximumWaitHours");
            var waitTime        = (int)TimeSpan.FromSeconds(10).TotalSeconds;
            var maximumWaitTime = (int)TimeSpan.FromHours(configurationWaitHours).TotalSeconds;
            var maxRetries      = maximumWaitTime / waitTime;
            var attempts        = 0;

            do
            {
                attempts++;

                if (attempts > maxRetries)
                {
                    // This will be addressed is US2861: MP/MailChimp Synch Error Handling
                    // TODO: Should these be exceptions?
                    // Probably an infinite loop so stop processing and log error
                    _logger.ErrorFormat("Failed to LogUpdateStatuses after {0} total retries", attempts);
                    return;
                }

                // pause to allow the operations to complete -- consider switching this to async
                Thread.Sleep(waitTime * 1000);

                // TODO: Think about creating BulkEmailPublicationOperation object and moving away from Dictionary<BulkEmailPublication, List<string>>
                publicationOperations = ProcessSynchronizationResults(publicationOperations);
            } while (publicationOperations.Any());
        }
Пример #26
0
        public ChildcareService(IEventParticipantRepository eventParticipantService,
                                ICommunicationRepository communicationService,
                                IConfigurationWrapper configurationWrapper,
                                IContactRepository contactService,
                                IEventRepository eventService,
                                IParticipantRepository participantService,
                                IServeService serveService,
                                IDateTime dateTimeWrapper,
                                IApiUserRepository apiUserService,
                                IEventService crdsEventService,
                                IChildcareRequestRepository childcareRequestService,
                                IGroupService groupService,
                                IChildcareRepository childcareRepository)
        {
            _childcareRequestService = childcareRequestService;
            _eventParticipantService = eventParticipantService;
            _communicationService    = communicationService;
            _configurationWrapper    = configurationWrapper;
            _contactService          = contactService;
            _crdsEventService        = crdsEventService;
            _eventService            = eventService;
            _participantService      = participantService;
            _serveService            = serveService;
            _dateTimeWrapper         = dateTimeWrapper;
            _apiUserService          = apiUserService;
            _groupService            = groupService;
            _childcareRepository     = childcareRepository;

            _childcareGroupType = _configurationWrapper.GetConfigIntValue("ChildcareGroupType");
        }
Пример #27
0
 public InvoiceRepository(IMinistryPlatformRestRepository ministryPlatformRest, IApiUserRepository apiUserRepository, IProductRepository productRepository, IConfigurationWrapper configurationWrapper)
 {
     _ministryPlatformRest = ministryPlatformRest;
     _apiUserRepository    = apiUserRepository;
     _productRepository    = productRepository;
     _configurationWrapper = configurationWrapper;
     _invoiceCancelled     = _configurationWrapper.GetConfigIntValue("InvoiceCancelled");
 }
Пример #28
0
 public DonationService(MPServices.IDonationService mpDonationService, MPServices.IDonorService mpDonorService, IPaymentService paymentService, MPServices.IContactService contactService, IConfigurationWrapper config)
 {
     _mpDonationService = mpDonationService;
     _mpDonorService = mpDonorService;
     _paymentService = paymentService;
     _contactService = contactService;
     _statementTypeFamily = config.GetConfigIntValue("DonorStatementTypeFamily");
 }
Пример #29
0
 public GroupToolController(Services.Interfaces.IGroupToolService groupToolService,
                            IConfigurationWrapper configurationWrapper,
                            IUserImpersonationService userImpersonationService) : base(userImpersonationService)
 {
     _groupToolService     = groupToolService;
     _configurationWrapper = configurationWrapper;
     _defaultGroupTypeId   = _configurationWrapper.GetConfigIntValue("SmallGroupTypeId");
 }
Пример #30
0
        public ResponseRepository(IAuthenticationRepository authenticationService, IConfigurationWrapper configurationWrapper, IMinistryPlatformService ministryPlatformService)
            : base(authenticationService, configurationWrapper)
        {
            _authenticationService   = authenticationService;
            _configurationWrapper    = configurationWrapper;
            _ministryPlatformService = ministryPlatformService;

            _signupToServeRemindersId = _configurationWrapper.GetConfigIntValue("SignupToServeReminders");
        }
Пример #31
0
        public List <GroupConnector> GetGroupConnectorsForOpenOrganizations(int initiativeId)
        {
            var mpGroupConnector = _mpGroupConnectorService.GetGroupConnectorsForOpenOrganizations(initiativeId);
            var anywhereId       = _configWrapper.GetConfigIntValue("AnywhereCongregation");

            // filter out Anywhere group connectors because they are special
            mpGroupConnector = mpGroupConnector.Where((gc) => gc.PreferredLaunchSiteId != anywhereId).ToList();
            return(MapGroupConnector(mpGroupConnector));
        }
Пример #32
0
        public MpCamp GetCampEventDetails(int eventId)
        {
            var          apiToken     = _apiUserRepository.GetToken();
            var          campType     = _configurationWrapper.GetConfigIntValue("CampEventType");
            var          gradeGroupId = _configurationWrapper.GetConfigIntValue("AgeorGradeGroupType");
            var          campGrades   = _ministryPlatformRest.UsingAuthenticationToken(apiToken).Search <MpEventGroup>($"Event_ID_Table.[Event_ID] = {eventId} AND Group_ID_Table_Group_Type_ID_Table.[Group_Type_ID] = {gradeGroupId}", "Group_ID_Table.Group_ID, Group_ID_Table.Group_Name").ToList();
            const string columnList   = "Events.[Event_ID],Events.[Event_Title],Events.[Event_Start_Date],Events.[Event_End_Date],Event_Type_ID_Table.[Event_Type_ID], Program_ID_Table.[Program_ID],Online_Registration_Product_Table.[Product_ID],Events.[Registration_Start],Events.[Registration_End],Primary_Contact_Table.[Email_Address]";
            var          campData     = _ministryPlatformRest.UsingAuthenticationToken(apiToken).Search <MpCamp>($"Event_ID = {eventId}", columnList).ToList();

            campData = campData.Where((camp) => camp.EventType == campType).ToList();
            var campEvent = campData.FirstOrDefault();

            if (campEvent == null)
            {
                throw new Exception("No Camp found");
            }
            campEvent.CampGradesList = campGrades;
            return(campEvent);
        }
 public TextCommunicationController(ITextCommunicationService textCommunicationService, IConfigurationWrapper configurationWrapper, IUserImpersonationService userImpersonationService,
                                    IMessageQueueFactory messageQueueFactory = null, IMessageFactory messageFactory = null, IMessageQueue messageQueue = null) : base(userImpersonationService)
 {
     _textCommunicationService = textCommunicationService;
     _eventQueueName           = configurationWrapper.GetConfigValue("ScheduledJobsQueueName");
     _streamReminderTemplateId = configurationWrapper.GetConfigIntValue("StreamReminderTemplate");
     _messageQueue             = messageQueue;
     _messageQueue.CreateQueue(_eventQueueName, QueueAccessMode.Send);
     _messageFactory = messageFactory;
 }
Пример #34
0
        public List <MpChildcareCancelledNotification> GetChildcareCancellations()
        {
            var apiToken = _apiUserRepository.GetToken();
            var parms    = new Dictionary <string, object>
            {
                { "@ChildcareGroupType", _configurationWrapper.GetConfigIntValue("ChildcareGroupType") }
            };
            var notificationData = _ministryPlatformRest.UsingAuthenticationToken(apiToken).GetFromStoredProc <MpChildcareCancelledNotification>("api_crds_CancelledChildcareNotification", parms);

            return(notificationData.FirstOrDefault() ?? new List <MpChildcareCancelledNotification>());
        }
Пример #35
0
 public EmailCommunication(ICommunicationService communicationService, 
     IPersonService personService, 
     IContactService contactService,
     IConfigurationWrapper configurationWrapper)
 {
     _communicationService = communicationService;
     _personService = personService;
     _contactService = contactService;
     _configurationWrapper = configurationWrapper;
     DefaultContactEmailId = _configurationWrapper.GetConfigIntValue("DefaultContactEmailId");
 }
Пример #36
0
 public GroupService(IGroupService mpGroupService,
                     IConfigurationWrapper configurationWrapper,
                     IEventService eventService,
                     IContactRelationshipService contactRelationshipService,
                     IServeService serveService)
 {
     _mpGroupService = mpGroupService;
     _configurationWrapper = configurationWrapper;
     _eventService = eventService;
     _contactRelationshipService = contactRelationshipService;
     _serveService = serveService;
     GroupRoleDefaultId = Convert.ToInt32(_configurationWrapper.GetConfigIntValue("Group_Role_Default_ID"));
 }
Пример #37
0
        public ContactService(IMinistryPlatformService ministryPlatformService, IAuthenticationService authenticationService, IConfigurationWrapper configuration)
            : base(authenticationService, configuration)
        {
            _ministryPlatformService = ministryPlatformService;
            _configurationWrapper = configuration;

            _householdsPageId = configuration.GetConfigIntValue("Households");
            _securityRolesSubPageId = configuration.GetConfigIntValue("SecurityRolesSubPageId");
            _congregationDefaultId = configuration.GetConfigIntValue("Congregation_Default_ID");
            _householdDefaultSourceId = configuration.GetConfigIntValue("Household_Default_Source_ID");
            _householdPositionDefaultId = configuration.GetConfigIntValue("Household_Position_Default_ID");
            _addressesPageId = configuration.GetConfigIntValue("Addresses");
            _contactsPageId = configuration.GetConfigIntValue("Contacts");
            _participantsPageId = configuration.GetConfigIntValue("Participants");
        }
Пример #38
0
        public DonorService(IDonorService mpDonorService, IContactService mpContactService,
            Interfaces.IPaymentService paymentService, IConfigurationWrapper configurationWrapper,
            IAuthenticationService authenticationService, IPledgeService pledgeService)
        {
            _mpDonorService = mpDonorService;
            _mpContactService = mpContactService;
            _paymentService = paymentService;
            _authenticationService = authenticationService;
            _pledgeService = pledgeService;

            _guestGiverDisplayName = configurationWrapper.GetConfigValue("GuestGiverContactDisplayName");

            _statementFrequencyNever = configurationWrapper.GetConfigIntValue("DonorStatementFrequencyNever");
            _statementFrequencyQuarterly = configurationWrapper.GetConfigIntValue("DonorStatementFrequencyQuarterly");
            _statementTypeIndividual = configurationWrapper.GetConfigIntValue("DonorStatementTypeIndividual");
            _statementMethodNone = configurationWrapper.GetConfigIntValue("DonorStatementMethodNone");
            _statementMethodPostalMail = configurationWrapper.GetConfigIntValue("DonorStatementMethodPostalMail");
            _notSiteSpecificCongregation = configurationWrapper.GetConfigIntValue("NotSiteSpecificCongregation");
            _capitalCampaignPledgeTypeId = configurationWrapper.GetConfigIntValue("PledgeCampaignTypeCapitalCampaign");

            _recurringGiftSetupEmailTemplateId = configurationWrapper.GetConfigIntValue("RecurringGiftSetupEmailTemplateId");
            _recurringGiftUpdateEmailTemplateId = configurationWrapper.GetConfigIntValue("RecurringGiftUpdateEmailTemplateId");
            _recurringGiftCancelEmailTemplateId = configurationWrapper.GetConfigIntValue("RecurringGiftCancelEmailTemplateId");
        }
Пример #39
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"
            };

        }
Пример #40
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");
 }
Пример #41
0
 public StripeService(IRestClient stripeRestClient, IConfigurationWrapper configuration, IContentBlockService contentBlockService)
 {
     _stripeRestClient = stripeRestClient;
     _maxQueryResultsPerPage = configuration.GetConfigIntValue("MaxStripeQueryResultsPerPage");
     _contentBlockService = contentBlockService;
 }