Esempio n. 1
0
        /// <summary>
        /// 获取广告位置信息集合
        /// </summary>
        /// <param name="catalog">广告栏目</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.AdvStructure.AdvPositionInfo> GetPositions(EyouSoft.Model.AdvStructure.AdvCatalog catalog)
        {
            string cachename = string.Format(EyouSoft.CacheTag.Adv.SystemAdvPostion, catalog.ToString());
            IList <EyouSoft.Model.AdvStructure.AdvPositionInfo> positions = (IList <EyouSoft.Model.AdvStructure.AdvPositionInfo>)EyouSoft.Cache.Facade.EyouSoftCache.GetCache(cachename);

            if (positions != null)
            {
                return(positions);
            }
            else
            {
                positions = dal.GetPositions(catalog);
                EyouSoft.Cache.Facade.EyouSoftCache.Add(cachename, positions);
                return(positions);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取广告位置信息集合
        /// </summary>
        /// <param name="catalog">广告栏目</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.AdvStructure.AdvPositionInfo> GetPositions(EyouSoft.Model.AdvStructure.AdvCatalog catalog)
        {
            IList <EyouSoft.Model.AdvStructure.AdvPositionInfo> positions = new List <EyouSoft.Model.AdvStructure.AdvPositionInfo>();
            DbCommand cmd = base.SystemStore.GetSqlStringCommand(SQL_SELECT_GetPositions);

            base.SystemStore.AddInParameter(cmd, "Catalog", DbType.Int32, catalog);

            using (IDataReader rdr = DbHelper.ExecuteReader(cmd, base.SystemStore))
            {
                while (rdr.Read())
                {
                    EyouSoft.Model.AdvStructure.AdvPositionInfo tmp = new EyouSoft.Model.AdvStructure.AdvPositionInfo();

                    tmp.AdvCount    = rdr.GetInt32(rdr.GetOrdinal("AdvCount"));
                    tmp.Catalog     = (EyouSoft.Model.AdvStructure.AdvCatalog)rdr.GetInt32(rdr.GetOrdinal("CatalogId"));
                    tmp.DisplayType = (EyouSoft.Model.AdvStructure.AdvDisplayType)rdr.GetByte(rdr.GetOrdinal("DisplayType"));
                    tmp.Position    = (EyouSoft.Model.AdvStructure.AdvPosition)rdr.GetInt32(rdr.GetOrdinal("AreaId"));

                    positions.Add(tmp);
                }
            }

            return(positions);
        }