TG.WXCRM.V4/BLL/Qc/QC_COMPLAIN_SERVICEMEMO_BL.cs

33 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Linq;
using WX.CRM.BLL.Util;
using WX.CRM.Common;
using WX.CRM.IBLL.Qc;
using WX.CRM.Model.Entity;
using WX.CRM.Model.MAP;
namespace WX.CRM.BLL.Qc
{
public class QC_COMPLAIN_SERVICEMEMO_BL : DbContextRepository<QC_COMPLAIN_SERVICEMEMO>, IQC_COMPLAIN_SERVICEMEMO
{
public List<QC_COMPLAIN_SERVICEMEMO_Extend> GetList(ref Pager pager, decimal complainId)
{
using (var db = new crmContext())
{
var queryData = db.QC_COMPLAIN_SERVICEMEMO.AsQueryable();
queryData = queryData.Where(m => m.COMPLAINID == complainId);
var returnData = (from a in queryData
join d in db.QC_COMPLAINTDICT on a.RECOMPLAINLEVEL equals d.DICTVALUE
select new QC_COMPLAIN_SERVICEMEMO_Extend()
{
serviceMemo = a,
ComplainLevelName = d.DICTDESC
});
returnData = returnData.OrderByDescending(m => m.serviceMemo.CTIME);
PagerUtil.SetPager<QC_COMPLAIN_SERVICEMEMO_Extend>(ref returnData, ref pager);
return returnData.ToList();
}
}
}
}