Ejemplo n.º 1
0
        private Label labelShowTotal;          //total number of entries label

        public UBCFiltersForm(Options option, UBCInfoRegEntities dbContext,
                              DataGridView dataGridViewData, Label labelShowTotal)
        {
            InitializeComponent();
            this.option           = option;
            this.dbContext        = dbContext;
            this.dataGridViewData = dataGridViewData;
            this.labelShowTotal   = labelShowTotal;

            //modify form according to selected option
            switch (this.option)
            {
            case Options.Courses:
            case Options.Add_Delete_Course:
                ShowCourseFilters();
                break;

            case Options.Instructors:
                ShowInstructorFilters();
                break;

            case Options.Students:
                ShowStudentFilters();
                break;

            case Options.Registrations:
                ShowRegistrationSectionFilters();
                break;

            case Options.Add_Delete_Section:
                ShowRegistrationSectionFilters();
                break;
            } //end switch
        }
Ejemplo n.º 2
0
        private UBCInfoRegEntities dbContext; //database context

        public UBCDataForm(Options option, Users user)
        {
            InitializeComponent();
            this.option = option;
            this.user   = user;
            dbContext   = new UBCInfoRegEntities();

            //load all DbSets into dbContext (local copies)
            dbContext.Cities.Load();
            dbContext.Courses.Load();
            dbContext.Departments.Load();
            dbContext.Instructors.Load();
            dbContext.Provinces.Load();
            dbContext.Registrations.Load();
            dbContext.Sections.Load();
            dbContext.Students.Load();

            //modify form according to selected option
            switch (this.option)
            {
            case Options.Departments:
                ShowDepartments();
                break;

            case Options.Courses:
            case Options.Add_Delete_Course:
                ShowCourses();
                break;

            case Options.Instructors:
                ShowInstructors();
                break;

            case Options.Students:
                ShowStudents();
                break;

            case Options.Registrations:
                ShowRegistration();
                break;

            case Options.Add_Delete_Section:
                ShowSections();
                break;
            } //end switch
        }