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); }
public ProcessResult <SistemaResponse> Obtener(float codigo) { ProcessResult <SistemaResponse> resultado = new ProcessResult <SistemaResponse>(); try { SistemaLogic lista = LogicRepository.Obtener(codigo); resultado.Result = new SistemaResponse(); if (resultado.Result != null) { resultado.Result = SistemaAdapter.ObtenerPaginado(lista); } } catch (Exception ex) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <SistemaService>(ex); } return(resultado); }
public ProcessResult <SistemaResponse> Sistema_x_Token(string token, int codigo_usuario) { ProcessResult <SistemaResponse> resultado = new ProcessResult <SistemaResponse>(); try { SistemaLogic lista = LogicRepository.Sistema_x_Token(token, codigo_usuario); resultado.Result = new SistemaResponse(); if (resultado.Result != null) { resultado.Result = SistemaAdapter.ObtenerPaginado(lista); } } catch (Exception ex) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <UsuariosService>(ex); } return(resultado); }
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); }