private UDSLogModel CreateNewLog(Guid udsId, UDSLogType logType, string logDescription, string username, DateTimeOffset creationTime) { UDSLogModel log = new UDSLogModel { UDSLogId = Guid.NewGuid(), UDSId = udsId, LogDate = creationTime, LogDescription = logDescription, SystemComputer = Environment.MachineName, SystemUser = username, LogType = logType }; return(log); }
internal static UDSLog CreateUDSLog(Guid idUDS, UDSRepository repository, string logDescription, UDSLogType logType, string registrationUser, DateTimeOffset?logDate = null, string systemComputer = "") { UDSLog log = new UDSLog() { LogType = logType, LogDescription = logDescription, SystemComputer = string.IsNullOrEmpty(systemComputer) ? Environment.MachineName : systemComputer, Entity = repository, RegistrationDate = logDate.HasValue && logDate.Value != DateTimeOffset.MinValue ? logDate.Value : DateTimeOffset.UtcNow, RegistrationUser = registrationUser, IdUDS = idUDS, Environment = repository.DSWEnvironment, }; log.Hash = HashGenerator.GenerateHash(string.Concat(log.RegistrationUser, "|", log.LogType, "|", log.LogDescription, "|", log.UniqueId, "|", idUDS, "|", log.RegistrationDate.ToString("yyyyMMddHHmmss"))); return(log); }
internal void AddUDSAuthorizationtLog(Guid udsId, string title, string fullNumber, string userName, DateTimeOffset creationTime, ref UDSLogType logType, ICollection <UDSLogModel> logs) { string logSubjectMessage = string.Concat(UDS_LOG_ROLES_MODIFY, string.Format(UDS_INFO, title, fullNumber)); logType = UDSLogType.AuthorizationModify; logs.Add(CreateNewLog(udsId, logType, logSubjectMessage, userName, creationTime)); }
public void InsertLog(Guid idUDS, Guid idUDSRepository, int environment, string message, UDSLogType type) { UDSLog log = new UDSLog() { IdUDS = idUDS, Entity = new UDSRepository(idUDSRepository), Environment = environment, LogType = type, LogDescription = message, RegistrationUser = DocSuiteContext.Current.User.FullUserName, SystemComputer = DocSuiteContext.Current.UserComputer, RegistrationDate = DateTimeOffset.UtcNow }; Save(log); }