public ExhibitorService(IExhibitorRepository exhibitorRepository, IAddressRepository addressRepository,
                         IExhibitorHorseRepository exhibitorHorseRepository, IHorseRepository horseRepository,
                         IGroupExhibitorRepository groupExhibitorRepository, IGlobalCodeRepository globalCodeRepository,
                         IExhibitorClassRepository exhibitorClassRepository, IClassRepository classRepository,
                         ISponsorExhibitorRepository sponsorExhibitorRepository, ISponsorRepository sponsorRepository,
                         IScanRepository scanRepository, IExhibitorPaymentDetailRepository exhibitorPaymentDetailRepository,
                         IApplicationSettingRepository applicationRepository, IEmailSenderRepository emailSenderRepository,
                         IClassSponsorRepository classSponsorRepository, IMapper mapper, IStallAssignmentRepository stallAssignmentRepository)
 {
     _exhibitorRepository              = exhibitorRepository;
     _addressRepository                = addressRepository;
     _exhibitorHorseRepository         = exhibitorHorseRepository;
     _horseRepository                  = horseRepository;
     _groupExhibitorRepository         = groupExhibitorRepository;
     _globalCodeRepository             = globalCodeRepository;
     _exhibitorClassRepository         = exhibitorClassRepository;
     _classRepository                  = classRepository;
     _sponsorExhibitorRepository       = sponsorExhibitorRepository;
     _sponsorRepository                = sponsorRepository;
     _scanRepository                   = scanRepository;
     _exhibitorPaymentDetailRepository = exhibitorPaymentDetailRepository;
     _applicationRepository            = applicationRepository;
     _emailSenderRepository            = emailSenderRepository;
     _classSponsorRepository           = classSponsorRepository;
     _mapper       = mapper;
     _mainResponse = new MainResponse();
     _stallAssignmentRepository = stallAssignmentRepository;
 }
Beispiel #2
0
        public void MyTestInitialize()
        {
            this.scope = new TransactionScope(TransactionScopeOption.RequiresNew);

            var context = new FactWebContext();

            this.repository = new ApplicationSettingRepository(context);
        }
 public ReportService(IReportRepository reportRepository, IApplicationSettingRepository applicationRepository,
                      IEmailSenderRepository emailSenderRepository, IMapper Mapper)
 {
     _reportRepository      = reportRepository;
     _mapper                = Mapper;
     _mainResponse          = new MainResponse();
     _applicationRepository = applicationRepository;
     _emailSenderRepository = emailSenderRepository;
 }
 public ApplicationSettingClientRepositoryTest()
 {
     Common.Dependencies.Register();
     DataAccess.Dependencies.Register();
     this.applicationSettings = new Mock<IApplicationSettings>();
     this.componentSettingsClient = new Mock<IComponentSettingsClient>();
     DIContainer.Instance.RegisterInstance<IComponentSettingsClient>(this.componentSettingsClient.Object);
     this.applicationSettings.Setup(mock => mock.ConfigurationServiceBaseAddress).Returns("http://Localhost/");
     this.applicationSettingRepository = new ApplicationSettingClientRepository();
 }
Beispiel #5
0
 public ApplicationSettingController(IApplicationSettingRepository applicationSettingRepository,
                                     IApplicationRepository applicationRepository,
                                     ISettingRepository settingRepository,
                                     IUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
     this.applicationSettingRepository = applicationSettingRepository;
     this.applicationRepository        = applicationRepository;
     this.settingRepository            = settingRepository;
 }
 public UserService(IUserRepository userRepository, IEmailSenderRepository emailRepository,
                    IApplicationSettingRepository applicationRepository, IUserRoleRepository userRoleRepository,
                    IRoleRepository roleRepository, IMapper Mapper)
 {
     _userRepository        = userRepository;
     _emailRepository       = emailRepository;
     _applicationRepository = applicationRepository;
     _userRoleRepository    = userRoleRepository;
     _roleRepository        = roleRepository;
     _mapper       = Mapper;
     _mainResponse = new MainResponse();
 }
Beispiel #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserService" /> class.
        /// </summary>
        /// <param name="syngentaSIPUnitOfWork">The syngenta sip unit of work.</param>
        /// <param name="applicationSettings">The application settings.</param>
        /// <param name="cryptoService">The crypto service.</param>
        public UserService(ISyngentaSIPUnitOfWork syngentaSIPUnitOfWork, IApplicationSettingRepository applicationSettings, ICryptoService cryptoService)
        {
            if (this.syngentaSIPUnitOfWork == null)
            {
                this.syngentaSIPUnitOfWork = syngentaSIPUnitOfWork;
            }

            if (this.applicationSettings == null)
            {
                this.applicationSettings = applicationSettings;
            }

            if (this.cryptoService == null)
            {
                this.cryptoService = cryptoService;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationSettingManager"/> class.
 /// </summary>
 /// <param name="applicationSettingRepository">The application setting data.</param>
 public ApplicationSettingManager(IApplicationSettingRepository applicationSettingRepository)
 {
     this.applicationSettingRepository = applicationSettingRepository;
 }
Beispiel #9
0
        private static void ConfigureFacebookLogin(IAppBuilder app, string signInAsType, IApplicationSettingRepository applicationSettingRepository)
        {
            var facebookEnabled = applicationSettingRepository.GetOrCreateByName<bool>("ExternalProvider_Facebook_Enabled");
            if (facebookEnabled)
            {
                var facebookAppId = applicationSettingRepository.GetOrCreateByName<string>("ExternalProvider_Facebook_AppId"); 
                var facebookAppSecret = applicationSettingRepository.GetOrCreateByName<string>("ExternalProvider_Facebook_AppSecret");

                if (!string.IsNullOrWhiteSpace(facebookAppId) && !string.IsNullOrWhiteSpace(facebookAppSecret))
                {
                    var facebookOptions = new FacebookAuthenticationOptions
                    {
                        AppId = facebookAppId,
                        AppSecret = facebookAppSecret,
                        Caption = "Facebook",
                        SignInAsAuthenticationType = signInAsType,
                        AuthenticationType = "Facebook",
                        Provider = new FacebookAuthenticationProvider
                        {
                            OnAuthenticated = async context =>
                                {
                                    foreach (var claim in context.User)
                                    {
                                        switch (claim.Key)
                                        {
                                            case "first_name":
                                                context.Identity.AddClaim(new System.Security.Claims.Claim(Constants.ClaimTypes.GivenName, claim.Value.ToString(), "XmlSchemaString", "Facebook"));
                                                break;
                                            case "last_name":
                                                context.Identity.AddClaim(new System.Security.Claims.Claim(Constants.ClaimTypes.FamilyName, claim.Value.ToString(), "XmlSchemaString", "Facebook"));
                                                break;
                                        }
                                    }

                                    await Task.FromResult(false);
                                }
                        },
                        BackchannelHttpHandler = new FacebookBackChannelHandler(),
                        UserInformationEndpoint = "https://graph.facebook.com/v2.5/me?fields=id,name,email,first_name,last_name"
                    };
                    facebookOptions.Scope.Add("email");
                    facebookOptions.Scope.Add("public_profile");
                    app.UseFacebookAuthentication(facebookOptions);
                }
            }
        }
Beispiel #10
0
        private static void ConfigureGoogleLogin(IAppBuilder app, string signInAsType, IApplicationSettingRepository applicationSettingRepository)
        {
            var googleEnabled = applicationSettingRepository.GetOrCreateByName<bool>("ExternalProvider_Google_Enabled");
            if (googleEnabled)
            {
                var googleClientId = applicationSettingRepository.GetOrCreateByName<string>("ExternalProvider_Google_ClientId");
                var googleClientSecret = applicationSettingRepository.GetOrCreateByName<string>("ExternalProvider_Google_ClientSecret"); 

                if (!string.IsNullOrWhiteSpace(googleClientId) && !string.IsNullOrWhiteSpace(googleClientSecret))
                {
                    app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions
                    {
                        Caption = "Google",
                        ClientId = googleClientId,
                        ClientSecret = googleClientSecret,
                        SignInAsAuthenticationType = signInAsType,
                        AuthenticationType = "Google"
                    });
                }
            }
        }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserRepository" /> class.
 /// </summary>
 /// <param name="syngentaSIPContext">The syngenta sip context.</param>
 /// <param name="cryptoService">The crypto service.</param>
 /// <param name="applicationSettingRepository">The application setting repository.</param>
 public UserRepository(ISyngentaSIPContext syngentaSIPContext, ICryptoService cryptoService, IApplicationSettingRepository applicationSetting)
 {
     this.syngentaSIPContext  = syngentaSIPContext;
     this.cryptoService       = cryptoService;
     this.applicationSettings = applicationSetting;
 }
Beispiel #12
0
        private static void ConfigureFacebookLogin(IAppBuilder app, string signInAsType, IApplicationSettingRepository applicationSettingRepository)
        {
            var facebookEnabled = applicationSettingRepository.GetOrCreateByName <bool>("ExternalProvider_Facebook_Enabled");

            if (facebookEnabled)
            {
                var facebookAppId     = applicationSettingRepository.GetOrCreateByName <string>("ExternalProvider_Facebook_AppId");
                var facebookAppSecret = applicationSettingRepository.GetOrCreateByName <string>("ExternalProvider_Facebook_AppSecret");

                if (!string.IsNullOrWhiteSpace(facebookAppId) && !string.IsNullOrWhiteSpace(facebookAppSecret))
                {
                    var facebookOptions = new FacebookAuthenticationOptions
                    {
                        AppId     = facebookAppId,
                        AppSecret = facebookAppSecret,
                        Caption   = "Facebook",
                        SignInAsAuthenticationType = signInAsType,
                        AuthenticationType         = "Facebook",
                        Provider = new FacebookAuthenticationProvider
                        {
                            OnAuthenticated = async context =>
                            {
                                foreach (var claim in context.User)
                                {
                                    switch (claim.Key)
                                    {
                                    case "first_name":
                                        context.Identity.AddClaim(new System.Security.Claims.Claim(Constants.ClaimTypes.GivenName, claim.Value.ToString(), "XmlSchemaString", "Facebook"));
                                        break;

                                    case "last_name":
                                        context.Identity.AddClaim(new System.Security.Claims.Claim(Constants.ClaimTypes.FamilyName, claim.Value.ToString(), "XmlSchemaString", "Facebook"));
                                        break;
                                    }
                                }

                                await Task.FromResult(false);
                            }
                        },
                        BackchannelHttpHandler  = new FacebookBackChannelHandler(),
                        UserInformationEndpoint = "https://graph.facebook.com/v2.5/me?fields=id,name,email,first_name,last_name"
                    };
                    facebookOptions.Scope.Add("email");
                    facebookOptions.Scope.Add("public_profile");
                    app.UseFacebookAuthentication(facebookOptions);
                }
            }
        }
Beispiel #13
0
        private static void ConfigureGoogleLogin(IAppBuilder app, string signInAsType, IApplicationSettingRepository applicationSettingRepository)
        {
            var googleEnabled = applicationSettingRepository.GetOrCreateByName <bool>("ExternalProvider_Google_Enabled");

            if (googleEnabled)
            {
                var googleClientId     = applicationSettingRepository.GetOrCreateByName <string>("ExternalProvider_Google_ClientId");
                var googleClientSecret = applicationSettingRepository.GetOrCreateByName <string>("ExternalProvider_Google_ClientSecret");

                if (!string.IsNullOrWhiteSpace(googleClientId) && !string.IsNullOrWhiteSpace(googleClientSecret))
                {
                    app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions
                    {
                        Caption      = "Google",
                        ClientId     = googleClientId,
                        ClientSecret = googleClientSecret,
                        SignInAsAuthenticationType = signInAsType,
                        AuthenticationType         = "Google"
                    });
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationSettingData"/> class.
 /// </summary>
 /// <param name="applicationSettingRepository">The application setting repository.</param>
 public ApplicationSettingData(IApplicationSettingRepository applicationSettingRepository)
 {
     this.applicationSettingRepository = applicationSettingRepository;
 }
 public ApplicationSettingService(IApplicationSettingRepository applicationSettingRepository)
 {
     _applicationSettingRepository = applicationSettingRepository;
 }