/// <summary>
        /// 添加操作日志记录
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public OperationLogs AddOperationLogs(OperationLogs entity)
        {
            if (entity == null)
            {
                return(null);
            }
            var obj = operationLogsRepository.AddByCache(entity, true);

            return(int.TryParse(obj.ToString(), out var result) ? entity : null);
        }
Esempio n. 2
0
        /// <summary>
        /// 新建
        /// </summary>
        public static OperationLogs New()
        {
            OperationLogs operationLogs = new OperationLogs();

            operationLogs.Id                  = 0;
            operationLogs.ApplicationId       = 0;
            operationLogs.Source              = string.Empty;
            operationLogs.OperationType       = string.Empty;
            operationLogs.OperationObjectName = string.Empty;
            operationLogs.OperationObjectId   = string.Empty;
            operationLogs.Description         = string.Empty;
            operationLogs.OperatorUserid      = 0;
            operationLogs.OperatorUsername    = string.Empty;
            operationLogs.OperatorIp          = string.Empty;
            operationLogs.OperatorUrl         = string.Empty;
            operationLogs.DateCreated         = DateTime.UtcNow;
            return(operationLogs);
        }