예제 #1
0
        public IEnumerable <Aluno> GetByPesquisa(string entrada)
        {
            if (EhInt(entrada))
            {
                var retorno = repositorio.GetByMatricula(Convert.ToInt32(entrada));

                if (retorno == null)
                {
                    throw new InconsistenciaException("Não foram encontrados alunos para a matrícula especificada, tente novamente");
                }

                List <Aluno> colecaoDeAlunos = new List <Aluno>();
                colecaoDeAlunos.Add(retorno);

                return(colecaoDeAlunos);
            }

            else
            {
                var retorno = repositorio.GetByContendoNoNome(entrada);

                if (retorno.Count() == 0)
                {
                    throw new InconsistenciaException("Não foram encontrados alunos para o nome especificado, tente novamente");
                }

                return(retorno);
            }
        }
예제 #2
0
        public void Remove(T objeto)
        {
            object cast = objeto;

            Aluno            aluno            = (Aluno)cast;
            RepositorioAluno repositorioAluno = new RepositorioAluno();

            object recebido = repositorioAluno.GetByMatricula(aluno.Matricula);

            lista.Remove((T)recebido);
        }
예제 #3
0
        public void Remove(T objeto)
        {
            object cast = objeto;

            Aluno            aluno            = (Aluno)cast;
            RepositorioAluno repositorioAluno = new RepositorioAluno();

            cast = repositorioAluno.GetByMatricula(aluno.Matricula);

            ColecaodeAlunos.Remove((T)cast);
        }