Example #1
0
 public static LogViewModel ToLogViewModel(this DataAccess.Log logEntity)
 {
     return(new LogViewModel
     {
         LogId = logEntity.LogId,
         Message = logEntity.Message,
         CreateBy = logEntity.CreateBy
     });
 }
Example #2
0
        public static Common.Log ToCommonLog(this DataAccess.Log log)
        {
            if (log == null)
            {
                return(null);
            }

            return(new Common.Log
            {
                Id = log.Id,
                Descriptions = log.Descriptions,
                Device = log.Device,
                Latitude = log.Latitude,
                Longitude = log.Longitude,
                LocalTime = log.LocalTime,
                UtcTime = log.UtcTime,
                LogType = log.LogType,
                Section = log.Section,
                Title = log.Title,
                Username = log.Username
            });
        }
Example #3
0
 /// <summary>
 /// 保存操作日志
 /// </summary>
 /// <param name="log"></param>
 /// <returns></returns>
 public override bool Save(DataAccess.Log log)
 {
     DbManager.Logs.InsertOne(log);
     DeleteLogAsync();
     return(true);
 }