public void UpdateAll(int input, List <Task> list)
 {
     foreach (var task in list)
     {
         Console.WriteLine("Nhập nội dung công việc cần làm:");
         task.MoTaCongViec = Console.ReadLine();
         while (task.MoTaCongViec.Trim() == "")
         {
             Console.WriteLine("Nội dung không được để trống, vui lòng nhập lại");
             task.MoTaCongViec = Console.ReadLine();
         }
         Console.WriteLine("Nhập vào mức độ quan trọng:");
         Console.WriteLine("0 - Bình thường" +
                           "\n1 - Quan trọng" +
                           "\n2 - Cực kỳ quan trọng");
         string level = Console.ReadLine();
         while (level.Trim() == "")
         {
             Console.WriteLine("Mức độ quan trọng không được để trống, vui lòng nhập lại");
             level = Console.ReadLine();
         }
         if (level == "0")
         {
             levelEnum = MucDoQuanTrong.Normal;
         }
         else if (level == "1")
         {
             task.level = MucDoQuanTrong.Important;
         }
         else if (level == "2")
         {
             task.level = MucDoQuanTrong.VeryImportant;
         }
         while (level != "0" && level != "1" && level != "2")
         {
             Console.WriteLine("Vui lòng xác định mức độ công việc \"Bình thường\" hay \"Quan trọng\"hay \"Rất quan trọng\"để trống có nghĩa là chưa hoàn thành nếu hoàn thành thì nhấn 1, chưa thì nhấn 0): ");
             level = Console.ReadLine();
             if (level == "0")
             {
                 task.level = MucDoQuanTrong.Normal;
             }
             else if (level == "1")
             {
                 task.level = MucDoQuanTrong.Important;
             }
             else if (level == "2")
             {
                 task.level = MucDoQuanTrong.VeryImportant;
             }
         }
         Console.WriteLine("Công việc \"Hoàn thành\" hay \"Chưa hoàn thành\"( để trống có nghĩa là chưa hoàn thành nếu hoàn thành thì nhấn 1, chưa thì nhấn 0): ");
         task.isCompleted = Console.ReadLine();
         if (task.isCompleted == "")
         {
             task.isCompleted = checkCompleted[0];
         }
         else if (task.isCompleted == GetKeyByValue(checkCompleted, "Hoàn thành").ToString() || task.isCompleted == checkCompleted[1])
         {
             task.isCompleted = checkCompleted[1];
         }
         while (task.isCompleted != GetKeyByValue(checkCompleted, "Hoàn thành").ToString() &&
                task.isCompleted != GetKeyByValue(checkCompleted, "Chưa hoàn thành").ToString() && task.isCompleted != checkCompleted[0] && task.isCompleted != checkCompleted[1])
         {
             Console.WriteLine("Công việc \"Hoàn thành\" hay \"Chưa hoàn thành\"( để trống có nghĩa là chưa hoàn thành nếu hoàn thành thì nhấn 1, chưa thì nhấn 0): ");
             task.isCompleted = Console.ReadLine();
             if (task.isCompleted == GetKeyByValue(checkCompleted, "Hoàn thành").ToString())
             {
                 task.isCompleted = checkCompleted[1];
             }
             else
             {
                 task.isCompleted = checkCompleted[0];
             }
             if (task.isCompleted == "" || task.isCompleted == GetKeyByValue(checkCompleted, "Chưa hoàn thành").ToString())
             {
                 task.isCompleted = checkCompleted[0];
             }
         }
         break;
     }
 }
        public void Input(int ID, List <Task> list)
        {
            Console.OutputEncoding = Encoding.Unicode;
            Console.InputEncoding  = Encoding.Unicode;
            bool flag = false;

            if (ID == 0)
            {
                ID   = list.Count() + 1;
                flag = true;
            }
            Console.WriteLine("Nhập nội dung công việc cần làm:");
            string noidung = Console.ReadLine();

            while (noidung.Trim() == "")
            {
                Console.WriteLine("Nội dung không được để trống, vui lòng nhập lại");
                noidung = Console.ReadLine();
            }
            Console.WriteLine("Nhập vào mức độ quan trọng:");
            Console.WriteLine("0 - Bình thường" +
                              "\n1 - Quan trọng" +
                              "\n2 - Cực kỳ quan trọng");
            string level = Console.ReadLine();

            while (level.Trim() == "")
            {
                Console.WriteLine("Mức độ quan trọng không được để trống, vui lòng nhập lại");
                level = Console.ReadLine();
            }
            if (level == "0")
            {
                levelEnum = MucDoQuanTrong.Normal;
            }
            else if (level == "1")
            {
                levelEnum = MucDoQuanTrong.Important;
            }
            else if (level == "2")
            {
                levelEnum = MucDoQuanTrong.VeryImportant;
            }
            while (level != "0" && level != "1" && level != "2")
            {
                Console.WriteLine("Vui lòng xác định mức độ công việc \"Bình thường\" hay \"Quan trọng\"hay \"Rất quan trọng");
                level = Console.ReadLine();
                if (level == "0")
                {
                    levelEnum = MucDoQuanTrong.Normal;
                }
                else if (level == "1")
                {
                    levelEnum = MucDoQuanTrong.Important;
                }
                else if (level == "2")
                {
                    levelEnum = MucDoQuanTrong.VeryImportant;
                }
            }
            Console.WriteLine("Công việc \"Hoàn thành\" hay \"Chưa hoàn thành\"( để" +
                              " trống có nghĩa là chưa hoàn thành nếu hoàn thành thì nhấn 1, chưa thì nhấn 0): ");
            string isCompleted = Console.ReadLine();

            if (isCompleted == "" || isCompleted == GetKeyByValue(checkCompleted, "Chưa hoàn thành").ToString())
            {
                isCompleted = checkCompleted[0];
            }
            else if (isCompleted == GetKeyByValue(checkCompleted, "Hoàn thành").ToString() || isCompleted == checkCompleted[1])
            {
                isCompleted = checkCompleted[1];
            }
            while (isCompleted != GetKeyByValue(checkCompleted, "Hoàn thành").ToString() && isCompleted != GetKeyByValue(checkCompleted, "Chưa hoàn thành").ToString() &&
                   isCompleted != checkCompleted[0] && isCompleted != checkCompleted[1])
            {
                Console.WriteLine("Vui lòng xác định công việc \"Hoàn thành\" hay \"Chưa hoàn thành\"( để trống có nghĩa là chưa hoàn thành nếu hoàn thành thì nhấn 1, chưa thì nhấn 0): ");
                isCompleted = Console.ReadLine();
                if (isCompleted == "")
                {
                    isCompleted = checkCompleted[1];
                }
            }
            var Task = new Task(ID, noidung, levelEnum, isCompleted);

            if (flag)
            {
                list.Add(Task);
            }
        }