Example #1
0
        private void BindList()
        {
            IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList(this.MaxNum);

            this.rptBrowsedProduct.DataSource = ProductBrowser.GetVistiedProducts(browedProductList);
            this.rptBrowsedProduct.DataBind();
        }
Example #2
0
        private void BindList(int skip)
        {
            if (this.rp_guest != null)
            {
                System.Collections.Generic.IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList((skip * this.maxNum) + this.MaxNum);

                int browedListCount = browedProductList.Count;
                if (browedListCount > (skip * this.maxNum) + this.MaxNum)
                {
                    int isRemove = browedListCount - this.maxNum;
                    while (isRemove > 0)
                    {
                        isRemove--;
                        browedProductList.RemoveAt(0);
                    }
                }
                else
                {
                    browedProductList.Clear();
                }
                //DataTable table = ProductBrowser.GetSuggestProductsProducts(browedProductList, 6);
                DataTable table = ProductBrowser.GetVistiedProducts(browedProductList);
                if (table != null)
                {
                    if (table.Rows.Count < this.maxNum)
                    {
                        DataTable dt = ProductBrowser.GetVistiedProducts(this.MaxNum - table.Rows.Count, skip * this.maxNum + 1, skip * this.maxNum + 1 + this.MaxNum);
                        TableToTable(table, dt);
                    }
                }
                else
                {
                    table = ProductBrowser.GetVistiedProducts(this.MaxNum, skip * this.maxNum + 1, skip * this.maxNum + 1 + this.MaxNum);
                }

                if (table.Rows.Count < 5)
                {
                    this.rp_guest.DataSource = null;
                    this.rp_guest.DataBind();
                    return;
                }
                this.rp_guest.DataSource = table;
                this.rp_guest.DataBind();
            }
        }
Example #3
0
 private void BindList()
 {
     if (this.rp_guest != null)
     {
         System.Collections.Generic.IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList(this.MaxNum);
         DataTable table = ProductBrowser.GetVistiedProducts(browedProductList);
         if (table != null)
         {
             if (table.Rows.Count < this.MaxNum)
             {
                 DataTable dt = ProductBrowser.GetVistiedProducts(this.MaxNum - table.Rows.Count, 1, this.MaxNum);
                 TableToTable(table, dt);
             }
         }
         else
         {
             table = ProductBrowser.GetVistiedProducts(this.MaxNum, 1, this.MaxNum);
         }
         this.rp_guest.DataSource = table;
         this.rp_guest.DataBind();
     }
 }
 private void BindList()
 {
     if (this.rp_guest != null)
     {
         IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList(this.MaxNum);
         this.rp_guest.DataSource = ProductBrowser.GetVistiedProducts(browedProductList);
         this.rp_guest.DataBind();
     }
     if (this.rp_hot != null)
     {
         this.rp_hot.DataSource = ProductBrowser.GetSaleProductRanking(0, this.maxNum);
         this.rp_hot.DataBind();
     }
     if (this.rp_new != null)
     {
         SubjectListQuery subjectListQuery = new SubjectListQuery();
         subjectListQuery.MaxNum = this.maxNum;
         subjectListQuery.SortBy = "DisplaySequence";
         this.rp_new.DataSource  = ProductBrowser.GetSubjectList(subjectListQuery);
         this.rp_new.DataBind();
     }
 }
Example #5
0
 private void BindList()
 {
     if (this.rp_guest != null)
     {
         System.Collections.Generic.IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList(this.MaxNum);
         this.rp_guest.DataSource = ProductBrowser.GetSuggestProductsProducts(browedProductList, 5);
         //this.rp_guest.DataSource = ProductBrowser.GetVistiedProducts(browedProductList, ClientType.PC);
         this.rp_guest.DataBind();
     }
     if (this.rp_hot != null)
     {
         this.rp_hot.DataSource = ProductBrowser.GetSaleProductRanking(new int?(0), this.maxNum);
         this.rp_hot.DataBind();
     }
     if (this.rp_new != null)
     {
         SubjectListQuery subjectListQuery = new SubjectListQuery();
         subjectListQuery.MaxNum = this.maxNum;
         subjectListQuery.SortBy = "DisplaySequence";
         this.rp_new.DataSource  = ProductBrowser.GetSubjectList(subjectListQuery);
         this.rp_new.DataBind();
     }
 }
Example #6
0
        protected override void AttachChildControls()
        {
            this.setting = SettingsManager.GetMasterSettings();
            if (this.setting.OpenMultStore)
            {
                this.Page.Response.Redirect("StoreShoppingCart.aspx", true);
            }
            this.rptCartGifts   = (WapTemplatedRepeater)this.FindControl("rptCartGifts");
            this.litTotal       = (Literal)this.FindControl("litTotal");
            this.rp_guest       = (Repeater)this.FindControl("rp_guest");
            this.hidUserPoints  = (HtmlInputHidden)this.FindControl("hidUserPoints");
            this.hidIsOpenStore = (HtmlInputHidden)this.FindControl("hidIsOpenStore");
            this.cartProducts   = (HtmlGenericControl)this.FindControl("cartProducts");
            this.rptSupplier    = (Repeater)this.FindControl("rptSupplier");
            ShoppingCartInfo mobileShoppingCart = ShoppingCartProcessor.GetMobileShoppingCart(null, false, true, -1);

            if (mobileShoppingCart != null)
            {
                this.ListCartItems = mobileShoppingCart.LineItems;
                IOrderedEnumerable <ShoppingCartItemInfo> orderedEnumerable = from x in this.listCartItems
                                                                              where (!x.IsValid || !x.HasEnoughStock) && x.StoreId == 0
                                                                              orderby x.IsValid descending
                                                                              select x;
                if (orderedEnumerable != null && orderedEnumerable.Count() > 0)
                {
                    this.invalidSupplierId = this.listCartItems.Max((ShoppingCartItemInfo x) => x.SupplierId) + 100;
                    foreach (ShoppingCartItemInfo item in orderedEnumerable)
                    {
                        item.SupplierId   = this.invalidSupplierId;
                        item.SupplierName = "";
                    }
                }
                var orderedEnumerable2 = from x in this.listCartItems
                                         where x.IsValid && x.HasEnoughStock && x.StoreId == 0
                                         group x by new
                {
                    x.SupplierId,
                    x.SupplierName
                } into x
                orderby x.Key.SupplierId
                select x;
                if (this.listsupplier == null)
                {
                    this.listsupplier = new List <SupplierInfo>();
                }
                foreach (var item2 in orderedEnumerable2)
                {
                    SupplierInfo supplierInfo = new SupplierInfo();
                    supplierInfo.SupplierId   = item2.Key.SupplierId;
                    supplierInfo.SupplierName = item2.Key.SupplierName;
                    this.listsupplier.Add(supplierInfo);
                }
                this.rptSupplier.ItemDataBound += this.rptSupplier_ItemDataBound;
                this.rptSupplier.DataSource     = orderedEnumerable2;
                this.rptSupplier.DataBind();
                WapTemplatedRepeater wapTemplatedRepeater = (WapTemplatedRepeater)this.FindControl("rptCartProducts_Invalid");
                if (wapTemplatedRepeater != null)
                {
                    wapTemplatedRepeater.ItemDataBound += this.rptCartProducts_ItemDataBound;
                    wapTemplatedRepeater.DataSource     = orderedEnumerable;
                    wapTemplatedRepeater.DataBind();
                }
                this.litTotal.Text = "0.00";
                if (mobileShoppingCart.LineGifts.Count > 0)
                {
                    IEnumerable <ShoppingCartGiftInfo> dataSource = from s in mobileShoppingCart.LineGifts
                                                                    where s.PromoType == 0
                                                                    select s;
                    this.rptCartGifts.DataSource = dataSource;
                    this.rptCartGifts.DataBind();
                }
                if (mobileShoppingCart.LineItems.Count > 0 || mobileShoppingCart.LineGifts.Count > 0)
                {
                    IEnumerable <ShoppingCartItemInfo> source = from x in mobileShoppingCart.LineItems
                                                                where x.StoreId == 0
                                                                select x;
                    IEnumerable <ShoppingCartGiftInfo> source2 = from s in mobileShoppingCart.LineGifts
                                                                 where s.PromoType == 0
                                                                 select s;
                    if (source.Count() > 0 || source2.Count() > 0)
                    {
                        this.cartProducts.Visible = true;
                    }
                }
            }
            if (this.rp_guest != null)
            {
                IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList(10);
                this.rp_guest.DataSource = ProductBrowser.GetVistiedProducts(browedProductList);
                this.rp_guest.DataBind();
            }
            if (HiContext.Current.UserId > 0)
            {
                this.hidUserPoints.Value = HiContext.Current.User.Points.ToString();
            }
            this.hidIsOpenStore.Value = (this.setting.IsOpenPickeupInStore ? "true" : "false");
            PageTitle.AddSiteNameTitle("购物车");
            Repeater repeater = new Repeater();
        }