Esempio n. 1
0
        /// <summary>
        /// добавить задачу
        /// </summary>
        /// <param name="xmlDocument"></param>
        private static void AddTask(IParser parser)
        {
            if (parser.EmptyCategory())
            {
                WriteLine("Anyone category!");
                return;
            }

            string id;

            do
            {
                Write("Enter id: ");
                id = ReadLine();
            } while (parser.ContainsTask(id));

            Write("Enter name: ");
            string name = ReadLine();

            Write("Enter title: ");
            string title = ReadLine();

            Write("Enter priority: ");
            string priority = ReadLine();

            WriteLine(parser.GetCategories());
            string category;

            do
            {
                Write("Enter category: ");
                category = ReadLine();
            } while (!parser.ContainsCategory(category));

            Write("Enter process: ");
            string process = ReadLine();

            Write("Enter start data: ");
            string startData = ReadLine();

            Write("Enter deadline: ");
            string deadline = ReadLine();

            //добавляем задачу
            parser.AddNewTask(id, name, title, priority, category, process, startData, deadline);
        }