Esempio n. 1
0
        static void ManageCalendar(Database_Calendar calendar)
        {
            Console.WriteLine("Which action do you want to do with the academic calendar ? : ");
            Console.WriteLine("1) To show all dates for all courses");
            Console.WriteLine("2) To delete a date");
            Console.WriteLine("3) To add a date");
            Console.WriteLine("4) To check if a date is already written in the academic calendar");
            Console.WriteLine("5) To modify a date");
            Console.WriteLine();
            int    answer = Convert.ToInt32(Console.ReadLine());
            string course = "";

            while (answer < 1 || answer > 5)
            {
                Console.WriteLine("Please write a correct choice : ");
                answer = Convert.ToInt32(Console.ReadLine());
            }
            switch (answer)
            {
            case 1:
                calendar.DisplayCalendar();
                break;

            case 2:
                course = calendar.AskCourse();
                calendar.DeleteDate(course);
                break;

            case 3:
                course = calendar.AskCourse();
                calendar.AddDate(course);
                break;

            case 4:
                course = calendar.AskCourse();
                calendar.FindDate(course);
                break;

            case 5:
                course = calendar.AskCourse();
                calendar.ModifyDate(course);
                break;
            }
        }
Esempio n. 2
0
 static void ManageCalendarRestricted(Database_Calendar calendar)
 {
     calendar.DisplayCalendar(); //only shows the academic calendar
 }