Esempio n. 1
0
        /// <summary>
        /// 读取一条商品回复数据
        /// </summary>
        /// <param name="id">商品回复的主键值</param>
        /// <param name="userID">用户ID</param>
        /// <returns>商品回复数据模型</returns>
        public ProductReplyInfo ReadProductReply(int id, int userID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",     SqlDbType.NVarChar),
                new SqlParameter("@userID", SqlDbType.Int)
            };
            parameters[0].Value = id;
            parameters[1].Value = userID;
            ProductReplyInfo productReply = new ProductReplyInfo();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadProductReply", parameters))
            {
                if (dr.Read())
                {
                    productReply.ID        = dr.GetInt32(0);
                    productReply.ProductID = dr.GetInt32(1);
                    productReply.CommentID = dr.GetInt32(2);
                    productReply.Content   = dr[3].ToString();
                    productReply.UserIP    = dr[4].ToString();
                    productReply.PostDate  = dr.GetDateTime(5);
                    productReply.UserID    = dr.GetInt32(6);
                    productReply.UserName  = dr[7].ToString();
                }
            }
            return(productReply);
        }
Esempio n. 2
0
        /// <summary>
        /// 读取一条缺货登记数据
        /// </summary>
        /// <param name="id">缺货登记的主键值</param>
        /// <param name="userID">用户ID</param>
        /// <returns>缺货登记数据模型</returns>
        public BookingProductInfo ReadBookingProduct(int id, int userID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",     SqlDbType.Int),
                new SqlParameter("@userID", SqlDbType.Int)
            };
            parameters[0].Value = id;
            parameters[1].Value = userID;
            BookingProductInfo bookingProduct = new BookingProductInfo();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadBookingProduct", parameters))
            {
                if (dr.Read())
                {
                    bookingProduct.ID               = dr.GetInt32(0);
                    bookingProduct.ProductID        = dr.GetInt32(1);
                    bookingProduct.ProductName      = dr[2].ToString();
                    bookingProduct.RelationUser     = dr[3].ToString();
                    bookingProduct.Email            = dr[4].ToString();
                    bookingProduct.Tel              = dr[5].ToString();
                    bookingProduct.UserNote         = dr[6].ToString();
                    bookingProduct.BookingDate      = dr.GetDateTime(7);
                    bookingProduct.BookingIP        = dr[8].ToString();
                    bookingProduct.IsHandler        = dr.GetInt32(9);
                    bookingProduct.HandlerDate      = dr.GetDateTime(10);
                    bookingProduct.HandlerAdminID   = dr.GetInt32(11);
                    bookingProduct.HandlerAdminName = dr[12].ToString();
                    bookingProduct.HandlerNote      = dr[13].ToString();
                    bookingProduct.UserID           = dr.GetInt32(14);
                    bookingProduct.UserName         = dr[15].ToString();
                }
            }
            return(bookingProduct);
        }
Esempio n. 3
0
        /// <summary>
        /// 读取符合要求的ID串
        /// </summary>
        /// <param name="strID">缺货登记的主键值,以,号分隔</param>
        /// <param name="userID">用户ID</param>
        /// <returns>缺货登记的主键值,以,号分隔</returns>
        public string ReadBookingProductIDList(string strID, int userID)
        {
            string idList = string.Empty;

            SqlParameter[] parameters =
            {
                new SqlParameter("@strID",  SqlDbType.NVarChar),
                new SqlParameter("@userID", SqlDbType.Int)
            };
            parameters[0].Value = strID;
            parameters[1].Value = userID;
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadBookingProductIDList", parameters))
            {
                while (dr.Read())
                {
                    if (idList == string.Empty)
                    {
                        idList = dr.GetInt32(0).ToString();
                    }
                    else
                    {
                        idList += "," + dr.GetInt32(0).ToString();
                    }
                }
            }
            return(idList);
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="voteRecord"></param>
        public VoteRecordInfo ReadVoteHistoryRecord(int voteID, string ip, string itemID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@voteID", SqlDbType.NVarChar),
                new SqlParameter("@ip",     SqlDbType.NVarChar),
                new SqlParameter("@itemID", SqlDbType.NVarChar)
            };
            parameters[0].Value = voteID;
            parameters[1].Value = ip;
            parameters[2].Value = itemID;
            VoteRecordInfo voteRecord = new VoteRecordInfo();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadVoteHistoryRecord", parameters))
            {
                if (dr.Read())
                {
                    voteRecord.ID       = dr.GetInt32(0);
                    voteRecord.VoteID   = dr[1].ToString();
                    voteRecord.ItemID   = dr[2].ToString();
                    voteRecord.UserIP   = dr[3].ToString();
                    voteRecord.AddDate  = dr.GetDateTime(4);
                    voteRecord.UserID   = dr.GetInt32(5);
                    voteRecord.UserName = dr[6].ToString();
                }
            }
            return(voteRecord);
        }
        /// <summary>
        /// 读取一条邮件发送记录数据
        /// </summary>
        /// <param name="id">邮件发送记录的主键值</param>
        /// <returns>邮件发送记录数据模型</returns>
        public EmailSendRecordInfo ReadEmailSendRecord(int id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int)
            };
            parameters[0].Value = id;
            EmailSendRecordInfo emailSendRecord = new EmailSendRecordInfo();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadEmailSendRecord", parameters))
            {
                if (dr.Read())
                {
                    emailSendRecord.ID                     = dr.GetInt32(0);
                    emailSendRecord.Title                  = dr[1].ToString();
                    emailSendRecord.Content                = dr[2].ToString();
                    emailSendRecord.IsSystem               = dr.GetInt32(3);
                    emailSendRecord.EmailList              = dr[4].ToString();
                    emailSendRecord.OpenEmailList          = dr[5].ToString();
                    emailSendRecord.IsStatisticsOpendEmail = dr.GetInt32(6);
                    emailSendRecord.SendStatus             = dr.GetInt32(7);
                    emailSendRecord.Note                   = dr[8].ToString();
                    emailSendRecord.AddDate                = dr.GetDateTime(9);
                    emailSendRecord.SendDate               = dr.GetDateTime(10);
                }
            }
            return(emailSendRecord);
        }
Esempio n. 6
0
        /// <summary>
        /// 获得地区所有数据列表
        /// </summary>
        /// <returns>地区的所有数据列表</returns>
        public List <RegionInfo> ReadRegionAllList()
        {
            List <RegionInfo> regionList = new List <RegionInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadRegionAllList"))
            {
                PrepareRegionModel(dr, regionList);
            }
            return(regionList);
        }
Esempio n. 7
0
        /// <summary>
        /// 获得链接的所有数据列表
        /// </summary>
        /// <returns>链接的所有数据列表</returns>
        public List <LinkInfo> ReadLinkAllList()
        {
            List <LinkInfo> linkList = new List <LinkInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadLinkAllList"))
            {
                PrepareLinkModel(dr, linkList);
            }
            return(linkList);
        }
Esempio n. 8
0
        /// <summary>
        /// 获得菜单所有数据列表
        /// </summary>
        /// <returns>菜单的所有数据列表</returns>
        public List <MenuInfo> ReadMenuAllList()
        {
            List <MenuInfo> MenuList = new List <MenuInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadMenuAllList"))
            {
                PrepareMenuModel(dr, MenuList);
            }
            return(MenuList);
        }
Esempio n. 9
0
        /// <summary>
        /// 投过票的记录
        /// </summary>
        /// <param name="VoteItemID">投票项目ID</param>
        /// <param name="IpAddress">投票IP</param>
        /// <returns></returns>
        public List <VoteRecordInfo> HasVotedList(int VoteItemID, string IpAddress)
        {
            List <VoteRecordInfo> voteRecordList = new List <VoteRecordInfo>();

            SqlParameter[] sps = { new SqlParameter("@voteItemID", VoteItemID), new SqlParameter("@ipAddress", IpAddress) };
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "HasVoted", sps))
            {
                PrepareVoteRecordModel(dr, voteRecordList);
            }
            return(voteRecordList);
        }
Esempio n. 10
0
        /// <summary>
        /// 是否投过票
        /// </summary>
        /// <param name="VoteItemID">投票项目ID</param>
        /// <param name="IpAddress">投票IP</param>
        /// <returns></returns>
        public bool HasVoted(int VoteItemID, string IpAddress)
        {
            bool result = false;

            SqlParameter[] sps = { new SqlParameter("@voteItemID", VoteItemID), new SqlParameter("@ipAddress", IpAddress) };
            SqlDataReader  dr  = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "HasVoted", sps);

            if (dr.HasRows)
            {
                result = true;
            }
            return(result);
        }
Esempio n. 11
0
        /// <summary>
        /// 按分类ID获得会员价格所有数据
        /// </summary>
        /// <param name="productID">分类ID</param>
        /// <returns>会员价格数据列表</returns>
        public List <MemberPriceInfo> ReadMemberPriceByProduct(int productID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@productID", SqlDbType.Int)
            };
            parameters[0].Value = productID;
            List <MemberPriceInfo> memberPriceList = new List <MemberPriceInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadMemberPriceByProduct", parameters))
            {
                PrepareMemberPriceModel(dr, memberPriceList);
            }
            return(memberPriceList);
        }
Esempio n. 12
0
        /// <summary>
        /// 搜索缺货登记数据列表
        /// </summary>
        /// <param name="bookingProductSearch">BookingProductSearchInfo模型变量</param>
        /// <returns>缺货登记数据列表</returns>
        public List <BookingProductInfo> SearchBookingProductList(BookingProductSearchInfo bookingProductSearch)
        {
            string condition = PrepareCondition(bookingProductSearch).ToString();
            List <BookingProductInfo> bookingProductList = new List <BookingProductInfo>();

            SqlParameter[] parameters =
            {
                new SqlParameter("@condition", SqlDbType.NVarChar)
            };
            parameters[0].Value = condition;
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchBookingProductList", parameters))
            {
                PrepareBookingProductModel(dr, bookingProductList);
            }
            return(bookingProductList);
        }
Esempio n. 13
0
        /// <summary>
        /// 搜索邮件发送记录数据列表
        /// </summary>
        /// <param name="emailSendRecordSearch">EmailSendRecordSearchInfo模型变量</param>
        /// <returns>邮件发送记录数据列表</returns>
        public List <EmailSendRecordInfo> SearchEmailSendRecordList(EmailSendRecordSearchInfo emailSendRecordSearch)
        {
            string condition = PrepareCondition(emailSendRecordSearch).ToString();
            List <EmailSendRecordInfo> emailSendRecordList = new List <EmailSendRecordInfo>();

            SqlParameter[] parameters =
            {
                new SqlParameter("@condition", SqlDbType.NVarChar)
            };
            parameters[0].Value = condition;
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchEmailSendRecordList", parameters))
            {
                PrepareEmailSendRecordModel(dr, emailSendRecordList);
            }
            return(emailSendRecordList);
        }
Esempio n. 14
0
        /// <summary>
        /// 按分类ID和会员等级获得会员价格所有数据
        /// </summary>
        /// <param name="strProductID">分类ID</param>
        /// <param name="gradeID">会员等级ID</param>
        /// <returns>会员价格数据列表</returns>
        public List <MemberPriceInfo> ReadMemberPriceByProductGrade(string strProductID, int gradeID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@strProductID", SqlDbType.NChar),
                new SqlParameter("@gradeID",      SqlDbType.Int)
            };
            parameters[0].Value = strProductID;
            parameters[1].Value = gradeID;
            List <MemberPriceInfo> memberPriceList = new List <MemberPriceInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadMemberPriceByProductGrade", parameters))
            {
                PrepareMemberPriceModel(dr, memberPriceList);
            }
            return(memberPriceList);
        }
Esempio n. 15
0
        /// <summary>
        /// 根据ClassID读取上传上传文件
        /// </summary>
        /// <param name="tableID">表ID</param>
        /// <param name="strClassID">strClassID</param>
        /// <returns>上传上传数据</returns>
        public List <UploadInfo> ReadUploadByClassID(int tableID, string strClassID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@tableID",    SqlDbType.Int),
                new SqlParameter("@strClassID", SqlDbType.NVarChar)
            };
            parameters[0].Value = tableID;
            parameters[1].Value = strClassID;
            List <UploadInfo> uploadList = new List <UploadInfo>();

            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadUploadByClassID", parameters))
            {
                PrepareUploadModel(dr, uploadList);
            }
            return(uploadList);
        }
Esempio n. 16
0
        public List <VoteItemInfo> ReadVoteItemList(VoteItemSearchInfo voteItemSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            PrepareCondition(mssqlCondition, voteItemSearch);
            List <VoteItemInfo> VoteItemList = new List <VoteItemInfo>();

            SqlParameter[] parameters =
            {
                new SqlParameter("@condition", SqlDbType.NVarChar)
            };
            parameters[0].Value = mssqlCondition.ToString() + " ORDER BY [OrderID] desc,[ID] desc";
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchVoteItemList", parameters))
            {
                PrepareVoteItemModel(dr, VoteItemList);
            }
            return(VoteItemList);
        }
Esempio n. 17
0
 /// <summary>
 /// 返回DataReader对像
 /// </summary>
 /// <returns></returns>
 public override SqlDataReader ExecuteReader()
 {
     return(ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadPageList", this.PrepareParameter()));
 }