コード例 #1
0
        /// <summary>
        /// 组合搜索条件
        /// </summary>
        /// <param name="mssqlCondition"></param>
        /// <param name="search">RecordingSearch模型变量</param>
        public MssqlCondition PrepareCondition(RecordingSearch search)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            mssqlCondition.Add("[BOrderId]", search.BOrderId, ConditionType.Equal);
            mssqlCondition.Add("[Price]", search.Price, ConditionType.Like);
            mssqlCondition.Add("[Name]", search.Name, ConditionType.Like);
            mssqlCondition.Add("[Photo]", search.Photo, ConditionType.Like);
            mssqlCondition.Add("[AddDate]", search.AddDate, ConditionType.Like);
            mssqlCondition.Add("[UserId]", search.UserId, ConditionType.Equal);
            mssqlCondition.Add("[UserName]", search.UserName, ConditionType.Like);

            mssqlCondition.Add("[BOrderId]", search.InBOrderId, ConditionType.In);
            return(mssqlCondition);
        }
コード例 #2
0
        /// <summary>
        /// 搜索砍价记录表数据列表
        /// </summary>
        /// <param name="search">RecordingSearch模型变量</param>
        /// <returns>砍价记录表数据列表</returns>
        public List <RecordingInfo> SearchRecordingList(RecordingSearch search)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = "select * from Recording";

                string condition = PrepareCondition(search).ToString();
                if (!string.IsNullOrEmpty(condition))
                {
                    sql += " where " + condition + " Order by AddDate DESC";
                }

                return(conn.Query <RecordingInfo>(sql).ToList());
            }
        }
コード例 #3
0
        /// <summary>
        /// 搜索砍价记录表数据列表
        /// </summary>
        /// <param name="currentPage">当前的页数</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="search">RecordingSearch模型变量</param>
        /// <param name="count">总数量</param>
        /// <returns>砍价记录表数据列表</returns>
        public List <RecordingInfo> SearchRecordingList(int currentPage, int pageSize, RecordingSearch search, ref int count)
        {
            using (var conn = new SqlConnection(connectString))
            {
                ShopMssqlPagerClass pc = new ShopMssqlPagerClass();
                pc.TableName      = "Recording";
                pc.Fields         = "*";
                pc.CurrentPage    = currentPage;
                pc.PageSize       = pageSize;
                pc.OrderType      = OrderType.Desc;
                pc.MssqlCondition = PrepareCondition(search);

                count = pc.Count;
                return(conn.Query <RecordingInfo>(pc).ToList());
            }
        }
コード例 #4
0
ファイル: RecordingBLL.cs プロジェクト: skybluebin007/JW-Shop
 /// <summary>
 /// 搜索砍价记录表数据列表
 /// </summary>
 /// <param name="currentPage">当前的页数</param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="mode">RecordingSearch模型变量</param>
 /// <param name="count">总数量</param>
 /// <returns>砍价记录表数据列表</returns>
 public static List <RecordingInfo> SearchRecordingList(int currentPage, int pageSize, RecordingSearch mode, ref int count)
 {
     return(dal.SearchRecordingList(currentPage, pageSize, mode, ref count));
 }
コード例 #5
0
ファイル: RecordingBLL.cs プロジェクト: skybluebin007/JW-Shop
 /// <summary>
 /// 搜索砍价记录表数据列表
 /// </summary>
 /// <param name="mode">RecordingSearch模型变量</param>
 /// <returns>砍价记录表数据列表</returns>
 public static List <RecordingInfo> SearchRecordingList(RecordingSearch mode)
 {
     return(dal.SearchRecordingList(mode));
 }