Пример #1
0
        public static LdapField Load(int fieldId)
        {
            Ldap.CheckAccess();

            LdapField field = null;

            using (IDataReader reader = DbLdap.FieldGet(fieldId))
            {
                if (reader.Read())
                {
                    field = new LdapField();
                    field.Load(reader);
                }
            }
            return(field);
        }
Пример #2
0
        public static LdapSettings Load(int ldapId)
        {
            Ldap.CheckAccess();

            LdapSettings ldap = null;

            using (IDataReader reader = DbLdap.SettingsGet(ldapId))
            {
                if (reader.Read())
                {
                    ldap = new LdapSettings();

                    ldap.LdapId              = ldapId;
                    ldap.Title               = reader["Title"].ToString();
                    ldap.Domain              = reader["Domain"].ToString();
                    ldap.Username            = reader["Username"].ToString();
                    ldap.Password            = reader["Password"].ToString();
                    ldap.Filter              = reader["Filter"].ToString();
                    ldap.IbnKey              = reader["IbnKey"].ToString();
                    ldap.LdapKey             = reader["LdapKey"].ToString();
                    ldap.Activate            = (bool)reader["Activate"];
                    ldap.Deactivate          = (bool)reader["Deactivate"];
                    ldap.Autosync            = (bool)reader["Autosync"];
                    ldap.AutosyncStart       = (DateTime)reader["AutosyncStart"];
                    ldap.AutosyncInterval    = (int)reader["AutosyncInterval"];
                    ldap.LastSynchronization = DBCommon.NullToDateTime(reader["LastSynchronization"]);
                }
            }

            if (ldap != null)
            {
                using (IDataReader reader = DbLdap.FieldsGet(ldapId))
                {
                    while (reader.Read())
                    {
                        LdapField field = new LdapField();
                        field.Load(reader);
                        ldap.Fields.Add(field);
                    }
                }
            }

            return(ldap);
        }
Пример #3
0
        public static LdapSettings Load(int ldapId)
        {
            Ldap.CheckAccess();

            LdapSettings ldap = null;

            using(IDataReader reader = DbLdap.SettingsGet(ldapId))
            {
                if(reader.Read())
                {
                    ldap = new LdapSettings();

                    ldap.LdapId = ldapId;
                    ldap.Title = reader["Title"].ToString();
                    ldap.Domain = reader["Domain"].ToString();
                    ldap.Username = reader["Username"].ToString();
                    ldap.Password = reader["Password"].ToString();
                    ldap.Filter = reader["Filter"].ToString();
                    ldap.IbnKey = reader["IbnKey"].ToString();
                    ldap.LdapKey = reader["LdapKey"].ToString();
                    ldap.Activate = (bool)reader["Activate"];
                    ldap.Deactivate = (bool)reader["Deactivate"];
                    ldap.Autosync = (bool)reader["Autosync"];
                    ldap.AutosyncStart = (DateTime)reader["AutosyncStart"];
                    ldap.AutosyncInterval = (int)reader["AutosyncInterval"];
                    ldap.LastSynchronization = DBCommon.NullToDateTime(reader["LastSynchronization"]);
                }
            }

            if(ldap != null)
            {
                using(IDataReader reader = DbLdap.FieldsGet(ldapId))
                {
                    while(reader.Read())
                    {
                        LdapField field = new LdapField();
                        field.Load(reader);
                        ldap.Fields.Add(field);
                    }
                }
            }

            return ldap;
        }
Пример #4
0
        public static LdapField Load(int fieldId)
        {
            Ldap.CheckAccess();

            LdapField field = null;
            using(IDataReader reader = DbLdap.FieldGet(fieldId))
            {
                if(reader.Read())
                {
                    field = new LdapField();
                    field.Load(reader);
                }
            }
            return field;
        }