Exemple #1
0
 public LectureType(string rawname)
 {
     this.RawName  = rawname.Trim();
     this.RawNameL = this.RawName.ToLower();
     this.Name     = LectureType.ResolveRawName(this.RawName);
     this.Hash     = Library.GetHashString(this.RawNameL);
 }
        public static void SerializeCourseData(CourseJSON c)
        {
            LectureType lt = new LectureType(Library.SplitRawCourse(c.GetSubject())[1]);

            if (!ALL_LECTURE_TYPE.Contains(lt))
            {
                ALL_LECTURE_TYPE.Add(lt);
            }
            lt = ALL_LECTURE_TYPE[ALL_LECTURE_TYPE.IndexOf(lt)];

            CourseMain cm = new CourseMain(Library.SplitRawCourse(c.GetSubject())[0]);

            if (!ALL_COURSE_MAIN.Contains(cm))
            {
                ALL_COURSE_MAIN.Add(cm);
                COURSE_MAIN_SUBJ.Add(cm.Subject, cm);
            }
            cm = ALL_COURSE_MAIN[ALL_COURSE_MAIN.IndexOf(cm)];

            CourseEvent ce = new CourseEvent(c.GetDate(), c.GetStart(), c.GetEnd(), c.GetRoom(), c.GetBuilding(), c.GetTeacher(), cm, lt);

            if (!ALL_COURSE_EVENT.Contains(ce))
            {
                ALL_COURSE_EVENT.Add(ce);
            }
        }
Exemple #3
0
 public CourseEvent(string date, string start, string end, string room, string building, string teacher, CourseMain cm, LectureType lt)
 {
     this.Start    = DateTime.Parse($"{date.Trim()} {start.Trim()}");
     this.End      = DateTime.Parse($"{date.Trim()} {end.Trim()}");
     this.Room     = room.Trim();
     this.Building = building.Trim();
     this.Course   = cm;
     this.Type     = lt;
     this.Teacher  = teacher;
     this.Hash     = Library.GetHashString($"{this.Start}{this.End}{this.Location}{this.Teacher}{this.Course.Hash}{this.Type.Hash}");
 }