Beispiel #1
0
        public ProcessResult <List <PerfilResponse> > Buscar(PerfilRequest filtro)
        {
            ProcessResult <List <PerfilResponse> > resultado = new ProcessResult <List <PerfilResponse> >();

            try
            {
                List <PerfilLogic> lista = LogicRepository.Buscar(
                    filtro.CodigoPerfil,
                    filtro.CodigoSistema,
                    filtro.Sistema,
                    filtro.Nombre,
                    filtro.Descripcion,
                    filtro.EstadoRegistro,
                    filtro.EstadoRegistroDescripcion,
                    filtro.NumeroPagina,
                    filtro.RegistrosPagina);

                resultado.Result = new List <PerfilResponse>();

                foreach (PerfilLogic item in lista)
                {
                    PerfilResponse Response = PerfilAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <PerfilService>(ex);
            }

            return(resultado);
        }
Beispiel #2
0
        public ProcessResult <PerfilResponse> Obtener(int codigo)
        {
            ProcessResult <PerfilResponse> resultado = new ProcessResult <PerfilResponse>();

            try
            {
                PerfilLogic lista = LogicRepository.Obtener(codigo);

                resultado.Result = new PerfilResponse();

                if (resultado.Result != null)
                {
                    resultado.Result = PerfilAdapter.ObtenerPaginado(lista);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <PerfilService>(ex);
            }

            return(resultado);
        }
Beispiel #3
0
        public ProcessResult <List <PerfilResponse> > Listar()
        {
            ProcessResult <List <PerfilResponse> > resultado = new ProcessResult <List <PerfilResponse> >();

            try
            {
                List <PerfilLogic> lista = LogicRepository.Listar();

                resultado.Result = new List <PerfilResponse>();

                foreach (PerfilLogic item in lista)
                {
                    PerfilResponse Response = PerfilAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <PerfilService>(ex);
            }

            return(resultado);
        }