コード例 #1
0
        public static ListaDependenteTO ListarPorMorador(int idMorador)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            ListaDependenteTO retorno = new ListaDependenteTO();

            try
            {
                retorno = _Crud.Listar();

                if (retorno.Valido)
                {
                    retorno.Lista = retorno.Lista.Where(x => x.IdMorador == idMorador).ToList();
                }
            }
            catch (Exception ex)
            {
                retorno.Valido   = false;
                retorno.Mensagem = string.Format("Erro: {0}", ex.Message);
            }

            return(retorno);
        }
コード例 #2
0
        public static ListaDependenteTO PesquisarPorNome(string nomeDependente)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            ListaDependenteTO retorno = new ListaDependenteTO();

            try
            {
                retorno = _Crud.Listar();

                if (retorno.Valido)
                {
                    retorno.Lista = retorno.Lista.Where(x => x.Nome.Contains(nomeDependente)).ToList();
                }
            }
            catch (Exception ex)
            {
                retorno.Valido   = false;
                retorno.Mensagem = string.Format("Erro: {0}", ex.Message);
            }

            return(retorno);
        }
コード例 #3
0
        public static ListaDependenteTO Listar()
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            return(_Crud.Listar());
        }
コード例 #4
0
        public static RetornoTO Remover(int identificador)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            return(_Crud.Remover(identificador));
        }
コード例 #5
0
        public static DependenteTO Obter(int identificador)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            return(_Crud.Obter(identificador));
        }
コード例 #6
0
        public static void Criar(DependenteTO entidadeTO)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            _Crud.Cadastrar(entidadeTO);
        }
コード例 #7
0
        public static void Atualizar(DependenteTO entidadeTO)
        {
            _Crud = CrudService <DependenteCrud> .ObterInstancia();

            _Crud.Atualizar(entidadeTO);
        }