Esempio n. 1
0
        protected override void PageLoad()
        {
            base.PageLoad();

            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 10;
            int count    = 0;
            GroupBuySearchInfo groupBuySearch = new GroupBuySearchInfo();

            groupBuySearch.Status        = GroupBuyStatus.Normal;
            groupBuyList                 = GroupBuyBLL.ReadGroupBuyList(currentPage, pageSize, groupBuySearch, ref count);
            commonPagerClass.CurrentPage = currentPage;
            commonPagerClass.PageSize    = pageSize;
            commonPagerClass.Count       = count;
            commonPagerClass.FirstPage   = "<<首页";
            commonPagerClass.PreviewPage = "<<上一页";
            commonPagerClass.NextPage    = "下一页>>";
            commonPagerClass.LastPage    = "末页>>";
            commonPagerClass.ListType    = false;
            commonPagerClass.DisCount    = false;
            commonPagerClass.PrenextType = true;

            string productIDList = string.Empty;
            string idList        = string.Empty;

            foreach (GroupBuyInfo groupBuy in groupBuyList)
            {
                productIDList += "," + groupBuy.ProductID.ToString();
                idList        += "," + groupBuy.ID.ToString();
            }
            if (productIDList != string.Empty)
            {
                productIDList = productIDList.Substring(1);
            }
            if (idList != string.Empty)
            {
                idList = idList.Substring(1);
            }
            //读取商品
            if (productIDList != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductID = productIDList;
                productList = ProductBLL.SearchProductList(productSearch);
            }
            //读取购买人数
            if (idList != string.Empty)
            {
                dicCount = UserGroupBuyBLL.ReadUserGroupBuyCount(idList);
            }

            Title = "商品团购";
        }
Esempio n. 2
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void PageLoad()
        {
            base.PageLoad();

            int id = RequestHelper.GetQueryString <int>("ID");

            groupBuy = GroupBuyBLL.ReadGroupBuy(id);
            TimeSpan timeSpan = groupBuy.EndDate - RequestHelper.DateNow;

            leftTime = timeSpan.Days * 24 * 3600 + timeSpan.Hours * 3600 + timeSpan.Minutes * 60 + timeSpan.Seconds;
            buyCount = UserGroupBuyBLL.ReadUserGroupBuyCount(id);
            product  = ProductBLL.ReadProduct(groupBuy.ProductID);
            Title    = product.Name + " - 商品团购";

            int count = 0;
            GroupBuySearchInfo groupBuySearch = new GroupBuySearchInfo();

            groupBuySearch.Status = GroupBuyStatus.Normal;
            groupBuyList          = GroupBuyBLL.ReadGroupBuyList(1, 8, groupBuySearch, ref count);

            string productIDList = string.Empty;
            string idList        = string.Empty;

            foreach (GroupBuyInfo groupBuyInfo in groupBuyList)
            {
                if (productIDList == string.Empty)
                {
                    productIDList = groupBuyInfo.ProductID.ToString();
                    idList        = groupBuyInfo.ID.ToString();
                }
                else
                {
                    productIDList += "," + groupBuyInfo.ProductID.ToString();
                    idList        += "," + groupBuyInfo.ID.ToString();
                }
            }
            //读取商品
            if (productIDList != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductID = productIDList;
                productList = ProductBLL.SearchProductList(productSearch);
            }
        }