Exemplo n.º 1
0
        private ListResult <SupplierConfigItem> GetHotSale(int supplierId)
        {
            ListResult <SupplierConfigItem> data = null;

            IList <HotSaleInfo> list = VShopHelper.GetAllHotSale(ClientType.App, supplierId);

            List <SupplierConfigItem> items = new List <SupplierConfigItem>();

            if (list != null)
            {
                SupplierConfigItem item = null;

                foreach (var current in list)
                {
                    item = new SupplierConfigItem();

                    item.Id              = current.BannerId;
                    item.Title           = current.ShortDesc;
                    item.ImageUrl        = Util.AppendImageHost(current.ImageUrl);
                    item.Type            = (int)current.LocationType;
                    item.Values          = current.Url;
                    item.DisplaySequence = current.DisplaySequence;
                    item.SupplierId      = supplierId;

                    items.Add(item);
                }
            }

            data = new ListResult <SupplierConfigItem>();
            data.TotalNumOfRecords = items.Count;;
            data.Results           = items;

            return(data);
        }
Exemplo n.º 2
0
        private ListResult <PlateListItem> GetHotSale(int siteId)
        {
            ListResult <PlateListItem> data = null;

            if (base.IsUseCache)
            {
                data = MemoryCacher.GetValue("SITE-HOTSALE") as ListResult <PlateListItem>;

                if (data != null)
                {
                    return(data);
                }
            }

            IList <HotSaleInfo> list = VShopHelper.GetAllHotSale(ClientType.App);

            List <PlateListItem> items = new List <PlateListItem>();

            if (list != null)
            {
                PlateListItem item = null;

                foreach (var current in list)
                {
                    item = new PlateListItem();

                    item.Id              = current.BannerId;
                    item.Title           = current.ShortDesc;
                    item.ImageUrl        = Util.AppendImageHost(current.ImageUrl);
                    item.NavigationType  = (int)current.LocationType;
                    item.Values          = current.Url;
                    item.DisplaySequence = current.DisplaySequence;

                    items.Add(item);
                }
            }

            data = new ListResult <PlateListItem>();
            data.TotalNumOfRecords = items.Count;;
            data.Results           = items;

            if (base.IsUseCache)
            {
                MemoryCacher.Add("SITE-HOTSALE", data, DateTimeOffset.UtcNow.AddMinutes(SITE_CACHE_KEEP_TIME));
            }

            return(data);
        }
Exemplo n.º 3
0
 private void BindData()
 {
     this.grdHotSale.DataSource = VShopHelper.GetAllHotSale(ClientType.WAP);
     this.grdHotSale.DataBind();
 }
Exemplo n.º 4
0
 private void BindData()
 {
     this.grdHotSale.DataSource = VShopHelper.GetAllHotSale(ClientType.PC, CheckSupplierRole());
     this.grdHotSale.DataBind();
 }