private void ClearTasprojExtras() { LagLog.Clear(); TasStateManager.Clear(); Markers.Clear(); ChangeLog.Clear(); }
internal void ClearChangeLogs() { undoChangeLog.Clear(); redoChangeLog.Clear(); undoCommand.InvokeCanExecuteChanged(); redoCommand.InvokeCanExecuteChanged(); }
public async Task LoadChangeLog(string entityName, int pk) { ChangeLog.Clear(); using (var context = new NeoTrackerContext()) { var logs = await context.ChangeLogs.Where(x => x.EntityName == entityName && x.PrimaryKeyValue == pk).OrderByDescending(x => x.UpdatedAt).ToListAsync(); foreach (var log in logs.Where(x => x.PropertyName.Contains("ID"))) { switch (log.PropertyName) { case "StatusID": //log.NewValue = !string.IsNullOrEmpty(log.NewValue) ? context.Statuses.Find(int.Parse(log.NewValue)).Name : string.Empty; log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.Statuses.Find(int.Parse(log.OldValue)).Name : string.Empty; break; case "ItemID": //log.NewValue = !string.IsNullOrEmpty(log.NewValue) ? context.Items.Find(int.Parse(log.NewValue)).Name : string.Empty; log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.Items.Find(int.Parse(log.OldValue)).Name : string.Empty; break; case "UserID": log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.Users.Find(int.Parse(log.OldValue)).LongName : string.Empty; break; case "DepartmentID": //log.NewValue = !string.IsNullOrEmpty(log.NewValue) ? context.Departments.Find(int.Parse(log.NewValue)).Name : string.Empty; log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.Departments.Find(int.Parse(log.OldValue)).Name : string.Empty; break; case "EventTypeID": //log.NewValue = !string.IsNullOrEmpty(log.NewValue) ? context.EventTypes.Find(int.Parse(log.NewValue)).Name : string.Empty; log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.EventTypes.Find(int.Parse(log.OldValue)).Name : string.Empty; break; case "ProjectTypeID": //log.NewValue = !string.IsNullOrEmpty(log.NewValue) ? context.ProjectTypes.Find(int.Parse(log.NewValue)).Name : string.Empty; log.OldValue = !string.IsNullOrEmpty(log.OldValue) ? context.ProjectTypes.Find(int.Parse(log.OldValue)).Name : string.Empty; break; default: break; } } ChangeLog = logs; } }
private void ResetRedoChangeLog() { redoChangeLog.Clear(); redoCommand.InvokeCanExecuteChanged(); }