示例#1
0
        public ProcessResult <OpcionResponse> Obtener(float codigo)
        {
            ProcessResult <OpcionResponse> resultado = new ProcessResult <OpcionResponse>();

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

                resultado.Result = new OpcionResponse();

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

            return(resultado);
        }
示例#2
0
        public ProcessResult <List <OpcionResponse> > Buscar(OpcionRequest filtro)
        {
            ProcessResult <List <OpcionResponse> > resultado = new ProcessResult <List <OpcionResponse> >();

            try
            {
                List <OpcionLogic> lista = LogicRepository.Buscar(
                    filtro.CodigoOpcion,
                    filtro.CodigoModulo,
                    filtro.OpcionPadre,
                    filtro.OpcionPadreNombre,
                    filtro.Nombre,
                    filtro.Descripcion,
                    filtro.Controlador,
                    filtro.Metodo,
                    filtro.Area,
                    filtro.EstadoRegistro,
                    filtro.EstadoRegistroDescripcion,
                    filtro.NumeroPagina,
                    filtro.RegistrosPagina);

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

                foreach (OpcionLogic item in lista)
                {
                    OpcionResponse Response = OpcionAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <OpcionService>(ex);
            }

            return(resultado);
        }
示例#3
0
        public ProcessResult <List <OpcionResponse> > Listar()
        {
            ProcessResult <List <OpcionResponse> > resultado = new ProcessResult <List <OpcionResponse> >();

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

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

                foreach (OpcionLogic item in lista)
                {
                    OpcionResponse Response = OpcionAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <OpcionService>(ex);
            }

            return(resultado);
        }
示例#4
0
        public ProcessResult <List <OpcionResponse> > Usuario_x_Sistema(string usuario, int codigo_sistema)
        {
            ProcessResult <List <OpcionResponse> > resultado = new ProcessResult <List <OpcionResponse> >();

            try
            {
                List <OpcionLogic> lista = LogicRepository.Usuario_x_Sistema(usuario, codigo_sistema);

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

                foreach (OpcionLogic item in lista)
                {
                    OpcionResponse Response = OpcionAdapter.ObtenerPaginado(item);
                    resultado.Result.Add(Response);
                }
            }
            catch (Exception ex)
            {
                resultado.IsSuccess = false;
                resultado.Exception = new ApplicationLayerException <UsuariosService>(ex);
            }

            return(resultado);
        }