54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using System;
|
|
using System.Linq;
|
|
using WX.CRM.BLL.Base;
|
|
using WX.CRM.BLL.Util;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.IBLL.Res;
|
|
using WX.CRM.Model.Entity;
|
|
namespace WX.CRM.BLL.Res
|
|
{
|
|
public class RES_ACTIVITY_EXPORTLOG_BL : IRES_ACTIVITY_EXPORTLOG, IRES_ACTIVITY_EXPORTLOG_Q
|
|
{
|
|
/// <summary>
|
|
/// 获取续导出的记录
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="SOURCETYPE"></param>
|
|
/// <param name="createUser"></param>
|
|
/// <returns></returns>
|
|
public RES_ACTIVITY_EXPORTLOG GetModel(decimal id, int sourceType)
|
|
{
|
|
using (var db = new WX.CRM.Model.Entity.crmContext())
|
|
{
|
|
RES_ACTIVITY_EXPORTLOG entry = db.RES_ACTIVITY_EXPORTLOG.OrderByDescending(m => m.CTIME).FirstOrDefault(m => m.SOURCEID == id && m.SOURCETYPE == sourceType);
|
|
return entry;
|
|
}
|
|
}
|
|
#region 添加
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public bool Create(ref ValidationErrors errors, WX.CRM.Model.Entity.RES_ACTIVITY_EXPORTLOG model)
|
|
{
|
|
try
|
|
{
|
|
using (WX.CRM.Model.Entity.crmContext db = new WX.CRM.Model.Entity.crmContext())
|
|
{
|
|
|
|
model.LOGID = new SEQUENCES_BL().Seq_base_get();
|
|
db.RES_ACTIVITY_EXPORTLOG.Add(model);
|
|
return db.SaveChanges().GetResult();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
errors.Add(ex.Message);
|
|
return false;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|