/// <summary> /// Create a new Course object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="startTime">Initial value of the StartTime property.</param> /// <param name="endTime">Initial value of the EndTime property.</param> public static Course CreateCourse(global::System.Int32 id, global::System.DateTime startTime, global::System.DateTime endTime) { Course course = new Course(); course.Id = id; course.StartTime = startTime; course.EndTime = endTime; return course; }
/// <summary> /// Deprecated Method for adding a new object to the CourseSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCourseSet(Course course) { base.AddObject("CourseSet", course); }
private void ParseSummary(Course course, string summary) { string[] lines = summary.Replace("\\,", ",").Split(new[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries); foreach (string line in lines) { if (line.StartsWith("Kategorie: ")) { course.Category = line.Substring(11); } else if (line.StartsWith("Modul: ")) { course.Module = line.Substring(7); } else if (line.StartsWith("DozentIn: ")) { course.Lecturer = line.Substring(10); } else if (line.StartsWith("Gruppe: ")) { course.Group = line.Substring(8); } else if (line.StartsWith("Hinweis: ")) { course.Notes = line.Substring(9); } } }
private void FinishEvent() { if (_dtStart == null || _dtEnd == null || _summary == null || _location == null) { // TODO: Do some error reporting here return; } Course course = new Course(); course.StartTime = DecodeDateTime(_dtStart); course.EndTime = DecodeDateTime(_dtEnd); ParseSummary(course, _summary); AddToRooms(course, _location); }
private void AddToRooms(Course course, string location) { // TODO: Better checking foreach (KeyValuePair<string, Room> c in _rooms) { if (location.Contains(c.Key)) { c.Value.Course.Add(course); } } }
/// <summary> /// Create a new Course object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="startTime">Initial value of the StartTime property.</param> /// <param name="endTime">Initial value of the EndTime property.</param> /// <param name="category">Initial value of the Category property.</param> /// <param name="notes">Initial value of the Notes property.</param> /// <param name="module">Initial value of the Module property.</param> /// <param name="lecturer">Initial value of the Lecturer property.</param> /// <param name="group">Initial value of the Group property.</param> public static Course CreateCourse(global::System.Int32 id, global::System.DateTime startTime, global::System.DateTime endTime, global::System.String category, global::System.String notes, global::System.String module, global::System.String lecturer, global::System.String group) { Course course = new Course(); course.Id = id; course.StartTime = startTime; course.EndTime = endTime; course.Category = category; course.Notes = notes; course.Module = module; course.Lecturer = lecturer; course.Group = group; return course; }