public Mark(Teacher teacher, Pupil pupil, string for_what, int value) { this.teacher = teacher; this.pupil = pupil; this.for_what = for_what; this.value = value; }
public Lesson(Subject subject, string theme, Teacher teacher, PupilsGroup pupil_group) { this.subject = subject; this.topic = theme; this.teacher = teacher; this.pupil_group = pupil_group; marks = new List<Mark>(); }
// constructors public Mark() { point = default(int); markGround = default(MarkGround); pupil = default(Pupil); pupilID = default(int); teacher = default(Teacher); teacherID = default(int); }
// contructors public Lecture() { date = default(DateTime); subject = default(Subject); subjectTopics = default(List<string>); teacher = default(Teacher); studyGroup = default(StudyGroup); marks = default(List<Mark>); }
public Mark(int point_, Pupil pupil_, Teacher teacher_, MarkGround markGround_) { if (point_ < 1 || point_ > 10) { throw new ArgumentOutOfRangeException("In Mark.Mark(int, Pupil, Teacher, MarkGround): the point is out of range."); } point = point_; pupil = pupil_; pupilID = pupil_.PupilID; teacher = teacher_; teacherID = teacher_.TeacherID; markGround = markGround_; }
public Lecture(DateTime date_, Subject subject_, List<string> subjectTopics_, Teacher teacher_, StudyGroup studyGroup_) { if (subject_.topics.Intersect(subjectTopics_).Count() != subjectTopics_.Count) { throw new InvalidOperationException("In Lecture.Lecture(Subject, List<string>, Teacher, StudyGroup): the subject contains not all of the given topics."); } date = date_; subject = subject_; subjectTopics = subjectTopics_; teacher = teacher_; teacherID = teacher_.TeacherID; studyGroup = studyGroup_; groupID = studyGroup_.GroupID; marks = new List<Mark>(); }
static void Main(string[] args) { Teacher teacher = new Teacher("Maks"); Pupil pupil1 = new Pupil("Andrew"); Pupil pupil2 = new Pupil("Kolya"); Pupil pupil3 = new Pupil("Olya"); Pupil pupil4 = new Pupil("Ira"); PupilsGroup pupils_group = new PupilsGroup("P11014"); pupils_group.pupils.Add(pupil1); pupils_group.pupils.Add(pupil2); pupils_group.pupils.Add(pupil3); pupils_group.pupils.Add(pupil4); Subject subject = new Subject("C#"); subject.topics.Add("Binary and xml serializations"); subject.topics.Add("Global project"); Lesson lesson1 = new Lesson(subject, subject.topics[0], teacher, pupils_group); lesson1.ManageLesson(); Console.ReadLine(); }
static void Main(string[] args) { List<Teacher> teachers = new List<Teacher>(); List<PupilsGroup> pupilGroups = new List<PupilsGroup>(); Teacher Max = new Teacher("Max"); Max.login = "******"; Max.password = "******"; teachers.Add(Max); Pupil pupil1 = new Pupil("Andrew"); Pupil pupil2 = new Pupil("Kolya"); Pupil pupil3 = new Pupil("Olya"); Pupil pupil4 = new Pupil("Ira"); PupilsGroup pupils_group1 = new PupilsGroup("P11014"); pupils_group1.pupils.Add(pupil1.pupilId, pupil1); pupils_group1.pupils.Add(pupil2.pupilId, pupil2); pupils_group1.pupils.Add(pupil3.pupilId, pupil3); pupils_group1.pupils.Add(pupil4.pupilId, pupil4); pupilGroups.Add(pupils_group1); Subject subject = new Subject("C#"); subject.topics.Add("Binary and xml serializations"); subject.topics.Add("Global project"); Lesson lesson1 = new Lesson(subject, subject.topics[0], Max, pupils_group1); lesson1.ManageLesson(); Teacher Alex = new Teacher("Alex"); Alex.login = "******"; Alex.password = "******"; teachers.Add(Alex); Pupil pupil11 = new Pupil("Jon"); Pupil pupil22 = new Pupil("Brad"); Pupil pupil33 = new Pupil("Josh"); Pupil pupil44 = new Pupil("Katrin"); PupilsGroup pupils_group2 = new PupilsGroup("P11015"); pupils_group2.pupils.Add(pupil11.pupilId, pupil11); pupils_group2.pupils.Add(pupil22.pupilId, pupil22); pupils_group2.pupils.Add(pupil33.pupilId, pupil33); pupils_group2.pupils.Add(pupil44.pupilId, pupil44); pupilGroups.Add(pupils_group2); Lesson lesson2 = new Lesson(subject, subject.topics[0], Alex, pupils_group2); //lesson2.ManageLesson(); List<Lesson> lessons = new List<Lesson>(); lessons.Add(lesson1); lessons.Add(lesson2); XML<List<PupilsGroup>>.Serialize(path + "pupilGroups.xml", pupilGroups); XML<List<Lesson>>.Serialize(path + "lessons.xml", lessons); XML<List<Teacher>>.Serialize(path + "teachers.xml", teachers); Console.ReadLine(); }