Пример #1
0
        public Sesion login(int id, String password)
        {
            TeacherDao helper  = new TeacherDao();
            Teacher    teacher = helper.findById(id);

            if (teacher == null)

            {
                throw new ObjectNotFoundException();
            }
            if (teacher.password.Equals(password))
            {
                return(new Sesion(new User(teacher, Roles.TEACHER)));
            }
            throw new ObjectNotFoundException();
        }