示例#1
0
        public override void SelectItem(ListboxEntry <Grade> item)
        {
            Grade   grade = item.Entry;
            TextBox txt   = Options.NameText;

            txt.Text = grade.Letter == null ? "" : grade.Letter;
        }
示例#2
0
        public override void SelectItem(ListboxEntry <Department> item)
        {
            Department dept = item.Entry;
            TextBox    txt  = Options.NameText;

            txt.Text = dept.Name == null ? "" : dept.Name;
        }
        public override void SubmitAdd()
        {
            ListboxEntry <Person> selectedPerson = Options.PersonComboBox.SelectedItem as ListboxEntry <Person>;
            int personKey = selectedPerson.Entry.Id;

            ListboxEntry <Course> selectedCourse = Options.CourseComboBox.SelectedItem as ListboxEntry <Course>;
            int courseKey = selectedCourse.Entry.Id;

            ListboxEntry <Semester> selectedSemester = Options.SemesterComboBox.SelectedItem as ListboxEntry <Semester>;
            int semesterKey = selectedSemester.Entry.Id;

            ListboxEntry <Section> selectedSection = Options.SectionComboBox.SelectedItem as ListboxEntry <Section>;
            int sectionKey = selectedSection.Entry.Id;

            ListboxEntry <Grade> selectedGrade = Options.GradeComboBox.SelectedItem as ListboxEntry <Grade>;
            int gradeKey = selectedGrade.Entry.Id;

            Enrollment enrollment = new Enrollment()
            {
                Person_ID     = personKey,
                Semester      = semesterKey,
                Course_ID     = courseKey,
                Section_ID    = sectionKey,
                FinalGrade_ID = gradeKey
            };

            Options.PersonComboBox.SelectedItem   = defaultIndex;
            Options.CourseComboBox.SelectedItem   = defaultIndex;
            Options.SemesterComboBox.SelectedItem = defaultIndex;
            Options.SectionComboBox.SelectedItem  = defaultIndex;
            Options.GradeComboBox.SelectedItem    = defaultIndex;
            DataSet.Add(enrollment);
            SaveChanges();
        }
示例#4
0
        public override void SubmitAdd()
        {
            ListboxEntry <Faculty> selectedFaculty = Options.FacultyComboBox.SelectedItem as ListboxEntry <Faculty>;
            int personKey = selectedFaculty.Entry.Id;

            ListboxEntry <Course> selectedCourse = Options.CourseComboBox.SelectedItem as ListboxEntry <Course>;
            int courseKey = selectedCourse.Entry.Id;

            ListboxEntry <Semester> selectedSemester = Options.SemesterComboBox.SelectedItem as ListboxEntry <Semester>;
            int semesterKey = selectedSemester.Entry.Id;

            string name = Options.SectionNameText.Text;


            Section section = new Section()
            {
                Name        = name,
                Faculty_ID  = personKey,
                Semester_ID = semesterKey,
                Course_ID   = courseKey
            };

            Options.FacultyComboBox.SelectedItem  = defaultIndex;
            Options.CourseComboBox.SelectedItem   = defaultIndex;
            Options.SemesterComboBox.SelectedItem = defaultIndex;

            DataSet.Add(section);
            SaveChanges();
        }
        public override void SubmitUpdate()
        {
            Major          major = (Major)SelectedEntry.Entry;
            String         name  = Options.NameText.Text;
            Nullable <int> key   = null;

            ListboxEntry <Department> selected = Options.DeparmentComboBox.SelectedItem as ListboxEntry <Department>;

            if (selected.Entry == null)
            {
                key = null;
            }
            else
            {
                key = selected.Entry.Id;
            }


            if (major == null)
            {
                return;
            }

            major.Name          = name;
            major.Department_Id = key;
            SaveChanges();
        }
        public override void SelectItem(ListboxEntry <Season> item)
        {
            Season  season = item.Entry;
            TextBox txt    = Options.NameText;

            txt.Text = season.Name == null ? "" : season.Name;
        }
        public override void SubmitAdd()
        {
            String name = Options.NameText.Text;

            Nullable <int>            key      = null;
            ListboxEntry <Department> selected = Options.DeparmentComboBox.SelectedItem as ListboxEntry <Department>;

            if (selected.Entry == null)
            {
                key = null;
            }
            else
            {
                key = selected.Entry.Id;
            }
            Major grade = new Major()
            {
                Name = name, Department_Id = key
            };


            Options.NameText.Text = "";
            Options.DeparmentComboBox.SelectedIndex = defaultIndex;
            DataSet.Add(grade);
            SaveChanges();
        }
        public override void SelectItem(ListboxEntry <Person> item)
        {
            Person person = item.Entry;

            Options.NameText.Text   = person.Name == null ? "" : person.Name;
            Options.EmailText.Text  = person.Email == null ? "" : person.Email;
            Options.NumberText.Text = person.Number == null ? "" : person.Number;
        }
示例#9
0
        public override void SelectItem(ListboxEntry <Faculty> item)
        {
            Faculty faculty = item.Entry;

            ListboxEntry <Person> selected = findPerson(faculty.Person_Id);

            Options.PersonComboBox.SelectedItem = selected;
        }
        public void generalListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListboxEntry <T> entry = SelectedEntry;

            if (entry != null)
            {
                SelectItem(entry);
            }
        }
示例#11
0
        public override void SelectItem(ListboxEntry <Semester> item)
        {
            Semester semester = item.Entry;

            Options.YearText.Text = Convert.ToString(semester.Year);
            ListboxEntry <Season> selected = findSeasons(semester.Season);

            Options.SeasonComboBox.SelectedItem = selected;
        }
示例#12
0
        public override void SubmitUpdate()
        {
            Faculty faculty = (Faculty)SelectedEntry.Entry;



            ListboxEntry <Person> selected = findPerson(faculty.Person_Id);

            faculty.Person_Id = selected.Entry.Id;
            SaveChanges();
        }
        public override void SubmitUpdate()
        {
            ListboxEntry <Person> pEntry = SelectedEntry;

            Person person = pEntry.Entry;

            person.Name   = Options.NameText.Text;
            person.Email  = Options.EmailText.Text;
            person.Number = Options.NumberText.Text;
            SaveChanges();
        }
示例#14
0
        public override void SelectItem(ListboxEntry <Student> item)
        {
            Student student = item.Entry;

            ListboxEntry <Person> selected = findPerson(student.Person_Id);

            ListboxEntry <Major> majorSelected = findMajor(student.Major_Id);

            Options.PersonComboBox.SelectedItem = selected;
            Options.MajorComboBox.SelectedItem  = majorSelected;
        }
        public override void SelectItem(ListboxEntry <Major> item)
        {
            Major majorm = item.Entry;

            Options.NameText.Text = majorm.Name == null ? "" : majorm.Name;
            Nullable <int> key = majorm.Department_Id;


            ListboxEntry <Department> selected = findDepartment(key);

            Options.DeparmentComboBox.SelectedItem = selected;
        }
示例#16
0
        public override void SubmitUpdate()
        {
            Semester semester = (Semester)SelectedEntry.Entry;
            int      year     = Convert.ToInt32(Options.YearText.Text);


            ListboxEntry <Season> selected = Options.SeasonComboBox.SelectedItem as ListboxEntry <Season>;

            semester.Year   = year;
            semester.Season = selected.Entry.Id;
            SaveChanges();
        }
示例#17
0
        public override void SubmitUpdate()
        {
            Student student = (Student)SelectedEntry.Entry;

            ListboxEntry <Person> selected      = Options.PersonComboBox.SelectedItem as ListboxEntry <Person>;
            ListboxEntry <Major>  MajorSelected = Options.MajorComboBox.SelectedItem as ListboxEntry <Major>;

            student.Major_Id  = MajorSelected.Entry.Id;
            student.Person_Id = selected.Entry.Id;
            student.Person    = selected.Entry;
            SaveChanges();
        }
        public override void SelectItem(ListboxEntry <Course> item)
        {
            Course course = item.Entry;

            Options.NumberText.Text = Convert.ToString(course.Number);
            Options.NameText.Text   = course.Name;

            ListboxEntry <Department> selectedDept  = findDepartment(course.Department);
            ListboxEntry <Major>      selectedMajor = findMajor(course.Major);

            Options.DeparmentComboBox.SelectedItem = selectedDept;
            Options.MajorComboBox.SelectedItem     = selectedMajor;
        }
示例#19
0
        private Func <ListboxEntry <Student>, bool> generateFilter()
        {
            ListboxEntry <Major> box = Options.FilterComboBox.SelectedItem as ListboxEntry <Major>;

            if (box == null)
            {
                return(null);
            }
            else
            {
                return((student) => {
                    int semr = box.Entry.Id;
                    return student.Entry.Major_Id.HasValue && student.Entry.Major_Id.Value == semr;
                });
            }
        }
示例#20
0
        public override void SubmitAdd()
        {
            ListboxEntry <Person> selected = Options.PersonComboBox.SelectedItem as ListboxEntry <Person>;
            int key = selected.Entry.Id;

            Faculty semester = new Faculty()
            {
                Person_Id = key
            };



            Options.PersonComboBox.SelectedIndex = defaultIndex;
            DataSet.Add(semester);
            SaveChanges();
        }
示例#21
0
        private Func <ListboxEntry <Section>, bool> generateFilter()
        {
            ListboxEntry <Semester> box = Options.FilterComboBox.SelectedItem as ListboxEntry <Semester>;

            if (box == null)
            {
                return(null);
            }
            else
            {
                return((section) => {
                    int semr = box.Entry.Id;
                    return section.Entry.Semester_ID == semr;
                });
            }
        }
示例#22
0
        public override void SubmitUpdate()
        {
            Section section = (Section)SelectedEntry.Entry;

            ListboxEntry <Faculty>  selectedFaculty  = findFaculty(section.Faculty_ID);
            ListboxEntry <Semester> selectedSemester = findSemesters(section.Semester_ID);
            ListboxEntry <Course>   selectedCourse   = findCourses(section.Course_ID);

            section.Name        = Options.SectionNameText.Text;
            section.Faculty_ID  = selectedFaculty.Entry.Id;
            section.Semester_ID = selectedSemester.Entry.Id;
            section.Course_ID   = selectedCourse.Entry.Id;


            SaveChanges();
        }
示例#23
0
        public override void SubmitAdd()
        {
            ListboxEntry <Person> selected = Options.PersonComboBox.SelectedItem as ListboxEntry <Person>;
            int key = selected.Entry.Id;
            ListboxEntry <Major> MajorSelected = Options.MajorComboBox.SelectedItem as ListboxEntry <Major>;
            int majorKey = MajorSelected.Entry.Id;

            Student semester = new Student()
            {
                Person_Id = key, Major_Id = majorKey
            };

            Options.PersonComboBox.SelectedIndex = defaultIndex;
            DataSet.Add(semester);
            SaveChanges();
        }
        private Func <ListboxEntry <Enrollment>, bool> generateFilter()
        {
            ListboxEntry <Student> box = Options.FilterComboBox.SelectedItem as ListboxEntry <Student>;

            if (box == null)
            {
                return(null);
            }
            else
            {
                return((enroll) => {
                    int semr = box.Entry.Person.Id;
                    return enroll.Entry.Person_ID == semr;
                });
            }
        }
示例#25
0
        public override void SubmitAdd()
        {
            int year = Convert.ToInt32(Options.YearText.Text);

            ListboxEntry <Season> selected = Options.SeasonComboBox.SelectedItem as ListboxEntry <Season>;
            int key = selected.Entry.Id;

            Semester semester = new Semester()
            {
                Year = year, Season = key
            };


            Options.YearText.Text = "";
            Options.SeasonComboBox.SelectedIndex = defaultIndex;
            DataSet.Add(semester);
            SaveChanges();
        }
        private Func <ListboxEntry <Course>, bool> generateFilter()
        {
            ListboxEntry <Department> box = Options.FilterComboBox.SelectedItem as ListboxEntry <Department>;

            if (box == null)
            {
                return(null);
            }
            else
            {
                return((course) => {
                    int semr = box.Entry.Id;
                    return course.Entry.Department == semr;
                });
            }

            SaveChanges();
        }
示例#27
0
        public override void SelectItem(ListboxEntry <Section> item)
        {
            Section section = item.Entry;

            Options.SectionNameText.Text = section.Name;

            ListboxEntry <Faculty> selectedSection = findFaculty(section.Faculty_ID);

            Options.FacultyComboBox.SelectedItem = selectedSection;

            ListboxEntry <Semester> selectedSemester = findSemesters(section.Semester_ID);

            Options.SemesterComboBox.SelectedItem = selectedSemester;

            ListboxEntry <Course> selectedCourse = findCourses(section.Course_ID);

            Options.CourseComboBox.SelectedItem = selectedCourse;
        }
        public override void SubmitUpdate()
        {
            Course course = (Course)SelectedEntry.Entry;
            int    number = Convert.ToInt32(Options.NumberText.Text);
            string name   = Options.NameText.Text;


            ListboxEntry <Department> selectedDept = Options.DeparmentComboBox.SelectedItem as ListboxEntry <Department>;
            int keyDept = selectedDept.Entry.Id;

            ListboxEntry <Major> selectedMajor = Options.MajorComboBox.SelectedItem as ListboxEntry <Major>;
            int keyMajor = selectedMajor.Entry.Id;

            course.Number     = number;
            course.Name       = name;
            course.Department = keyDept;
            course.Major      = keyMajor;
            SaveChanges();
        }
        public override void SubmitUpdate()
        {
            Enrollment enrollment = (Enrollment)SelectedEntry.Entry;



            ListboxEntry <Person>   selectedPerson   = Options.PersonComboBox.SelectedItem as ListboxEntry <Person>;
            ListboxEntry <Semester> selectedSemester = Options.SemesterComboBox.SelectedItem as ListboxEntry <Semester>;
            ListboxEntry <Course>   selectedCourse   = Options.CourseComboBox.SelectedItem as ListboxEntry <Course>;
            ListboxEntry <Section>  selectedSection  = Options.SectionComboBox.SelectedItem as ListboxEntry <Section>;
            ListboxEntry <Grade>    selectedGrade    = Options.GradeComboBox.SelectedItem as ListboxEntry <Grade>;

            enrollment.Person_ID     = selectedPerson.Entry.Id;
            enrollment.Semester      = selectedSemester.Entry.Id;
            enrollment.Course_ID     = selectedCourse.Entry.Id;
            enrollment.Section_ID    = selectedSection.Entry.Id;
            enrollment.FinalGrade_ID = selectedGrade.Entry.Id;

            SaveChanges();
        }
        public override void SelectItem(ListboxEntry <Enrollment> item)
        {
            Enrollment            enrollment     = item.Entry;
            ListboxEntry <Person> selectedPerson = findPeople(enrollment.Person_ID);

            Options.PersonComboBox.SelectedItem = selectedPerson;

            ListboxEntry <Semester> selectedSemester = findSemesters(enrollment.Semester);

            Options.SemesterComboBox.SelectedItem = selectedSemester;

            ListboxEntry <Course> selectedCourse = findCourses(enrollment.Course_ID);

            Options.CourseComboBox.SelectedItem = selectedCourse;

            ListboxEntry <Section> selectedSection = findSections(enrollment.Section_ID);

            Options.SectionComboBox.SelectedItem = selectedSection;

            ListboxEntry <Grade> selectedGrade = findGrades(enrollment.FinalGrade_ID);

            Options.GradeComboBox.SelectedItem = selectedGrade;
        }