示例#1
0
        /// <summary>
        /// 获得投票选项数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <returns>投票选项数据列表</returns>
        public List <VoteItemInfo> ReadVoteItemListByVote(int currentPage, int pageSize, ref int count, string voteID, int voteItemID, int ascDesc)
        {
            List <VoteItemInfo> voteItemList = new List <VoteItemInfo>();
            ShopMssqlPagerClass pc           = new ShopMssqlPagerClass();

            pc.TableName   = "VoteItem";
            pc.Fields      = "[ID],[VoteID],[ItemName],[VoteCount],[OrderID],[Image],[Department],[Solution],[Point],[CoverDepartment],[Detail],[Exp1],[Exp2],[Exp3],[Exp4],[Exp5]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.MssqlCondition.Add("[VoteID]", voteID, ConditionType.Like);


            pc.OrderField = "[OrderID],[ID]";

            if (ascDesc == 1)
            {
                pc.OrderType = OrderType.Desc;
                pc.MssqlCondition.Add("[OrderID]", voteItemID, ConditionType.Less);
            }
            else
            {
                pc.OrderType = OrderType.Asc;
                pc.MssqlCondition.Add("[OrderID]", voteItemID, ConditionType.More);
            }

            pc.Count = count;
            count    = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareVoteItemModel(dr, voteItemList);
            }
            return(voteItemList);
        }
示例#2
0
        /// <summary>
        /// 获得投票选项数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <returns>投票选项数据列表</returns>
        public List <VoteItemInfo> ReadVoteItemList(int currentPage, int pageSize, ref int count, string orderType, int ascDesc)
        {
            List <VoteItemInfo> voteItemList = new List <VoteItemInfo>();
            ShopMssqlPagerClass pc           = new ShopMssqlPagerClass();

            pc.TableName   = "VoteItem";
            pc.Fields      = "[ID],[VoteID],[ItemName],[VoteCount],[OrderID],[Image],[Department],[Solution],[Point],[CoverDepartment],[Detail],[Exp1],[Exp2],[Exp3],[Exp4],[Exp5]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            if (string.IsNullOrEmpty(orderType))
            {
                pc.OrderField = "[ID]";
            }
            else
            {
                pc.OrderField = "[" + orderType + "]";
            }
            if (ascDesc == 1)
            {
                pc.OrderType = OrderType.Asc;
            }
            else
            {
                pc.OrderType = OrderType.Desc;
            }
            //pc.Count = count;
            count = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareVoteItemModel(dr, voteItemList);
            }
            return(voteItemList);
        }
示例#3
0
        /// <summary>
        /// 搜索缺货登记数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="bookingProductSearch">BookingProductSearchInfo模型变量</param>
        /// <param name="count">总数量</param>
        /// <returns>缺货登记数据列表</returns>
        public List <BookingProductInfo> SearchBookingProductList(int currentPage, int pageSize, BookingProductSearchInfo bookingProductSearch, ref int count)
        {
            List <BookingProductInfo> bookingProductList = new List <BookingProductInfo>();
            ShopMssqlPagerClass       pc = new ShopMssqlPagerClass();

            pc.TableName      = "ProductBooking";
            pc.Fields         = "[ID],[ProductID],[ProductName],[RelationUser],[Email],[Tel],[UserNote],[BookingDate],[BookingIP],[IsHandler],[HandlerDate],[HandlerAdminID],[HandlerAdminName],[HandlerNote],[UserID],[UserName]";
            pc.CurrentPage    = currentPage;
            pc.PageSize       = pageSize;
            pc.OrderField     = "[ID]";
            pc.OrderType      = OrderType.Desc;
            pc.MssqlCondition = PrepareCondition(bookingProductSearch);

            count = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareBookingProductModel(dr, bookingProductList);
            }
            return(bookingProductList);
        }
        /// <summary>
        /// 搜索邮件发送记录数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="emailSendRecordSearch">EmailSendRecordSearchInfo模型变量</param>
        /// <param name="count">总数量</param>
        /// <returns>邮件发送记录数据列表</returns>
        public List <EmailSendRecordInfo> SearchEmailSendRecordList(int currentPage, int pageSize, EmailSendRecordSearchInfo emailSendRecordSearch, ref int count)
        {
            List <EmailSendRecordInfo> emailSendRecordList = new List <EmailSendRecordInfo>();
            ShopMssqlPagerClass        pc = new ShopMssqlPagerClass();

            pc.TableName      = ShopMssqlHelper.TablePrefix + "EmailSendRecord";
            pc.Fields         = "[ID],[Title],[Content],[IsSystem],[EmailList],[OpenEmailList],[IsStatisticsOpendEmail],[SendStatus],[Note],[AddDate],[SendDate]";
            pc.CurrentPage    = currentPage;
            pc.PageSize       = pageSize;
            pc.OrderField     = "[ID]";
            pc.OrderType      = OrderType.Desc;
            pc.MssqlCondition = PrepareCondition(emailSendRecordSearch);
            pc.Count          = count;
            count             = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareEmailSendRecordModel(dr, emailSendRecordList);
            }
            return(emailSendRecordList);
        }
示例#5
0
        /// <summary>
        /// 获得投票记录数据列表
        /// </summary>
        /// <param name="voteID">分类ID</param>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <returns>投票记录数据列表</returns>
        public List <VoteRecordInfo> ReadVoteRecordList(int currentPage, int pageSize, VoteRecordSearchInfo searchInfo, ref int count)
        {
            List <VoteRecordInfo> voteRecordList = new List <VoteRecordInfo>();
            ShopMssqlPagerClass   pc             = new ShopMssqlPagerClass();

            pc.TableName   = "VoteRecord";
            pc.Fields      = "[ID],[VoteID],[ItemID],[UserIP],[AddDate],[UserID],[UserName]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.OrderField  = "[ID]";
            pc.OrderType   = OrderType.Desc;
            PrepareCondition(pc.MssqlCondition, searchInfo);
            pc.Count = count;
            count    = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareVoteRecordModel(dr, voteRecordList);
            }
            return(voteRecordList);
        }
示例#6
0
        /// <summary>
        /// 获得商品回复数据列表
        /// </summary>
        /// <param name="commentID">分类ID</param>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="count">总数量</param>
        /// <param name="userID">用户ID</param>
        /// <returns>商品回复数据列表</returns>
        public List <ProductReplyInfo> ReadProductReplyList(int commentID, int currentPage, int pageSize, ref int count, int userID)
        {
            List <ProductReplyInfo> productReplyList = new List <ProductReplyInfo>();
            ShopMssqlPagerClass     pc = new ShopMssqlPagerClass();

            pc.TableName   = ShopMssqlHelper.TablePrefix + "ProductReply";
            pc.Fields      = "[ID],[ProductID],[CommentID],[Content],[UserIP],[PostDate],[UserID],[UserName]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.OrderField  = "[ID]";
            pc.OrderType   = OrderType.Desc;
            pc.MssqlCondition.Add("[UserID]", userID, ConditionType.Equal);
            pc.MssqlCondition.Add("[CommentID]", commentID, ConditionType.Equal);
            pc.Count = count;
            count    = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                PrepareProductReplyModel(dr, productReplyList);
            }
            return(productReplyList);
        }
示例#7
0
        /// <summary>
        /// 搜索用户留言数据列表[~~~只显示允许展示案例的评论~~]
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="userMessageSearch">UserMessageSeachInfo模型变量</param>
        /// <param name="count">总数量</param>
        /// <returns>用户留言数据列表</returns>
        public List <UserMessageInfo> SearchUserMessageList1(int currentPage, int pageSize, UserMessageSeachInfo userMessageSearch, ref int count)
        {
            List <UserMessageInfo> userMessageList = new List <UserMessageInfo>();
            ShopMssqlPagerClass    pc = new ShopMssqlPagerClass();

            pc.TableName   = "(select a.* from UsrMessage a inner join voteitem b on a.[userid]=b.id and b.[exp2]='1' union all select c.* from UsrMessage c where c.[userid]=0) as tmp";
            pc.Fields      = "[Id], [MessageClass], [Title], [Content], [UserIP], [PostDate], [IsHandler], [AdminReplyContent], [AdminReplyDate], [UserId], [UserName],[Tel],[Email],[Gender],[Birthday],[Birthplace],[LivePlace],[Address],[Servedays],[Servemode],[AddCol1],[AddCol2]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            pc.OrderField  = "[Id]";
            pc.OrderType   = OrderType.Desc;
            PrepareCondition(userMessageSearch);
            //pc.Count = count;
            count = pc.Count;
            using (SqlDataReader dr = pc.ExecuteReader())
            {
                while (dr.Read())
                {
                    UserMessageInfo userMessage = new UserMessageInfo();
                    userMessage.Id                = dr.GetInt32(0);
                    userMessage.MessageClass      = dr.GetInt32(1);
                    userMessage.Title             = dr[2].ToString();
                    userMessage.Content           = dr[3].ToString();
                    userMessage.UserIP            = dr[4].ToString();
                    userMessage.PostDate          = dr.GetDateTime(5);
                    userMessage.IsHandler         = dr.GetInt32(6);
                    userMessage.AdminReplyContent = dr[7].ToString();
                    userMessage.AdminReplyDate    = dr.GetDateTime(8);
                    userMessage.UserId            = dr.GetInt32(9);
                    userMessage.UserName          = dr[10].ToString();
                    userMessage.Email             = dr[11].ToString();

                    userMessageList.Add(userMessage);
                }
                dr.Close();
            }
            return(userMessageList);
        }