コード例 #1
0
 private void BindList()
 {
     gvList.DataSource = CommDataHelper.GetDataFromSingleTableByPage(SearPageInfo);
     gvList.DataBind();
     pageNav.CurrentPageIndex = SearPageInfo.PageIndex;
     pageNav.PageSize         = SearPageInfo.PageSize;
     pageNav.RecordCount      = SearPageInfo.TotalItem;
 }
コード例 #2
0
        private void BindList()
        {
            DataSet ds = CommDataHelper.GetDataFromSingleTableByPage(SearPageInfo);

            rpProducts.DataSource = ds.Tables[0];
            rpProducts.DataBind();
            //panNoResult.Visible = ds.Tables[0].Rows.Count == 0;

            pageNav.CurrentPageIndex = SearPageInfo.PageIndex;
            pageNav.PageSize         = SearPageInfo.PageSize;
            pageNav.RecordCount      = SearPageInfo.TotalItem;
        }
コード例 #3
0
        public DataTable GetProductList(int CategoryID, int PageIndex, int BrandID, decimal[] PriceRange, int OrderType, out int RecordCount, out int PageCount)
        {
            SearchPageInfo pageinfo = new SearchPageInfo();

            string CategoryPath = Convert.ToString(GetCategoryInfo(CategoryID)["catepath"]);

            string where = String.Format(" catepath like '{0}%'", CategoryPath);
            where       += " and status = " + (int)ProductStatus.架;

            if (BrandID != 0)
            {
                where += " and pdproduct.brandid=" + BrandID;
            }
            if (PriceRange != null && PriceRange.Length == 2)
            {
                if (PriceRange[1] == 0)
                {
                    where += String.Format(" and pdproduct.merchantprice >= {0} ", PriceRange[0]);
                }
                else
                {
                    where += String.Format(" and pdproduct.merchantprice >= {0} and pdproduct.merchantprice <= {1}", PriceRange[0], PriceRange[1] + 0.99M);
                }
            }


            pageinfo.FieldNames    = "[ProductId],[ProductName],[ProductCode],[CatePath],[CateId],[TradePrice],[MerchantPrice],[ReducePrice],[Stock],[SmallImage],[MediumImage],[LargeImage],[Keywords],[Brief],[PageView],[InsertTime],[ChangeTime],[Status],[SortValue],[Score]";
            pageinfo.OrderType     = "SortValue asc";
            pageinfo.PageIndex     = PageIndex;
            pageinfo.PageSize      = Config.ListPageSize;
            pageinfo.PriKeyName    = "ProductId";
            pageinfo.StrWhere      = where;
            pageinfo.TableName     = "pdproduct";
            pageinfo.OrderType     = GetOrderString(OrderType);
            pageinfo.TotalFieldStr = "";
            pageinfo.TotalItem     = 0;
            pageinfo.TotalPage     = 0;

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(pageinfo).Tables[0];

            RecordCount = pageinfo.TotalItem;
            PageCount   = pageinfo.TotalPage;

            return(dt);
        }
コード例 #4
0
        public DataTable GetList(int PageIndex, int PageSize, string Condition, out int RecordCount)
        {
            SearchPageInfo info = new SearchPageInfo();

            info.FieldNames    = "*";
            info.OrderType     = " newsid desc";
            info.PageIndex     = PageIndex;
            info.PageSize      = PageSize;
            info.PriKeyName    = "newsid";
            info.StrJoin       = "";
            info.StrWhere      = " 1=1 " + Condition;
            info.TableName     = "nenews";
            info.TotalFieldStr = "";

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(info).Tables[0];

            RecordCount = info.TotalItem;

            return(dt);
        }
コード例 #5
0
        public DataSet GetList(int PageIndex, int PageSize, string Condition, out int RecordCount)
        {
            SearchPageInfo info = new SearchPageInfo();

            info.FieldNames = "*";
            info.OrderType = " showorder desc";
            info.PageIndex = PageIndex;
            info.PageSize = PageSize;
            info.PriKeyName = "brandid";
            info.StrJoin = "";
            info.StrWhere = " 1=1 " + Condition;
            info.TableName = "pdbrand";
            info.TotalFieldStr = "";

            DataSet ds = CommDataHelper.GetDataFromSingleTableByPage(info);

            RecordCount = info.TotalItem;

            return ds;
        }
コード例 #6
0
        public DataTable GetNewsList(int PageIndex, int PageSize, int CategoryID, out int RecordCount, out int PageCount)
        {
            SearchPageInfo pageinfo = new SearchPageInfo();

            string where = String.Format(" dbo.GetNewsCategoryPath(cateid)+'/' like dbo.GetNewsCategoryPath({0})+'/%'", CategoryID);

            pageinfo.FieldNames    = "*";
            pageinfo.OrderType     = "newsid desc";
            pageinfo.PageIndex     = PageIndex;
            pageinfo.PageSize      = PageSize;
            pageinfo.PriKeyName    = "newsid";
            pageinfo.StrWhere      = where;
            pageinfo.TableName     = "nenews";
            pageinfo.TotalFieldStr = "";
            pageinfo.TotalItem     = 0;
            pageinfo.TotalPage     = 0;

            DataTable dt = CommDataHelper.GetDataFromSingleTableByPage(pageinfo).Tables[0];

            RecordCount = pageinfo.TotalItem;
            PageCount   = pageinfo.TotalPage;

            return(dt);
        }