/// <summary> /// 组合搜索条件 /// </summary> /// <param name="mssqlCondition"></param> /// <param name="search">BargainOrderSearch模型变量</param> public MssqlCondition PrepareCondition(BargainOrderSearch search) { MssqlCondition mssqlCondition = new MssqlCondition(); mssqlCondition.Add("[Id]", search.Id, ConditionType.Equal); mssqlCondition.Add("[UserId]", search.UserId, ConditionType.Equal); mssqlCondition.Add("[Status]", search.Status, ConditionType.Equal); mssqlCondition.Add("[BargainDetailsId]", search.BargainDetailsId, ConditionType.Equal); mssqlCondition.Add("[BargainPrice]", search.BargainPrice, ConditionType.Like); mssqlCondition.Add("[SharePrice]", search.SharePrice, ConditionType.Like); mssqlCondition.Add("[ShareStatus]", search.ShareStatus, ConditionType.Equal); return(mssqlCondition); }
/// <summary> /// 搜索砍价订单数据列表 /// </summary> /// <param name="search">BargainOrderSearch模型变量</param> /// <returns>砍价订单数据列表</returns> public List <BargainOrderInfo> SearchBargainOrderList(BargainOrderSearch search) { using (var conn = new SqlConnection(connectString)) { string sql = "select * from BargainOrder"; string condition = PrepareCondition(search).ToString(); if (!string.IsNullOrEmpty(condition)) { sql += " where " + condition + " Order by Id Desc"; } return(conn.Query <BargainOrderInfo>(sql).ToList()); } }
/// <summary> /// 搜索砍价订单数据列表 /// </summary> /// <param name="currentPage">当前的页数</param> /// <param name="pageSize">每页记录数</param> /// <param name="search">BargainOrderSearch模型变量</param> /// <param name="count">总数量</param> /// <returns>砍价订单数据列表</returns> public List <BargainOrderInfo> SearchBargainOrderList(int currentPage, int pageSize, BargainOrderSearch search, ref int count) { using (var conn = new SqlConnection(connectString)) { ShopMssqlPagerClass pc = new ShopMssqlPagerClass(); pc.TableName = "BargainOrder"; pc.Fields = "*"; pc.CurrentPage = currentPage; pc.PageSize = pageSize; pc.OrderType = OrderType.Desc; pc.MssqlCondition = PrepareCondition(search); count = pc.Count; return(conn.Query <BargainOrderInfo>(pc).ToList()); } }
/// <summary> /// 搜索砍价订单数据列表 /// </summary> /// <param name="currentPage">当前的页数</param> /// <param name="pageSize">每页记录数</param> /// <param name="mode">BargainOrderSearch模型变量</param> /// <param name="count">总数量</param> /// <returns>砍价订单数据列表</returns> public static List <BargainOrderInfo> SearchBargainOrderList(int currentPage, int pageSize, BargainOrderSearch mode, ref int count) { return(dal.SearchBargainOrderList(currentPage, pageSize, mode, ref count)); }
/// <summary> /// 搜索砍价订单数据列表 /// </summary> /// <param name="mode">BargainOrderSearch模型变量</param> /// <returns>砍价订单数据列表</returns> public static List <BargainOrderInfo> SearchBargainOrderList(BargainOrderSearch mode) { return(dal.SearchBargainOrderList(mode)); }