示例#1
0
 public Curriculum(int id, Subject aSubject, Class aClass, ClassDetails aGroup, Teacher aTeacher, int hoursPerWeek)
 {
     this.mID = id;
     this.mSubject = aSubject;
     this.mClass = aClass;
     this.mGroup = aGroup;
     this.mTeacher = aTeacher;
     this.mHoursPerWeek = hoursPerWeek;
     this.mHourLenght = Utility.HourLenght.NoMatter;
 }
示例#2
0
        public Curriculum(Teacher aTeacher, Subject aSubject, Class aClass, Classroom aDesiredClassroom, List<Classroom> aAlternativeClassrooms, HourLenght aHourLenght, int aHoursPerWeek)
        {
            mID = IndexMaker.Lesson();

            this.mTeacher = aTeacher;
            this.mSubject = aSubject;
            this.mClass = aClass;
            this.mTeacher = aTeacher;
            this.mHourLenght = Utility.HourLenght.NoMatter;
            this.mHoursPerWeek = aHoursPerWeek;
            this.mDesiredClassroom = aDesiredClassroom;
            this.AlternativeClassrooms = aAlternativeClassrooms;
        }
        public AddOrEditSubjectForm(DBManager aDBManager, long aID)
        {
            InitializeComponent();

            mDBManager = aDBManager;
            mID = aID;
            mFormState = FormState.Editing;
            this.Text = FormTitles.SubjectForm.Edit;

            foreach (var subject in mDBManager.Subjects)
            {
                if (subject.ID == aID)
                {
                    mSubject = subject;
                    break;
                }
            }

            textboxName.Text = mSubject.Name;
            textboxShortName.Text = mSubject.ShortName;

            if (mSubject.Color != Color.Empty)
            {
                groupboxColorPanelColor.BackColor = mSubject.Color;
            }
            else
            {
                groupboxColorPanelColor.BackColor = RandomColor.GetRandomColor();
            }

            switch (mSubject.Difficulty)
            {
                case RelativeSubjectDifficulty.Low:
                    barComplexity.Value = 1;
                    break;
                case RelativeSubjectDifficulty.Normal:
                    barComplexity.Value = 2;
                    break;
                case RelativeSubjectDifficulty.High:
                    barComplexity.Value = 3;
                    break;
            }

            barComplexity.Maximum = 3;
            barComplexity.Minimum = 1;
            barComplexity.TickFrequency = 1;
        }
示例#4
0
        private void ImportSubjects(ref OleDbConnection connection)
        {
            string SubjectGroupsSelect = "SELECT * FROM [Code SubjectGroup]";
            OleDbCommand ClassesQuery = new OleDbCommand(SubjectGroupsSelect, connection);

            Dictionary<int, SubjectGroup> d = new Dictionary<int, SubjectGroup>() { };
            using (OleDbDataReader GroupsReader = ClassesQuery.ExecuteReader())
            {
                while (GroupsReader.Read())
                {
                    int id = int.Parse(GroupsReader["SubjGroup ID"].ToString());
                    int norma;
                    if (int.TryParse(GroupsReader["NormaBasic"].ToString(), out norma) == false)
                    {
                        norma = 0;
                    }
                    SubjectGroup group = new SubjectGroup(
                        id,
                        GroupsReader["SubjGroup Name"].ToString(),
                        norma);
                    d.Add(id, group);
                }
            }
            string SubjectsSelect = "SELECT * FROM [Code Subject] WHERE [Subject Name] IS NOT NULL";
            OleDbCommand SubjectsQuery = new OleDbCommand(SubjectsSelect, connection);
            using (OleDbDataReader SubjectsReader = SubjectsQuery.ExecuteReader())
            {
                while (SubjectsReader.Read())
                {
                    int id = int.Parse(SubjectsReader["Subject ID"].ToString());

                    int group_id = int.Parse(SubjectsReader["SubjectGroup"].ToString());
                    string name = SubjectsReader["Subject Name"].ToString();
                    SubjectGroup gr = d[group_id];
                    Subject s = new Subject(id, name, gr);
                    this.mSubjects.Add(s);
                }
            }
        }
示例#5
0
 public Lesson(Class aClass, Subject subject, List<Group> groups)
 {
     this.mTeachers = groups;
     this.mClass = aClass;
     this.mSubject = subject;
 }