/// <summary> /// get event from curriculum by ID /// </summary> /// <param name="evID"></param> /// <returns></returns> private Event getEvent(string evID) { foreach (Course crs in currentStudent.Curriculum.Courses) { foreach (Event ev in crs.LectEventsList) { if (ev.ID == int.Parse(evID)) { return(ev); } } foreach (Event ev in crs.PractEventsList) { if (ev.ID == int.Parse(evID)) { return(ev); } } foreach (Event ev in crs.LabsEventsList) { if (ev.ID == int.Parse(evID)) { return(ev); } } } // if we got here, this crs is not in the curriculum, create it return(SqlWorker.GetEvent(evID)); }