Exemplo n.º 1
0
 /// <summary>
 /// Class constructor. Fills '-' in the classroom and building properties for 'Jazyky' lessons. 
 /// </summary>
 /// <param name="dep">Department class.</param>
 /// <param name="c">Course class.</param>
 /// <param name="lec">Lecture class.</param>
 /// <param name="ler">Lecturer class input.</param>
 /// <param name="d">Day class input.</param>
 /// <param name="t">Time class input.</param>
 /// <param name="b">Building class input.</param>
 /// <param name="cr">Classroom class input.</param>
 public TimetableField(Department dep, Course c, Lecture lec, Lecturer ler, Day d, Time t, Building b, Classroom cr, TimetableInfo ti)
 {
     department = dep.name;
     department_acr = dep.acronym;
     lecture_name = c.name;
     lecture_acr = c.acronym;
     //if (lec.practice.Equals("1") && lecture_acr != "JAZ")
     lecture_acr += lec.tag;
     color = dep.color;
     if (lec.period == "0")
         period = "Ano";
     else
         period = "Ne";
     duration = lec.duration;   //will be replaced to the config setting
     string prefix = ti.PrefixPoolLink;
     string sufix = ti.SufixPoolLink;
     course_href = prefix + dep.code + c.acronym.Replace(@"/", "") + sufix;
     tag = lec.tag;
     practice = lec.practice;
     lecturer = ler.name;
     day = d.name;
     day_order = d.daysOrder;
     time_hours = t.hours;
     time_minutes = t.minutes;
     time = t.acronym;
     time_order = t.timesOrder;
     building = b.name;
     classroom = cr.name;
     RecalculateUniqueID();
 }
Exemplo n.º 2
0
 private void SetValues(TimetableInfo ti)
 {
     Id = ti.Id;
     SufixPoolLink = ti.SufixPoolLink;
     PrefixPoolLink = ti.PrefixPoolLink;
     TimetableLabel = ti.TimetableLabel;
     TimetableXMLFilePath = ti.TimetableXMLFilePath;
     SemesterEnd = ti.SemesterEnd;
     SemesterStart = ti.SemesterStart;
     Created = ti.Created;
     LinkToAdditionalInformation = ti.LinkToAdditionalInformation;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Reloads xml file, parses and initializes properties which holds base data of the application. This method should be used for refreshing the model after updating thxml with timetable.
        /// </summary>
        /// <param name="xmlPath">Path to the source xml file.</param>
        /// <returns>True if the databaze was successfuly loaded</returns>
        public bool Load(string xmlPath)
        {
            log.Debug("Method entry.");

            m_departments = new List<Department>();
            m_courses = new List<Course>();
            m_lectures = new List<Lecture>();
            m_lecturers = new List<Lecturer>();
            m_days = new List<Day>();
            m_times = new List<Time>();
            m_buildings = new List<Building>();
            m_classrooms = new List<Classroom>();
            m_degreeyears = new List<DegreeYear>();
            m_specializations = new List<Specialization>();
            m_lessons = new List<Lesson>();
            m_groups = new List<Group>();
            m_groupLessonBinder = new List<GroupLessonBinder>();
            m_timetableInfo = new TimetableInfo();

            if (!this.LoadOneXMLTimetableFromFile(xmlPath))
            {
                log.Debug("Method exit.");
                return false;
            }
            if (!this.ParseData())
            {
                log.Debug("Method exit.");
                return false;
            }
            log.Debug("Method exit.");
            return true;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Copy properties (data) from one instance to this.
 /// </summary>
 /// <param name="src">Source instance.</param>
 public void Copy(OneXMLTimetable src)
 {
     m_buildings = src.m_buildings;
     m_classrooms = src.m_classrooms;
     m_courses = src.m_courses;
     m_days = src.m_days;
     m_degreeyears = src.m_degreeyears;
     m_departments = src.m_departments;
     m_groupLessonBinder = src.m_groupLessonBinder;
     m_groups = src.m_groups;
     m_lecturers = src.m_lecturers;
     m_lectures = src.m_lectures;
     m_lessons = src.m_lessons;
     m_specializations = src.m_specializations;
     m_times = src.m_times;
     m_timetableInfo = src.m_timetableInfo;
     m_xelDefinitions = src.m_xelDefinitions;
 }