public SAS.Common.Generic.List<TeamInfo> GetAllTeamList() { string commandText = string.Format("SELECT * FROM [{0}teamInfo] ORDER BY [createdate]", BaseConfigs.GetTablePrefix); IDataReader reader = DbHelper.ExecuteReader(CommandType.Text, commandText); SAS.Common.Generic.List<TeamInfo> tlist = new SAS.Common.Generic.List<TeamInfo>(); while (reader.Read()) { TeamInfo team = new TeamInfo(); team.TeamID = TypeConverter.ObjectToInt(reader["teamID"], 0); team.Name = reader["name"].ToString(); team.Teamdomain = reader["teamdomain"].ToString(); team.Templateid = TypeConverter.ObjectToInt(reader["templateid"].ToString(), 0); team.BuildDate = Utils.GetStandardDate(reader["builddate"].ToString()); team.CreateDate = Utils.GetStandardDate(reader["createdate"].ToString()); team.UpdateDate = Utils.GetStandardDate(reader["updatedate"].ToString()); team.Imgs = reader["imgs"].ToString(); team.Bio = reader["bio"].ToString(); team.Content1 = reader["content1"].ToString(); team.Content2 = reader["content2"].ToString(); team.Content3 = reader["content3"].ToString(); team.Content4 = reader["content4"].ToString(); team.Stutas = TypeConverter.ObjectToInt(reader["stutas"], 0); team.Pageviews = TypeConverter.ObjectToInt(reader["pageviews"], 0); team.Displayorder = TypeConverter.ObjectToInt(reader["displayorder"], 0); team.TeamMember = reader["teammember"].ToString(); team.Seokeywords = reader["seokeywords"].ToString(); team.Seodescription = reader["seodescription"].ToString(); team.Creater = reader["creater"].ToString(); tlist.Add(team); } reader.Close(); return tlist; }
/// <summary> /// 根据频道类别获取店铺信息 /// </summary> public static SAS.Common.Generic.List<ShopDetailInfo> GetTaoBaoShopListByRecommend(int chanel, int classid) { SAS.Common.Generic.List<ShopDetailInfo> shoplist = new SAS.Common.Generic.List<ShopDetailInfo>(); SAS.Cache.SASCache cache = SAS.Cache.SASCache.GetCacheService(); shoplist = cache.RetrieveObject("/SAS/ShopList/Chanel_" + chanel + "/Class_" + classid) as SAS.Common.Generic.List<ShopDetailInfo>; if (shoplist == null) { List<RecommendInfo> rlist = GetRecommendList(2, chanel, classid); string shopidlist = ""; foreach (RecommendInfo rinfo in rlist) { shopidlist += rinfo.ccontent + ","; } shoplist = GetTaoBaoShopListByIds(shopidlist.Trim().Trim(',')); cache.AddObject("/SAS/ShopList/Chanel_" + chanel + "/Class_" + classid, shoplist); } return shoplist; }
/// <summary> /// 根据推荐获取品牌信息集合 /// </summary> public static List<GoodsBrandInfo> GetGoodsBrandList(int chanel, int classid) { SAS.Common.Generic.List<GoodsBrandInfo> goodsbrandlist = new SAS.Common.Generic.List<GoodsBrandInfo>(); SAS.Cache.SASCache cache = SAS.Cache.SASCache.GetCacheService(); goodsbrandlist = cache.RetrieveObject("/SAS/BrandList/Chanel_" + chanel + "/Class_" + classid) as SAS.Common.Generic.List<GoodsBrandInfo>; //goodsbrandlist = SAS.Cache.WebCacheFactory.GetWebCache().Get("/SAS/BrandList/Chanel_" + chanel + "/Class_" + classid) as SAS.Common.Generic.List<GoodsBrandInfo>; if (goodsbrandlist == null) { List<RecommendInfo> rlist = GetRecommendList(4, chanel, classid); string shopidlist = ""; foreach (RecommendInfo rinfo in rlist) { shopidlist += rinfo.ccontent + ","; } if (shopidlist.Trim().Trim(',') == "") return new List<GoodsBrandInfo>(); goodsbrandlist = DTOProvider.GetGoodsBrandListEntity(GetGoodsBrandListByIds(shopidlist.Trim().Trim(','))); cache.AddObject("/SAS/BrandList/Chanel_" + chanel + "/Class_" + classid, goodsbrandlist); //SAS.Cache.WebCacheFactory.GetWebCache().Add("/SAS/BrandList/Chanel_" + chanel + "/Class_" + classid, goodsbrandlist); } return goodsbrandlist; }
/// <summary> /// 根据类别获取品牌信息集合 /// </summary> public static List<GoodsBrandInfo> GetGoodsBrandListByClass(int classid) { SAS.Common.Generic.List<GoodsBrandInfo> brandlist = new SAS.Common.Generic.List<GoodsBrandInfo>(); SAS.Cache.SASCache cache = SAS.Cache.SASCache.GetCacheService(); brandlist = cache.RetrieveObject("/SAS/GoodsBrand/Class_" + classid) as SAS.Common.Generic.List<GoodsBrandInfo>; //brandlist = SAS.Cache.WebCacheFactory.GetWebCache().Get("/SAS/GoodsBrand/Class_" + classid) as SAS.Common.Generic.List<GoodsBrandInfo>; if (brandlist == null) { brandlist = DTOProvider.GetGoodsBrandListEntity(Data.DbProvider.GetInstance().GetGoodsBrandListByClass(classid)); cache.AddObject("/SAS/GoodsBrand/Class_" + classid, brandlist); //SAS.Cache.WebCacheFactory.GetWebCache().Add("/SAS/GoodsBrand/Class_" + classid, brandlist); } return brandlist; }
public SAS.Common.Generic.List<AlbumCategoryInfo> GetAlbumCategory() { string commandText = string.Format("SELECT * FROM [{0}albumcategories] ORDER BY [displayorder]", BaseConfigs.GetTablePrefix); IDataReader reader = DbHelper.ExecuteReader(CommandType.Text, commandText); SAS.Common.Generic.List<AlbumCategoryInfo> acic = new SAS.Common.Generic.List<AlbumCategoryInfo>(); while (reader.Read()) { AlbumCategoryInfo aci = new AlbumCategoryInfo(); aci.Albumcateid = TypeConverter.ObjectToInt(reader["albumcateid"], 0); aci.Albumcount = TypeConverter.ObjectToInt(reader["albumcount"], 0); aci.Description = reader["description"].ToString(); aci.Displayorder = TypeConverter.ObjectToInt(reader["displayorder"], 0); aci.Title = reader["title"].ToString(); acic.Add(aci); } reader.Close(); return acic; }