void openForm(FormTypes formType, long ID)
 {
     if (ID != -1) // -1 indicates that there's no selected row in the current gridview
     {
         object Form = new Form();
         switch (formType)
         {
             case FormTypes.EditGroups:
                 Form = new EditGroupsForm(mDBManager, (int)ID);
                 break;
             case FormTypes.AddOrEditClassForm:
                 Form = new AddOrEditClassForm(mDBManager, (int)ID);
                 break;
             case FormTypes.AddOrEditClassroomForm:
                 Form = new AddOrEditClassroomForm(mDBManager, ID);
                 break;
             case FormTypes.AddOrEditSubjectForm:
                 Form = new AddOrEditSubjectForm(mDBManager, ID);
                 break;
             case FormTypes.AddOrEditTeacherForm:
                 Form = new AddOrEditTeacherForm(mDBManager, ID);
                 break;
             case FormTypes.AddOrEditLessonForm:
                 Form = new AddOrEditLessonForm(mDBManager, (int)ID);
                 break;
             case FormTypes.SetTimeoffForm:
                 ObjectType type = ObjectType.Subject;
                 switch (pageviewManageDatabase.SelectedPage.Name)
                 {
                     case "pageSubjects":
                         type = ObjectType.Subject;
                         break;
                     case "pageTeachers":
                         type = ObjectType.Teacher;
                         break;
                     case "pageClasses":
                         type = ObjectType.Class;
                         break;
                     case "pageClassrooms":
                         type = ObjectType.Classroom;
                         break;
                     case "pageLessons":
                         type = ObjectType.Lesson;
                         break;
                 }
                 Form = new SetTimeoffForm(mDBManager, type, ID);
                 break;
         }
         (Form as Form).FormClosed += onSomeFormClosed;
         (Form as Form).Show();
     }
 }
 void openForm(FormTypes formType)
 {
     object Form = new Form();
     switch(formType){
         case FormTypes.AddOrEditClassForm:
             Form = new AddOrEditClassForm(mDBManager);
             break;
         case FormTypes.AddOrEditClassroomForm:
             Form = new AddOrEditClassroomForm(mDBManager);
             break;
         case FormTypes.AddOrEditSubjectForm:
             Form = new AddOrEditSubjectForm(mDBManager);
             break;
         case FormTypes.AddOrEditTeacherForm:
             Form = new AddOrEditTeacherForm(mDBManager);
             break;
         case FormTypes.AddOrEditLessonForm:
             Form = new AddOrEditLessonForm(mDBManager);
             break;
     }
     (Form as Form).FormClosed += onSomeFormClosed;
     (Form as Form).Show();
 }