示例#1
0
/// <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));
        }
示例#2
0
        /// <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);
        }
示例#3
0
/// <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);
            }
        }
示例#4
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, MemberEventLogModel memModel)
        {
            return(memDAL.InsertInfo(trans, memModel));
        }