/// <summary> /// 更新信息 /// </summary> public int UpdateInfo(SqlTransaction trans, MemberEventLogModel memModel, long SN) { string key = "Cache_MemberEventLog_Model_" + SN; CacheHelper.RemoveCache(key); return(memDAL.UpdateInfo(trans, memModel, SN)); }
/// <summary> /// 添加操作日志 /// </summary> public void InsertLog(SqlTransaction trans, string DistributorId, EnumList.MemberEventLogType actionType, long MemberId, bool OpStatus, string strEventContent) { MemberEventLogModel memModel = new MemberEventLogModel(); memModel.MemberId = MemberId; memModel.DistributorId = DistributorId; memModel.EventType = actionType.ToInt(); memModel.UserAgent = HttpContext.Current.Request.UserAgent.ToString2(); memModel.IP = HttpContext.Current.Request.UserHostAddress.ToString2(); memModel.CreationDate = DateTimeOffset.Now; memModel.OpStatus = OpStatus; memModel.EventContent = strEventContent; memDAL.InsertInfo(trans, memModel); }
/// <summary> /// 从缓存读取信息 /// </summary> public MemberEventLogModel GetCacheInfo(SqlTransaction trans, long SN) { string key = "Cache_MemberEventLog_Model_" + SN; object value = CacheHelper.GetCache(key); if (value != null) { return((MemberEventLogModel)value); } else { MemberEventLogModel memModel = memDAL.GetInfo(trans, SN); CacheHelper.AddCache(key, memModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null); return(memModel); } }
/// <summary> /// 插入信息 /// </summary> public int InsertInfo(SqlTransaction trans, MemberEventLogModel memModel) { return(memDAL.InsertInfo(trans, memModel)); }