예제 #1
0
        public void RefreshMainWindow()
        {
            ToDo.Clear();
            Doing.Clear();
            Backlog.Clear();
            Done.Clear();

            var result = readDbDataToDisplay();

            foreach (var i in result)
            {
                if (i.States == BackLog.State.IsToDo)
                {
                    ToDo.Add(i);
                }
                else if (i.States == BackLog.State.IsDoing)
                {
                    Doing.Add(i);
                }
                else if (i.States == BackLog.State.Backlog)
                {
                    Backlog.Add(i);
                }
                else
                {
                    Done.Add(i);
                }
            }
        }
예제 #2
0
        private async Task LoadTasks()
        {
            var result = await apiService.GetAllTasks();

            if (result.HttpResponse.IsSuccessStatusCode)
            {
                foreach (var item in result.Data)
                {
                    switch (item.Status)
                    {
                    case 0:
                        ToDo.Add(ViewModelHelper.Get(item));
                        break;

                    case 1:
                        Doing.Add(ViewModelHelper.Get(item));
                        break;

                    case 2:
                        Done.Add(ViewModelHelper.Get(item));
                        break;
                    }
                }
            }
        }
        public void AddTodo(string txtAddBlock = null)
        {
            int MaxId = 1;

            if (_toDo.Count > 0)
            {
                MaxId = _toDo.Max(x => x.Id) + 1;
            }
            if (TxtTodo == null)
            {
                ToDo.Add(new ToDoModel
                {
                    Id          = MaxId,
                    Name        = "Task" + MaxId,
                    Complete    = false,
                    Description = txtAddBlock,
                    CreatedDate = GetDateNow,
                    UpdatedDate = GetDateNow
                });
            }
            else
            {
                TxtTodo.Description = txtAddBlock;
                TxtTodo.UpdatedDate = GetDateNow;
                ToDo.Refresh();
                TxtTodo        = null;
                ContentAddToDo = "Add";
            }
            TxtAddBlock = "";
            NotifyOfPropertyChange(() => TxtAddBlock);
        }
예제 #4
0
        void OnDoneItemTapped(object sender, ItemTappedEventArgs e)
        {
            var item = ToDone [e.ItemIndex];

            item.Completed = false;
            ToDone.Remove(item);
            ToDo.Add(item);
        }
예제 #5
0
        protected void OnDoneUnchecked(object sender, EventArgs args)
        {
            var item = FindAssociatedToDoItem(sender as Element, ToDone);

            if (item != null)
            {
                item.Completed = false;
                ToDone.Remove(item);
                ToDo.Add(item);
            }
        }
예제 #6
0
        public void Track(ushort step, TasksManager manager)
        {
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }

            ToDo.Add(step, manager.ToDo.Count);
            InProgress.Add(step, manager.InProgress.Count);
            Done.Add(step, manager.Done.Count);
            Cancelled.Add(step, manager.Cancelled.Count);
        }
 public TodoChildViewModel()
 {
     ToDo.Add(new ToDoModel {
         Id = 1, Name = "Task1", Complete = true, Description = "Testing todo 1", CreatedDate = GetDateNow, UpdatedDate = GetDateNow
     });
     ToDo.Add(new ToDoModel {
         Id = 2, Name = "Task2", Complete = false, Description = "Testing todo 2", CreatedDate = GetDateNow, UpdatedDate = GetDateNow
     });
     ToDo.Add(new ToDoModel {
         Id = 3, Name = "Task3", Complete = false, Description = "Testing todo 3", CreatedDate = GetDateNow, UpdatedDate = GetDateNow
     });
 }
예제 #8
0
        public void AddNewToDoTest()
        {
            var todo = new ToDoItem()
            {
                Subject = "Something",
                Date    = DateTime.Now
            };

            var context = new MoqToDoDbContext();

            var todoService = new ToDo(context.GetMoqDbContext());

            todoService.Add(todo);

            Assert.IsTrue(todo.Id > 0);
        }
예제 #9
0
        /// <summary>
        ///     Add new task to the To Do column
        ///     Should not be called directly
        ///     Use TaskProcessor.Post()
        /// </summary>
        /// <param name="task"></param>
        public void AddToDo(SymuTask task)
        {
            if (task is null)
            {
                throw new ArgumentNullException(nameof(task));
            }

            ToDo.Add(task);
            // We don't want to track message as Task
            if (task.Parent is Message)
            {
                return;
            }

            TaskResult.TotalTasksNumber++;
            TaskResult.ToDo++;
            task.SetTasksManager(this);
        }
예제 #10
0
 /// <summary>
 /// Method that will refresh all the data in the view. Specifically it will add a backlog item to the new correct Observable list
 /// This is called from the edit Command, so we after deleted the item from the prvious view, add it to the new view.
 /// </summary>
 /// <param name="item">Specific item you want to change to a new listbox in the view</param>
 public void RefreshMainWindow(BackLog item)
 {
     if (item.States == BackLog.State.IsToDo)
     {
         ToDo.Add(item);
     }
     else if (item.States == BackLog.State.IsDoing)
     {
         Doing.Add(item);
     }
     else if (item.States == BackLog.State.Backlog)
     {
         Backlog.Add(item);
     }
     else
     {
         Done.Add(item);
     }
 }
예제 #11
0
        /// <summary>
        /// Ctor. Need to read all data from WebAPI (Database), and populate the above ObservableCollections.
        /// These bind to 4 different listbox in View.
        /// </summary>
        public BackLogController()
        {
            if (_client.BaseAddress == null)
            {
                _client.BaseAddress = new Uri("http://localhost:4200/");

                _client.DefaultRequestHeaders.Accept.Clear();
                _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            }

            var result = readDbDataToDisplay();

            foreach (var i in result)
            {
                if (i.States == BackLog.State.IsToDo)
                {
                    ToDo.Add(i);
                }
                else if (i.States == BackLog.State.IsDoing)
                {
                    Doing.Add(i);
                }
                else if (i.States == BackLog.State.Backlog)
                {
                    Backlog.Add(i);
                }
                else
                {
                    Done.Add(i);
                }
            }

            //Here I read settings file for background color of main window.
            string color = Properties.Settings.Default.Color;
            var    brush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(color));

            BackgroundColor = brush;

            NotifyPropertyChanged();

            UpdateChart();
        }
예제 #12
0
        private void SplitTask()
        {
            Debug.WriteLine($"Number of items in Task: {Task.Count}");
            foreach (var task in Task)
            {
                switch (task.Progress)
                {
                case Progress.ToDo:
                    ToDo.Add(task);
                    break;

                case Progress.Doing:
                    Doing.Add(task);
                    break;

                case Progress.Done:
                    Done.Add(task);
                    break;

                default:
                    break;
                }
            }
        }
예제 #13
0
 public void TaskAdd()
 {
     ToDo.Add(new CardViewModel("Info", "NK-2", "Nikita", 3));
 }