Ejemplo n.º 1
0
 private void ClearTasprojExtras()
 {
     LagLog.Clear();
     TasStateManager.Clear();
     Markers.Clear();
     ChangeLog.Clear();
 }
Ejemplo n.º 2
0
        internal void ClearChangeLogs()
        {
            undoChangeLog.Clear();
            redoChangeLog.Clear();

            undoCommand.InvokeCanExecuteChanged();
            redoCommand.InvokeCanExecuteChanged();
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
 private void ResetRedoChangeLog()
 {
     redoChangeLog.Clear();
     redoCommand.InvokeCanExecuteChanged();
 }