Exemplo n.º 1
0
        public ProcessResult <List <AccionResponse> > Buscar(AccionRequest filtro)
        {
            ProcessResult <List <AccionResponse> > resultado = new ProcessResult <List <AccionResponse> >();

            try
            {
                List <AccionLogic> lista = LogicRepository.Buscar(
                    filtro.CodigoAccion,
                    filtro.Nombre,
                    filtro.Descripcion,
                    filtro.EstadoRegistro,
                    filtro.EstadoRegistroDescripcion,
                    filtro.NumeroPagina,
                    filtro.RegistrosPagina);

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

                foreach (AccionLogic item in lista)
                {
                    AccionResponse Response = AccionAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <AccionService>(ex);
            }

            return(resultado);
        }
Exemplo n.º 2
0
        public ProcessResult <AccionResponse> Obtener(float codigo)
        {
            ProcessResult <AccionResponse> resultado = new ProcessResult <AccionResponse>();

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

                resultado.Result = new AccionResponse();

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

            return(resultado);
        }
Exemplo n.º 3
0
        public ProcessResult <List <AccionResponse> > Listar()
        {
            ProcessResult <List <AccionResponse> > resultado = new ProcessResult <List <AccionResponse> >();

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

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

                foreach (AccionLogic item in lista)
                {
                    AccionResponse Response = AccionAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <AccionService>(ex);
            }

            return(resultado);
        }