示例#1
0
        public Course(String name, String subject, String number, int capacity, CollegeProgram primaryProgram)
        {
            Name     = name;
            Subject  = subject;
            Number   = number;
            Capacity = capacity;
            Programs = new List <CollegeProgram>();
            Programs.Add(primaryProgram);
            primaryProgram.addCourse(this);

            students    = new List <Student>();
            instructors = new List <Staff>();
        }
示例#2
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            //Load our data model and prime some data...
            m = new DataModel();
            var ComputerProgrammer = new CollegeProgram("Computer Programmer", CollegeProgram.CollegeCredentials.Diploma, 3);

            m.Programs.Add(ComputerProgrammer);
            m.Programs.Add(new CollegeProgram("Paralegal", CollegeProgram.CollegeCredentials.Certificate, 1));



            IPerson CEO = new Staff("Jane", "Doe", "CEO", 1000000, DateTime.Parse("Jan 6, 2010"), null);
            Staff   vp  = new Staff("John", "Doe", "VP", 500000, DateTime.Parse("Jan 25, 2013"), (Staff)CEO);

            m.People.Add(CEO);
            m.People.Add(vp);


            Course c = new Course("Intro to C#", "COMP", "1098", 35, ComputerProgrammer);

            c.registerInstructor(vp);
            Student s = new Student("Tim", "Cook", new DateTime(1960, 11, 01));

            c.registerStudent(s);

            m.Courses.Add(c);
            m.People.Add(s);
            s = new Student("Steve", "Jobs", new DateTime(1955, 02, 24));
            c.registerStudent(s);
            m.People.Add(s);



            UpdatePersonGridData();
            UpdateProgramGridData();
            UpdateCourseGridData();
        }