Beispiel #1
0
 public void ArchiveTask(TaskDate taskDate)
 {
     TaskDate.Add(taskDate);
 }
Beispiel #2
0
        public static void AddNewTask()
        {
            Console.Clear();
            Console.WriteLine("Please enter the number of Task you want to add");
            Console.WriteLine("[0]\tTask with Last Todo date");
            Console.WriteLine("[1]\tTask with Checklist");
            Console.WriteLine("[2]\tBack to Menu");

            switch (Console.ReadLine())
            {
            case "0":
                Console.Clear();
                Console.WriteLine("Please enter Task to Add");
                string   taskDateToAdd = Console.ReadLine();
                string   date          = DateFormat.CreateDate();
                TaskDate newTaskDate   = new TaskDate();
                newTaskDate.CreateTask(date, taskDateToAdd);
                taskDate.Add(newTaskDate);
                Console.Clear();
                StartMenu();
                break;

            case "1":
                Console.WriteLine("Please enter Task to Add");
                string        taskToAdd        = Console.ReadLine();
                TaskCheckList newTaskCheckList = new TaskCheckList();
                newTaskCheckList.CreateTask(taskToAdd);
                bool running = true;
                while (running)
                {
                    Console.WriteLine("Add checklistitem to task");
                    string subTask = Console.ReadLine();
                    newTaskCheckList.AddCheckListTask(subTask);
                    Console.WriteLine("Enter q to exit or press any other key to enter new task");
                    string quit = Console.ReadLine();
                    if (quit == "q")
                    {
                        running = false;
                    }
                    Console.Clear();
                }
                taskCheckList.Add(newTaskCheckList);
                Console.Clear();
                StartMenu();
                break;

            case "2":
                Console.Clear();
                StartMenu();
                break;

            case "q":
                Console.Clear();
                break;

            default:
                Console.WriteLine("Please Try Again!");
                Console.Clear();
                AddNewTask();
                break;
            }
        }