Example #1
0
        static void Main(string[] args)
        {
            AutoMapperConfig.RegisterMappings();

            var container     = new UnityContainer();
            var unitySections = new[] { "crossroadsCommonUnity", "unity" };

            foreach (var section in unitySections.Select(sectionName => (UnityConfigurationSection)ConfigurationManager.GetSection(sectionName)))
            {
                container.LoadConfiguration(section);
            }

            TlsHelper.AllowTls12();

            var exitCode = 0;

            try
            {
                // Dependency Injection
                _eventService = container.Resolve <EventService>();
                _eventService.SendReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode = 1;
                Log.Error("Event Reminder Process failed.", ex);
            }

            try
            {
                _eventService = container.Resolve <EventService>();
                _eventService.SendPrimaryContactReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode = 1;
                Log.Error("Event Primary Contact Reminder Process failed.", ex);
            }

            try
            {
                _serveService = container.Resolve <ServeService>();
                _serveService.SendReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode += 2;
                Log.Error("Serve Reminder Process failed.", ex);
            }

            Log.Info("all done");
            Environment.Exit(exitCode);
        }
Example #2
0
        static void Main(string[] args)
        {
            AutoMapperConfig.RegisterMappings();
            var section   = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            var container = new UnityContainer();

            section.Configure(container);

            TlsHelper.AllowTls12();

            var exitCode = 0;

            try
            {
                // Dependency Injection
                _eventService = container.Resolve <EventService>();
                _eventService.SendReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode = 1;
                Log.Error("Event Reminder Process failed.", ex);
            }

            try
            {
                _eventService = container.Resolve <EventService>();
                _eventService.SendPrimaryContactReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode = 1;
                Log.Error("Event Primary Contact Reminder Process failed.", ex);
            }

            try
            {
                _serveService = container.Resolve <ServeService>();
                _serveService.SendReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode += 2;
                Log.Error("Serve Reminder Process failed.", ex);
            }

            Log.Info("all done");
            Environment.Exit(exitCode);
        }
 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;
 }
Example #4
0
        static void Main(string[] args)
        {
            AutoMapperConfig.RegisterMappings();
            var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            var container = new UnityContainer();
            section.Configure(container);

            TlsHelper.AllowTls12();

            var exitCode = 0;

            try
            {
                // Dependency Injection
                _eventService = container.Resolve<EventService>();
                _eventService.SendReminderEmails();                                  
            }
            catch (Exception ex)
            {
                exitCode = 1;
                Log.Error("Event Reminder Process failed.", ex);
            }

            try
            {
                _serveService = container.Resolve<ServeService>();
                _serveService.SendReminderEmails();
            }
            catch (Exception ex)
            {
                exitCode += 2;
                Log.Error("Serve Reminder Process failed.", ex);
            }

            Log.Info("all done");
            Environment.Exit(exitCode);
        }
Example #5
0
 public EventController(IMinistryPlatformService ministryPlatformService, IApiUserRepository apiUserService, IEventService eventService, IUserImpersonationService userImpersonationService) : base(userImpersonationService)
 {
     this._ministryPlatformService = ministryPlatformService;
     _eventService   = eventService;
     _apiUserService = apiUserService;
 }
Example #6
0
 public EventToolController(IApiUserRepository apiUserService, IEventService eventService, IUserImpersonationService userImpersonationService, IAuthenticationRepository authenticationRepository) : base(userImpersonationService, authenticationRepository)
 {
     _eventService   = eventService;
     _apiUserService = apiUserService;
 }