TG.WXCRM.V4/BLL/Wx/WX_MESSAGE_BL.cs

56 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using WX.CRM.Common;
using WX.CRM.DAL.Wx;
using WX.CRM.IBLL.Wx;
using WX.CRM.Model.Entity;
using WX.CRM.Model.MAP;
using WX.CRM.Model.QueryMap;
namespace WX.CRM.BLL.Wx
{
public class WX_MESSAGE_BL : DbContextRepository<WX_MESSAGE>, IWX_MESSAGE
{
WX_Message_DAL dal = new WX_Message_DAL();
public List<WX_MESSAGE> GetTopList(decimal maxtPkid, int topNum)
{
using (var db = new WX.CRM.Model.Entity.crmContext())
{
return db.WX_MESSAGE.Where(p => p.PKID > maxtPkid).Take(topNum).ToList();
}
}
public List<WX_Message_Extend> GetMessageList(ref Pager pager, string keyword, string tableName, string userNames, string stime, string etime, string customerUserName)
{
int recordCount = 0;
DataTable dt = dal.GetMessage(pager.rows, pager.page, keyword, tableName, userNames, stime, etime, customerUserName, out recordCount);
pager.totalRows = recordCount;
if (dt != null)
{
return dt.ToList<WX_Message_Extend>();
}
else
{
return new List<WX_Message_Extend>();
}
}
public void UpdateMessageIsIllegal(string tableName, string userName, string msgSvrid)
{
dal.UpdateMessageIsIllegal(tableName, userName, msgSvrid);
}
public List<MessageCountView> GetMessageCount(string groupId, string inneruserId, DateTime sTime, DateTime eTime)
{
return dal.GetMessageCount(groupId, inneruserId, sTime, eTime);
}
public List<MessageCount2View> GetMessageCount2(string groupId, string inneruserId, DateTime sTime, DateTime eTime)
{
return dal.GetMessageCount2(groupId, inneruserId, sTime, eTime);
}
}
}