/// <summary>解析职级群组的值</summary> /// <returns></returns> private int ParseJobGradeValue(string groupId) { string key = string.Format("G{0}", groupId); MembershipConfiguration configuration = MembershipConfigurationView.Instance.Configuration; if (configuration.Keys["JobGradeMapping"] == null) { return(0); } Hashtable table = JsonHelper.ToHashtable(configuration.Keys["JobGradeMapping"].Value); foreach (DictionaryEntry entry in table) { if (entry.Key.ToString() == key) { try { return(Convert.ToInt32(entry.Value.ToString())); } catch { return(0); } } } return(0); }
public ComposableCouchDbMembershipProvider(MembershipConfiguration configuration, IMembershipFinder finder, IMembershipAction memberActions, IPasswordActions passwordActions) { _configuration = configuration; _finder = finder; _memberActions = memberActions; _passwordActions = passwordActions; }
/// <summary>构造函数</summary> public JobGradeProvider() { configuration = MembershipConfigurationView.Instance.Configuration; ibatisMapping = configuration.Keys["IBatisMapping"].Value; ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true); }
/// <summary>构造函数</summary> public StandardOrganizationUnitProvider() { configuration = MembershipConfigurationView.Instance.Configuration; ibatisMapping = configuration.Keys["IBatisMapping"].Value; this.ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true); }
/// <summary></summary> public MemberProvider() { this.configuration = MembershipConfigurationView.Instance.Configuration; this.ibatisMapping = configuration.Keys["IBatisMapping"].Value; this.ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true); }
/// <summary>构造函数</summary> public AccountLogService() { this.configuration = MembershipConfigurationView.Instance.Configuration; // 创建对象构建器(Spring.NET) string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value; SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(MembershipConfiguration.ApplicationName, springObjectFile); // ���������ṩ�� this.provider = objectBuilder.GetObject <IAccountLogProvider>(typeof(IAccountLogProvider)); }
/// <summary>构造函数</summary> public StandardOrganizationUnitService() { this.configuration = MembershipConfigurationView.Instance.Configuration; // 创建对象构建器(Spring.NET) string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value; SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(MembershipConfiguration.ApplicationName, springObjectFile); // 创建数据提供器 this.provider = objectBuilder.GetObject <IStandardOrganizationUnitProvider>(typeof(IStandardOrganizationUnitProvider)); }
private void GetMembershipConfigurationFromOverture() { if (_configuration != null) { return; } try { _configuration = _client.Send(new GetMembershipConfigurationRequest()); } catch (Exception ex) { if (ex is WebException || ex is WebServiceException) { throw new ConfigurationErrorsException("Unable to retrieve membership configuration.", ex); } throw; } }
public void Setup() { _mockClient = new Mock <IOvertureClient>(MockBehavior.Strict); _mockScopeProvider = new Mock <IScopeProvider>(); _mockScopeProvider.SetupGet(sp => sp.DefaultScope).Returns(FakeData.ScopeId); _composerHostMoq = new ComposerHostMoq(); _composerHostMoq.AutoMock.Provide(_mockClient.Object); _autofacDependencyResolverMoq = new AutofacDependencyResolverMoq(); _autofacDependencyResolverMoq.AutoMock.Provide(_mockScopeProvider.Object); _sut = new OvertureMembershipProvider(); _membershipConfig = new MembershipConfiguration() { EnablePasswordReset = true, EnablePasswordRetrieval = false, MaxInvalidPasswordAttempts = 0, MinRequiredNonAlphanumericCharacters = 1, MinRequiredPasswordLength = 6, PasswordAttemptWindow = 0, PasswordStrategy = MembershipPasswordStrategy.Hashed, PasswordStrengthRegularExpression = "", RequiresQuestionAndAnswer = false, RequiresUniqueEmail = true }; _mockClient.Setup(x => x.Send(It.IsAny <GetMembershipConfigurationRequest>())) .Returns(_membershipConfig); var config = new NameValueCollection { { "scope", FakeData.ScopeId } }; _sut.Initialize("overture", config); InjectProvider(System.Web.Security.Membership.Providers, _sut); }