Ejemplo n.º 1
0
        public ProcessResult <List <SistemaResponse> > Buscar(SistemaRequest filtro)
        {
            ProcessResult <List <SistemaResponse> > resultado = new ProcessResult <List <SistemaResponse> >();

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

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

                foreach (SistemaLogic item in lista)
                {
                    SistemaResponse Response = SistemaAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <SistemaService>(ex);
            }

            return(resultado);
        }
Ejemplo n.º 2
0
        public static SistemaResponse ObtenerPaginado(SistemaLogic Logic)
        {
            SistemaResponse Response = new SistemaResponse();

            Response.CodigoSistema  = Logic.CodigoSistema;
            Response.Nombre         = Logic.Nombre;
            Response.Descripcion    = Logic.Descripcion;
            Response.Ruta           = Logic.Ruta;
            Response.Token          = Logic.Token;
            Response.Parametro      = Logic.Parametro;
            Response.ValorParametro = Logic.ValorParametro;

            Response.CantTotalRegistros = Logic.CantTotalRegistros;

            //Obligatorios
            Response.EstadoRegistroDescripcion = Logic.EstadoRegistroDescripcion;
            Response.EstadoRegistro            = Logic.EstadoRegistro;
            Response.NumeroFila = Logic.NumeroRegistro;
            Response.FilasTotal = Logic.TotalRegistro;

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

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

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

                foreach (SistemaLogic item in lista)
                {
                    SistemaResponse Response = SistemaAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <SistemaService>(ex);
            }

            return(resultado);
        }