Beispiel #1
0
        //creates new Gradebook and sends it to GradebookUI.CommandPrompt()
        public static void NewGradebookCommand(string command)
        {
            var parts = command.Split(' ');

            if (parts.Length != 3)
            {
                Console.WriteLine("Command not valid, Create requires a name, and class period.");
                return;
            }
            var       className = parts[1];
            int       period    = Convert.ToInt32(parts[2]);
            Gradebook gradebook = new Gradebook(className, period);

            Console.WriteLine("Created gradebook {0}.", className);
            GradebookUI.CommandPrompt(gradebook);
        }
Beispiel #2
0
        //opens gradebook by calling Gradebook.Load() and sends it to GradebookUI.CommandPrompt()
        public static void OpenCommand(string command)
        {
            var parts = command.Split(' ');

            if (parts.Length != 2)
            {
                Console.WriteLine("Invalid Command, requires a name.");
                return;
            }
            var name      = parts[1];
            var gradeBook = Gradebook.Load(name);

            if (gradeBook == null)
            {
                return;
            }

            GradebookUI.CommandPrompt(gradeBook);
        }