Пример #1
0
        public EditGroupsForm(DBManager aDBManager, int classID)
        {
            InitializeComponent();

            mDBManager = aDBManager;
            mClass = mDBManager.Classes[0];
            foreach(var c in mDBManager.Classes){
                if(c.ID == classID){
                    mClass = c;
                    break;
                }
            }

            gridviewGroups.Columns.Add("Име");
            gridviewGroups.AllowAutoSizeColumns = true;
            gridviewGroups.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            gridviewGroups.AllowDrop = false;
            gridviewGroups.AllowMultiColumnSorting = false;
            gridviewGroups.AllowDragToGroup = false;
            gridviewGroups.ShowGroupPanel = false;

            try
            {
                foreach (var group in mClass.Groups)
                {
                    gridviewGroups.Rows.Add(group);
                }
            }
            catch {
                mClass.Groups = new List<string>();
            }
        }
Пример #2
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;
 }
Пример #3
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;
        }
Пример #4
0
 private void ImportClasses(ref OleDbConnection connection)
 {
     string DetailsSelect = "SELECT [cd].[Class] AS [Class], " +
                            "[cd].Group AS [Group], " +
                            "[cd].[ClassType] AS [ClassTypeID], " +
                            "cd.[BasicClass] AS [BasicClassID], " +
                            "cd.[ClassEdform] AS [EducationFormID]" +
                            "FROM [Class Details] cd";
     OleDbCommand DetailsQuery = new OleDbCommand(DetailsSelect, connection);
     List<ClassDetails> AllDetails = new List<ClassDetails> { };
     using (OleDbDataReader DetailsReader = DetailsQuery.ExecuteReader())
     {
         while (DetailsReader.Read())
         {
             ClassDetails d = new ClassDetails(int.Parse(DetailsReader["Class"].ToString()),
                                               int.Parse(DetailsReader["Group"].ToString()),
                                               this.mTypes.Single(x => x.ID == int.Parse(DetailsReader["ClassTypeID"].ToString())).ShallowCopy(),
                                               this.mBasicClasses.Single(x => x.ID == int.Parse(DetailsReader["BasicClassID"].ToString())).ShallowCopy(),
                                               this.mEducationForms.Single(x => x.ID == int.Parse(DetailsReader["EducationFormID"].ToString())).ShallowCopy());
             AllDetails.Add(d);
         }
     }
     string ClassesSelect = "SELECT [cc].[Class ID] AS [ID], [p].[Paralell class Name] AS [Division], [cc].[Class No] AS [Number] FROM [Code Class] AS [cc] LEFT JOIN [Code Paralell class] AS [p] ON [cc].[Class No] = [p].[Paralell class ID]";
     OleDbCommand ClassesQuery = new OleDbCommand(ClassesSelect, connection);
     using (OleDbDataReader ClassesReader = ClassesQuery.ExecuteReader())
     {
         while (ClassesReader.Read())
         {
             BasicClass bc = this.mBasicClasses.Single(x => x.ID == int.Parse(ClassesReader["Number"].ToString()));
             int id = int.Parse(ClassesReader["ID"].ToString());
             List<ClassDetails> details = AllDetails.Where(x => x.ID == id).ToList();
             Class c = new Class(id,
                                 ClassesReader["Division"].ToString(),
                                 bc);
             foreach (var item in details)
             {
                 item.SetDetailed(c);
             }
             c.SetDetails(details);
             c.ShortName = c.Name;
             this.mClasses.Add(c);
         }
     }
 }
Пример #5
0
 public ClassSchedule(Class aClass, List<Lesson> lessons)
 {
     this.mLessons = lessons;
     this.mClass = aClass;
 }
Пример #6
0
 public Lesson(Class aClass, Subject subject, List<Group> groups)
 {
     this.mTeachers = groups;
     this.mClass = aClass;
     this.mSubject = subject;
 }
Пример #7
0
        public AddOrEditClassForm(DBManager dbManag, int aID)
        {
            InitializeComponent();

            mDBManager = dbManag;
            mID = aID;

            var cl = from c in mDBManager.Classes
                    where c.ID == aID
                    select c;
            mClass = cl.FirstOrDefault();

            this.Text = FormTitles.ClassForm.Edit;
            mFormState = FormState.Editing;

            nameTextbox.Text = mClass.Name;
            shortNameTextbox.Text = mClass.ShortName;

            long headTeacherID = -1;
            foreach (Teacher t in mDBManager.Teachers)
            {
                if (t.ID == mClass.HeadTeacherID)
                {
                    headTeacherID = t.ID;
                    break;
                }
            }

            Teacher teacher = null;
            foreach (var t in mDBManager.Teachers)
            {
                if (t.ID == headTeacherID)
                {
                    teacher = t;
                }
            }

            if (teacher != null)
            {
                this.mHeadTeacher = teacher;
                headTeacherNameLabel.Text = this.mHeadTeacher.Name;

                changingHeadteacherReadyButton.Visible = false;
                teachersDropdownlist.Visible = false;
            }

            else
            {
                changeHeadTeacherButton.Visible = false;
                changingHeadteacherReadyButton.Visible = true;
                teachersDropdownlist.Visible = true;
            }

            if (mClass.Color != Color.Empty)
            {
                colorPanel.BackColor = mClass.Color;
            }
            else{
                colorPanel.BackColor = RandomColor.GetRandomColor();
            }

            RadListDataItem dropDownItem = new RadListDataItem("1");
            dropDownItem.Value = 1;
            gradeDropdownlist.Items.Add(dropDownItem);
            for(int i = 2; i <= 12; ++i){
                dropDownItem = new RadListDataItem(i.ToString());
                dropDownItem.Value = i;
                gradeDropdownlist.Items.Add(dropDownItem);
            }

            try
            {
                gradeDropdownlist.Items[mClass.Grade - 1].Selected = true;
            }
            catch { }

            importTeachersFromTheDatabase();
        }
Пример #8
0
 public ClassDetails(int id, int group, ClassType type, BasicClass bclass, EducationForm educationform, Class detailed)
     : this(id, group, type, bclass, educationform)
 {
     this.SetDetailed(detailed);
 }
Пример #9
0
 public void SetDetailed(Class detailed)
 {
     if (!this.mIsDetailedSet)
     {
         this.mDetailed = detailed;
         this.mIsDetailedSet = true;
     }
 }