Esempio n. 1
0
        /// <summary>
        /// 获得团购数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <returns>团购数据列表</returns>
        public static List <GroupBuyInfo> ReadGroupBuyList(int currentPage, int pageSize, ref int count)
        {
            List <GroupBuyInfo>      groupBuyList = new List <GroupBuyInfo>();
            GroupBuyAccessPagerClass pc           = new GroupBuyAccessPagerClass();

            pc.TableName   = GroupBuyAccessHelper.TablePrefix + "GroupBuy";
            pc.Fields      = "[ID],[Name],[Photo],[Description],[ProductID],[StartDate],[EndDate],[Price],[MinCount],[MaxCount],[EachNumber]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.OrderField  = "[ID]";
            pc.OrderType   = OrderType.Desc;
            pc.Count       = count;
            count          = pc.Count;
            using (OleDbDataReader dr = pc.ExecuteReader())
            {
                PrepareGroupBuyModel(dr, groupBuyList);
            }
            return(groupBuyList);
        }
Esempio n. 2
0
        /// <summary>
        /// 获得用户团购数据列表
        /// </summary>
        /// <param name="groupBuyID">分类ID</param>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <returns>用户团购数据列表</returns>
        public static List <UserGroupBuyInfo> ReadUserGroupBuyList(int groupBuyID, int currentPage, int pageSize, ref int count)
        {
            List <UserGroupBuyInfo>  userGroupBuyList = new List <UserGroupBuyInfo>();
            GroupBuyAccessPagerClass pc = new GroupBuyAccessPagerClass();

            pc.TableName   = GroupBuyAccessHelper.TablePrefix + "UserGroupBuy";
            pc.Fields      = "[ID],[GroupBuyID],[Date],[IP],[BuyCount],[OrderID],[UserID],[UserName],[Consignee],[RegionID],[Address],[ZipCode],[Tel],[Email],[Mobile]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.OrderField  = "[ID]";
            pc.OrderType   = OrderType.Desc;
            pc.AccessCondition.Add("[GroupBuyID]", groupBuyID, ConditionType.Equal);
            pc.Count = count;
            count    = pc.Count;
            using (OleDbDataReader dr = pc.ExecuteReader())
            {
                PrepareUserGroupBuyModel(dr, userGroupBuyList);
            }
            return(userGroupBuyList);
        }