Beispiel #1
0
/// <summary>
/// 更新信息
/// </summary>
        public int UpdateInfo(SqlTransaction trans, AdminLogModel admModel, long AdminLogId)
        {
            string key = "Cache_AdminLog_Model_" + AdminLogId;

            CacheHelper.RemoveCache(key);
            return(admDAL.UpdateInfo(trans, admModel, AdminLogId));
        }
Beispiel #2
0
/// <summary>
/// 从缓存读取信息
/// </summary>
        public AdminLogModel GetCacheInfo(SqlTransaction trans, long AdminLogId)
        {
            string key   = "Cache_AdminLog_Model_" + AdminLogId;
            object value = CacheHelper.GetCache(key);

            if (value != null)
            {
                return((AdminLogModel)value);
            }
            else
            {
                AdminLogModel admModel = admDAL.GetInfo(trans, AdminLogId);
                CacheHelper.AddCache(key, admModel, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(20), CacheItemPriority.Normal, null);
                return(admModel);
            }
        }
Beispiel #3
0
/// <summary>
/// 添加操作日志
/// </summary>
        public void InsertLog(SqlTransaction trans, EnumList.AdminLogActionType actionType, string strLogContent)
        {
            try
            {
                AdminLogModel admLogModel = new AdminLogModel();
                admLogModel.LogAction    = (int)actionType;
                admLogModel.LogContent   = strLogContent;
                admLogModel.ScriptFile   = HttpContext.Current.Request.RawUrl.ToString2();
                admLogModel.IPAddress    = HttpContext.Current.Request.UserHostAddress.ToString2();
                admLogModel.AdminId      = HttpContext.Current.Session["AdminId"].ToInt();
                admLogModel.CreationDate = DateTimeOffset.Now;
                admDAL.InsertInfo(trans, admLogModel);
            }
            catch
            {
            }
        }
Beispiel #4
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, AdminLogModel admModel)
        {
            return(admDAL.InsertInfo(trans, admModel));
        }