public QueryResult Execute(ListarProveedorParameter parameters)
        {
            using (var conn = new ConnectionFactory(_config).GetOpenConnection())
            {
                var parametros = new DynamicParameters();
                parametros.Add("Criterio", dbType: DbType.String, direction: ParameterDirection.Input, value: parameters.Criterio);

                var result = new ListarProveedorResult();
                result.Hits = conn.Query <ListarProveedorDto>("Mantenimiento.pa_buscarproveedor"
                                                              , parametros
                                                              , commandType: CommandType.StoredProcedure);
                return(result);
            }
        }
Beispiel #2
0
        public QueryResult Handle(ListarProveedorParameters parameters)
        {
            using (var connection = (SqlConnection)ConnectionFactory.CreateFromUserSession())
            {
                var parametros = new DynamicParameters();
                parametros.Add("criterio", dbType: DbType.String, direction: ParameterDirection.Input, value: parameters.criterio);
                parametros.Add("activo", dbType: DbType.String, direction: ParameterDirection.Input, value: parameters.activo);

                var resultado = new ListarProveedorResult
                {
                    Hits = connection.Query <ListarProveedorDto>
                           (
                        "pago.pa_listarproveedor",
                        parametros,
                        commandType: CommandType.StoredProcedure
                           ),
                };

                return(resultado);
            }
        }