我在 TypeScript/Angular 中有这个方法,可以生成我的文件
imprimir() {
this.service.emitirAdvertencia({ parametros: [{ name: 'CODIGO', value: 880 }] })
.subscribe((response) => {
console.log(response);
var fileURL = window.URL.createObjectURL(response);
//this not display my pdf document in a new tab.
window.open(fileURL, '_blank');
//this display my document pdf, but in current tab
window.location.href = fileURL;
}, error => {
console.log(error);
});
}
Run Code Online (Sandbox Code Playgroud)
这是我的服务
emitirAdvertencia(parametros: Object): any {
parametros['dbenv'] = ApplicationContext.getInstance().getDbenv();
parametros['usuario'] = ApplicationContext.getInstance().getUser().codigoUsuario;
parametros['nome_relatorio'] = 'RelAdvertenciaDB';
var httpOptions = {
headers: new HttpHeaders({
'Authorization': this.localStorage.get('token'),
}),
responseType: 'blob' as …Run Code Online (Sandbox Code Playgroud) 我有这个方法:
pesquisar(): void {
console.log(this.razaoSocial);
if (this.razaoSocial || this.cnpj) {
this.empresaDataSource = EMPRESAS.filter(empresa => {
empresa.razaoSocial.indexOf(this.razaoSocial) > -1
});
} else {
this.empresaDataSource = EMPRESAS;
}
console.log(this.empresaDataSource);
}
Run Code Online (Sandbox Code Playgroud)
的razaoSocial和cnpj是绑定变量ngModel我的阵列EMPRESA具有两个对象:
export const EMPRESAS:Empresa[]=[
{id:1, razaoSocial:'Ciclo Cairu', cnpj:'12345678912345'},
{id:2, razaoSocial:'Industria', cnpj:'789456123456132'}
];
Run Code Online (Sandbox Code Playgroud)
但我应用过滤器,例如:Indus
在html字段中,预计对象Industria已被过滤empresaDataSource,但不是.
控制台中的输出日志是:
> Indus
> []
Run Code Online (Sandbox Code Playgroud)
我的错误在哪里?
我有一个 SQL 查询
select * from table where field1 = :param1 and field2 = :param2
Run Code Online (Sandbox Code Playgroud)
我想从这个字符串中获取参数名称。例如:[param1, param2]
如何使用 C# 语言做到这一点?