예제 #1
0
        void ManipulateTask()
        {
            int operation = UserInput.ReadOption("Choose an option!", new string[] { "make a new task", "delete a task" }, true);

            switch (operation)
            {
            case 1:
                TaskMaker();
                bool choice = UserInput.ReadYesNo("Do you want to make another task?", true);
                if (choice)
                {
                    TaskMaker();
                }
                ;
                break;

            case 2:
                int tasksCount = service.GetAll().Count();
                int index      = UserInput.ReadInt("Select the number of the task, you want to delete: ", 1, tasksCount);
                service.DeleteByIndex(index - 1);
                break;

            default:
                Console.WriteLine(Messages.InvalidComand());
                break;
            }
        }