/// <summary>
 /// Display the Activity workspace form.
 /// </summary>
 /// <param name="type"></param>
 public void ShowActivityWorkspace(string type)
 {
     if (type == "Student")
     {
         RegistrationController registerController = new RegistrationController(this.db, this);
         List <Class>           classes            = db.GetClasses();
         RegisterForClassForm   registerForm       = new RegisterForClassForm(this, registerController, classes);
         registerController.registerForm = registerForm;
         ClassWorksheet classWorksheet = new ClassWorksheet((StudentAccount)this.GetLoggedInUser());
         registerController.classWorksheet = classWorksheet;
         RegisterForClass activityWindow = new RegisterForClass(this, registerController, registerForm, classWorksheet);
         activityWindow.Text = "Register for class";
         activityWindow.Show();
     }
     else if (type == "Administrator")
     {
         ClassController createClassControl = new ClassController(this.db, this);
         ClassList       classList          = new ClassList(db.GetClasses());
         createClassControl.classList = classList;
         CreateClassForm createClassForm = new CreateClassForm(createClassControl);
         createClassControl.createClassForm = createClassForm;
         CreateClass activityWindow = new CreateClass(this, createClassControl, classList, createClassForm);
         activityWindow.Text = "Create class Activity Window";
         activityWindow.Show();
     }
     else
     {
         ActivityWindow activityWindow = new ActivityWindow(this);
         activityWindow.Text = "Avtivity Window";
         activityWindow.Show();
     }
 }
Exemple #2
0
        /// <summary>
        /// Opens the class creation window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateClassButton_Click(object sender, EventArgs e)
        {
            CreateClass ClassCreationWindow = new CreateClass(connection, admin);

            ClassCreationWindow.Show();
        }