public void AddTermin(MyTermin termin) { try { termin.Id = NextId(); TerminsByIds.Add(termin.Id, termin); if (!TerminsByClassrooms.ContainsKey(termin.InClassroom.Id)) { TerminsByClassrooms.Add(termin.InClassroom.Id, new List <string>() { termin.Id }); } else { TerminsByClassrooms[termin.InClassroom.Id].Add(termin.Id); } if (!TerminsBySubjects.ContainsKey(termin.ForSubject.Id)) { TerminsBySubjects.Add(termin.ForSubject.Id, new List <string>() { termin.Id }); } else { TerminsBySubjects[termin.ForSubject.Id].Add(termin.Id); } } catch (Exception e) { Console.WriteLine("Neuspjeli pokusaj dodavanja termina {0}<{1}> u ucionicu {2}", termin.HeaderText, termin.Id, termin.InClassroom.Id); Console.WriteLine("Razlog: " + e.Message + "\n"); //throw; } }
public void AddSubject(string subjectId) { TerminsBySubjects.Add(subjectId, new List <string>()); }