Example #1
0
 /// <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();
     }
 }
Example #2
0
        /// <summary>
        /// Create test Accounts.
        /// </summary>
        private void CreateTestContentAccounts()
        {
            AdministratorAccount administrator = new AdministratorAccount();

            administrator.Email    = "*****@*****.**";
            administrator.Password = "******".GetHashCode().ToString();
            administrator.Type     = "Administrator";
            dbConnector.SaveAccount(administrator);

            StudentAccount student = new StudentAccount();

            student.Email    = "*****@*****.**";
            student.Password = "******".GetHashCode().ToString();
            student.Type     = "Student";
            student.Classes  = dbConnector.GetClasses();
            dbConnector.SaveAccount(student);
        }
Example #3
0
 public void Submit(string courseNo, string section, string className,
                    int credits, string location, string instructor, DateTime timeStart,
                    DateTime timeEnd, DateTime startDate, DateTime endDate, string classDays)
 {
     if (db.DoesClassExist(courseNo, section))
     {
         PopUpWindow.Display("A class with course number: " + courseNo + " and section: " + section + " already exists.");
     }
     else
     {
         this.db.CreateClass(courseNo, section, className,
                             credits, location, instructor, timeStart,
                             timeEnd, startDate, endDate, classDays);
         classList.Update(db.GetClasses());
         createClassForm.ClearForm();
         PopUpWindow.Display("Class: " + courseNo + ", section: " + section + ", added!");
     }
 }