40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using WX.CRM.BLL.Util;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.IBLL.Base;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.BLL.Base
|
|
{
|
|
public class BAS_NOTICE_BL : DbContextRepository<BAS_NOTICE>, IBAS_NOTICE
|
|
{
|
|
public List<BAS_NOTICE> GetList(ref Pager page, string title, string stime, string etime)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
var queryData = db.BAS_NOTICE.AsQueryable();
|
|
if (!string.IsNullOrWhiteSpace(title))
|
|
{
|
|
title = title.Trim();
|
|
queryData = queryData.Where(m => m.TITLE.Contains(title));
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(stime))
|
|
{
|
|
DateTime dt = Convert.ToDateTime(stime);
|
|
queryData = queryData.Where(m => m.CTIME > dt);
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(etime))
|
|
{
|
|
DateTime dt = Convert.ToDateTime(etime).AddDays(1);
|
|
queryData = queryData.Where(m => m.CTIME < dt);
|
|
}
|
|
queryData = queryData.OrderByDescending(m => m.CTIME);
|
|
PagerUtil.SetPager<BAS_NOTICE>(ref queryData, ref page);
|
|
return queryData.ToList();
|
|
}
|
|
}
|
|
}
|
|
}
|