ComplianceServer/oldcode/BLL/Res/RES_MYALLOCATERES_ACT_BL.cs

36 lines
1.4 KiB
C#

using System.Collections.Generic;
using System.Linq;
using WX.CRM.IBLL.Res;
using WX.CRM.Model.Entity;
namespace WX.CRM.BLL.Res
{
public class RES_MYALLOCATERES_ACT_BL : DbContextRepository<RES_MYALLOCATERES_ACT>, IRES_MYALLOCATERES_ACT
{
public List<RES_MYALLOCATERES_ACT_VIEW> List(int top = 500)
{
using (var db = new crmContext())
{
var query = from a in db.RES_MYALLOCATERES_ACT
join b in db.SOFT_USER on a.RESID equals b.RESID into abTmp
from ab in abTmp.DefaultIfEmpty()
where a.ISEXE == 0 && a.ACT != "None"
orderby ab.REGDATE descending, a.ID ascending
select new RES_MYALLOCATERES_ACT_VIEW()
{
ID = a.ID,
RESID = a.RESID,
SOFTUSERNAME = ab.USERNAME,
UNIONID = ab.UNIONID,
EID = a.EID,
CHANNEL = a.CHANNEL,
CTIME = a.CTIME,
ACT = a.ACT,
ISEXE = a.ISEXE,
OLDEID = a.OLDEID
};
return query.Take(top).ToList();
}
}
}
}