public override SiteSettings GetDistributorSettings(string siteUrl)
        {
            SiteSettings settings         = null;
            DbCommand    sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_Settings WHERE LOWER(@SiteUrl) = LOWER(SiteUrl)");

            this.database.AddInParameter(sqlStringCommand, "SiteUrl", DbType.String, siteUrl);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (reader.Read())
                {
                    settings = SiteSettingsProvider.PopulateDistributorSettings(reader);
                }
                reader.Close();
            }
            return(settings);
        }
        public override SiteSettings GetDistributorSettings(int userId)
        {
            SiteSettings settings         = null;
            DbCommand    sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_Settings WHERE @UserId = UserId");

            this.database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, userId);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (reader.Read())
                {
                    settings = SiteSettingsProvider.PopulateDistributorSettings(reader);
                }
                reader.Close();
            }
            return(settings);
        }
Esempio n. 3
0
        public override SiteSettings GetDistributorSettings(int userId)
        {
            SiteSettings result = null;

            System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_Settings WHERE @UserId = UserId");
            this.database.AddInParameter(sqlStringCommand, "UserId", System.Data.DbType.Int32, userId);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (dataReader.Read())
                {
                    result = SiteSettingsProvider.PopulateDistributorSettings(dataReader);
                }
                dataReader.Close();
            }
            return(result);
        }
Esempio n. 4
0
        public override SiteSettings GetDistributorSettings(string siteUrl)
        {
            SiteSettings result = null;

            System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_Settings WHERE LOWER(@SiteUrl) = LOWER(SiteUrl)");
            this.database.AddInParameter(sqlStringCommand, "SiteUrl", System.Data.DbType.String, siteUrl);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (dataReader.Read())
                {
                    result = SiteSettingsProvider.PopulateDistributorSettings(dataReader);
                }
                dataReader.Close();
            }
            return(result);
        }
Esempio n. 5
0
        /// <summary>
        /// 获取分销站点设置
        /// </summary>
        /// <param name="siteUrl"></param>
        /// <returns></returns>
        public override SiteSettings GetDistributorSettings(int userId)
        {
            SiteSettings settings = null;

            DbCommand sqlStringCommand = database.GetSqlStringCommand("select * from distro_Settings where @UserId=UserId");

            database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, userId);

            using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
            {
                if (null != reader && reader.Read())
                {
                    settings = SiteSettingsProvider.PopulateDistributorSettings(reader);
                }
            }

            return(settings);
        }
Esempio n. 6
0
        /// <summary>
        /// 获取分销站点设置
        /// </summary>
        /// <param name="siteUrl"></param>
        /// <returns></returns>
        public override SiteSettings GetDistributorSettings(string siteUrl)
        {
            SiteSettings siteConfig = null;

            DbCommand sqlStringCommand = database.GetSqlStringCommand(@"select * from distro_Settings where lower(SiteUrl)=@SiteUrl or lower(SiteUrl2)=@SiteUrl");

            database.AddInParameter(sqlStringCommand, "SiteUrl", DbType.String, siteUrl.ToLower());

            using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
            {
                if (null != reader && reader.Read())
                {
                    siteConfig = SiteSettingsProvider.PopulateDistributorSettings(reader);
                }
            }

            return(siteConfig);
        }