46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using WX.CRM.BLL.Redis;
|
|
using WX.CRM.BLL.Res;
|
|
using WX.CRM.IBLL.RedisBL;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.BLL.RedisBL
|
|
{
|
|
public class RES_CUSTOMERDETAIL_REDIS_BL : IRES_CUSTOMERDETAIL_REDIS
|
|
{
|
|
public RES_CUSTOMERDETAIL GetInfo(string resid, int IsTran = 1)
|
|
{
|
|
try
|
|
{
|
|
resid = String.Format("{0}", resid).Trim();
|
|
RedisHelper redis = new RedisHelper();
|
|
string rediskey = WX.CRM.Model.Redis.KeysDic.GetKey<RES_CUSTOMERDETAIL>(resid);
|
|
RES_CUSTOMERDETAIL model = redis.Get<RES_CUSTOMERDETAIL>(rediskey);
|
|
return model;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
if (IsTran == 1)
|
|
return new RES_CUSTOMERDETAIL_BL().GetModel_RES_CUSTOMERDETAIL(resid);
|
|
else
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
public bool AddRedis(RES_CUSTOMERDETAIL entity)
|
|
{
|
|
try
|
|
{
|
|
string rediskey = WX.CRM.Model.Redis.KeysDic.GetKey<RES_CUSTOMERDETAIL>(entity.RESID);
|
|
RedisHelper redis = new RedisHelper();
|
|
return redis.AddToCache(rediskey, entity);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|