private ListResult <IconListItem> GetIcon(int siteId) { ListResult <IconListItem> data = null; if (base.IsUseCache) { data = MemoryCacher.GetValue("SITE-ICON") as ListResult <IconListItem>; if (data != null) { return(data); } } IList <IconInfo> list = VShopHelper.GetAllIcon(ClientType.App); List <IconListItem> items = new List <IconListItem>(); if (list != null) { IconListItem item = null; foreach (var current in list) { item = new IconListItem(); item.Title = current.ShortDesc; item.ImageUrl = Util.AppendImageHost(current.ImageUrl); item.DisplaySequence = current.DisplaySequence; items.Add(item); } } data = new ListResult <IconListItem>(); data.TotalNumOfRecords = items.Count;; data.Results = items; if (base.IsUseCache) { MemoryCacher.Add("SITE-ICON", data, DateTimeOffset.UtcNow.AddMinutes(SITE_CACHE_KEEP_TIME)); } return(data); }
private void BindData() { this.grdIcon.DataSource = VShopHelper.GetAllIcon(ClientType.App); this.grdIcon.DataBind(); }