public void RegisterTeacher(LoginCredentionals credits, int id, Subject subject) { Logger.Info("Trying to add a teacher [" + id + "]..."); if (CheckPermission(credits)) { Console.WriteLine("Adding new teacher..."); try { Id_Subject_Map.Add(id, subject); Logger.Info("Regestering new teacher succeeded."); } catch { Logger.Warn("Registering new teacher failed."); } } }
public void MockFill() { Person h1 = new Person("admin", "admin", "admin", new DateTime(1990, 11, 3), Person.SexT.Male); Id_Person_Map.Add(h1.Id, h1); Id_Position_Map.Add(h1.Id, Position.Administrator); Login_Password_Map.Add("admin", "admin"); Login_Id_Map.Add("admin", h1.Id); Id_Login_Map.Add(h1.Id, "admin"); Person h2 = new Person("Anrey", "Andreevich", "Tikhonov", new DateTime(1970, 10, 5), Person.SexT.Male); Id_Person_Map.Add(h2.Id, h2); Id_Position_Map.Add(h2.Id, Position.Teacher); Login_Password_Map.Add("teacher", "teacher"); Login_Id_Map.Add("teacher", h2.Id); Id_Login_Map.Add(h2.Id, "teacher"); Id_Subject_Map.Add(h2.Id, Subject.Mathematics); Person h3 = new Person("Petr", "Ivanovich", "Sobolev", new DateTime(1998, 2, 2), Person.SexT.Male); Id_Person_Map.Add(h3.Id, h3); Id_Position_Map.Add(h3.Id, Position.Student); Login_Password_Map.Add("student", "student"); Login_Id_Map.Add("student", h3.Id); Id_Login_Map.Add(h3.Id, "student"); Person h4 = new Person("Anna", "Ivanovna", "Soboleva", new DateTime(1973, 4, 20), Person.SexT.Female); Id_Person_Map.Add(h4.Id, h4); Id_Position_Map.Add(h4.Id, Position.Guest); Login_Password_Map.Add("parent", "parent"); Login_Id_Map.Add("parent", h4.Id); Id_Login_Map.Add(h4.Id, "parent"); Guest_Studednt_Map.Add(h4.Id, h3.Id); }