Пример #1
0
        /// <summary>
        /// The class supporting the main menu form.
        /// </summary>

        /*
         * NAME
         *
         * App_Form::App - The constructor for the class
         *
         * DESCRIPTION
         *
         * This function will instantiate the form. It also initializes the sentences on the dashboard.
         */
        public App()
        {
            InitializeComponent();
            string greeting = "Teacher";

            {
                Teacher teacher = IO.Load_Teacher();
                try
                {
                    if (teacher.First_Name != string.Empty)
                    {
                        greeting = teacher.First_Name;
                    }
                }
                catch (Exception e)
                {
                    new Log(e, "App_Form.cs: Constructor", "Teacher not assigned at start");
                }
            }

            welcome_label.Text      = "Welcome, " + greeting + "!";
            num_students_label.Text = "You have " + Database_Interface.Query_Num_Students() + " students in your class.";
            high_score.Text         = "The highest reading level in your class is " + Database_Interface.Query_Max_Level() + ".";
        }