Exemplo n.º 1
0
        public bool AddLog(string title, string creater, string contents, string remark = "日志记录")
        {
            if (string.IsNullOrWhiteSpace(title))
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(creater))
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(contents))
            {
                return(false);
            }
            var entity = new LogRecordModels
            {
                Creater     = creater,
                CTime       = DateTime.Now,
                IsDeleted   = false,
                LogContents = contents,
                LogTitle    = title,
                OpenId      = Guid.NewGuid().ToString(),
                Remark      = remark,
                Types       = (int)EnumCore.LogType.正常,
                UTime       = DateTime.Now
            };

            return(IocRepository.IocLogRecordRepository.InsertBool(entity));
        }
Exemplo n.º 2
0
        public static void AddLog(string title, string content, string creater = "127.0.0.1", string remark = "日志记录")
        {
            var entity = new LogRecordModels()
            {
                LogTitle    = title,
                LogContents = content,
                Creater     = creater,
                Remark      = remark
            };

            IocPlugin.IocAddDataLogRecordPlugin.AddDataLogRecord(entity);
        }
Exemplo n.º 3
0
        public JsonResult GetPageDataLogs(LogRecordModels queryEntity)
        {
            queryEntity.SafetySecretKey = PluginCore.GetInstance.SafetySecretValue;
            queryEntity.IsUsable        = true;
            var result     = IocPlugin.IocGetPageDataLogsPlugin.GetPageDataLogs(queryEntity);
            var pageResult = result.TData;
            var pageList   = pageResult.PageData.Select(m =>
            {
                return(new
                {
                    displayID = m.ID,
                    displayLogTitle = m.LogTitle,
                    displayLogContents = m.LogContents,
                    displayCTime = m.CTimeStr
                });
            });

            return(Json(new { code = 0, msg = string.Empty, count = pageResult.Totals, data = pageList }, JsonRequestBehavior.AllowGet));
        }
        public BaseResult AddDataLogRecord(LogRecordModels entity)
        {
            this.SafetySecretKey = entity.SafetySecretKey;
            this.Usable          = entity.IsUsable ? BasePluginType.Type.启用 : BasePluginType.Type.卸载;
            var result = new BaseResult()
            {
                Code    = (int)EnumCore.CodeType.失败,
                Message = "系统错误",
            };

            if (string.IsNullOrWhiteSpace(this.SafetySecretKey) || this.Usable == BasePluginType.Type.卸载 || PluginCore.GetInstance.VerifySafetySecretKey(this.SafetySecretKey))
            {
                return(result);
            }
            if (LogRecordManager.GetInstance.AddLog(entity))
            {
                result.Code = (int)EnumCore.CodeType.成功;
            }
            result.Message = "添加成功";
            return(result);
        }
        public bool AddLog(LogRecordModels entity)
        {
            if (string.IsNullOrWhiteSpace(entity.LogTitle))
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(entity.Creater))
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(entity.LogContents))
            {
                return(false);
            }
            entity.CTime     = DateTime.Now;
            entity.IsDeleted = false;
            entity.OpenId    = Guid.NewGuid().ToString();
            entity.Types     = (int)EnumCore.LogType.正常;
            entity.UTime     = DateTime.Now;

            return(IocRepository.IocLogRecordRepository.InsertBool(entity));
        }
 public int Delete(LogRecordModels entity)
 {
     return(DBCore.Deleteable(entity).With(SqlWith.RowLock).ExecuteCommand());
 }
 public int Update(LogRecordModels entity)
 {
     return(DBCore.Updateable(entity).With(SqlWith.UpdLock).Where(true).ExecuteCommand());
 }
 public bool InsertBool(LogRecordModels entity)
 {
     return(DBCore.Insertable(entity).With(SqlWith.UpdLock).ExecuteCommandIdentityIntoEntity());
 }
 public LogRecordModels InsertEntity(LogRecordModels entity)
 {
     return(DBCore.Insertable(entity).With(SqlWith.UpdLock).ExecuteReturnEntity());
 }
 public long InsertLong(LogRecordModels entity)
 {
     return(DBCore.Insertable(entity).With(SqlWith.UpdLock).ExecuteReturnBigIdentity());
 }
 public int InsertInt(LogRecordModels entity)
 {
     return(DBCore.Insertable(entity).With(SqlWith.UpdLock).ExecuteCommand());
 }