ComplianceServer/oldcode/BLL/QH/QH_PRODUCTTRANCOUNT_BL.cs

38 lines
1006 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using WX.CRM.IBLL.QH;
using WX.CRM.Model.Entity;
namespace WX.CRM.BLL.QH
{
public class QH_PRODUCTTRANCOUNT_BL : IQH_PRODUCTTRANCOUNT_Q
{
public List<QH_PRODUCTTRANCOUNT> GetList_QH_ProductTranCount(string productCode, DateTime? dtstart, DateTime? dtend)
{
using (crmContext db = new crmContext())
{
var query = db.QH_PRODUCTTRANCOUNT.AsQueryable();
if (dtstart != null && dtend != null)
{
query = query.Where(m => m.TRANDATE >= dtstart && m.TRANDATE < dtend);
}
if (!string.IsNullOrWhiteSpace(productCode))
{
productCode = productCode.Trim();
query = query.Where(m => m.PRODUCTCODE == productCode);
}
var lists = query.ToList();
return lists;
}
}
}
}