Esempio n. 1
0
 public AtualizarDadosRequestBody(string idVisual, string usuario, string senha, string nomeDoCliente, WebServiceSPLS.ArrayOfString metadadosC)
 {
     this.idVisual      = idVisual;
     this.usuario       = usuario;
     this.senha         = senha;
     this.nomeDoCliente = nomeDoCliente;
     this.metadadosC    = metadadosC;
 }
Esempio n. 2
0
 public InserirDadosEDocumentoRequestBody(string usuario, string senha, string nomeDoCliente, string dept, string doc, byte[] arquivo, string nomeDoArquivo, WebServiceSPLS.ArrayOfString metadadosC)
 {
     this.usuario       = usuario;
     this.senha         = senha;
     this.nomeDoCliente = nomeDoCliente;
     this.dept          = dept;
     this.doc           = doc;
     this.arquivo       = arquivo;
     this.nomeDoArquivo = nomeDoArquivo;
     this.metadadosC    = metadadosC;
 }
Esempio n. 3
0
        public async Task UploadArquivoSPLS(Solicitacao_Pagamento solicitacaoPagamento)
        {
            WebServiceSPLS.Sistema1SoapClient webService = null;

            try
            {
                var fornecedor = this.dados.ALD_ETL_Fornecedores.Single(x => x.Numero == solicitacaoPagamento.numero_fornecedor);

                solicitacaoPagamento.Documento_Fiscal = solicitacaoPagamento.Documento_Fiscal.OrderBy(x => x.nf_nr).ToList();

                foreach (var Documento_Fiscal in solicitacaoPagamento.Documento_Fiscal.Where(x => x.id == 0))
                {
                    var dadosSPLS = new WebServiceSPLS.ArrayOfString {
                        null, //solicitacaoPagamento.id.ToString(),
                        null, //numeroAgreement
                        Documento_Fiscal.nf_nr.ToString(),
                        null, //numeroContrato
                        null, //placa
                        fornecedor.Razao_Social,
                        fornecedor.Nome_fantasia,
                        fornecedor.CNPJ,
                        solicitacaoPagamento.valor_total.ToString(),
                        null, //Número do cliente ALD
                        null, //Nome do cliente ALD
                        null, //Forma de Pagamento,
                        null, //Número da fatura
                        null, //fgRebilSN
                        null, //notaFiscal.mes_fat,
                        solicitacaoPagamento.dt_criacao.ToString(),
                        this.usuarioNegocio.GetUsuario().nome,
                        null, //solicitacaoPagamento.dt_emiss_nf.ToString(),
                        null, //solicitacaoPagamento.dt_venc.ToString(),
                        null  //notaFiscal.chave_acesso
                    };

                    byte[] fileByte = System.Convert.FromBase64String(Documento_Fiscal.arquivo);

                    webService = new WebServiceSPLS.Sistema1SoapClient(WebServiceSPLS.Sistema1SoapClient.EndpointConfiguration.Sistema1Soap);

                    if (Util.ValidaCampo(Documento_Fiscal.id_visual))
                    {
                        await DeletaArquivoSPLS(Documento_Fiscal.id_visual.Value);

                        if (!this.resposta.Status)
                        {
                            throw this.resposta.Exception;
                        }
                    }

                    var resposta = await webService.InserirDadosEDocumentoAsync("ald.ws", "ald214409", "ALD", "01", "01", fileByte, Documento_Fiscal.nome_arquivo, dadosSPLS);

                    Documento_Fiscal.id_visual   = Convert.ToInt32(resposta.Body.InserirDadosEDocumentoResult);
                    Documento_Fiscal.dt_cadastro = DateTime.Now;
                    Documento_Fiscal.usuario     = this.usuarioNegocio.GetUsuario().id;
                }
            }
            catch (Exception ex)
            {
                throw new NegocioException("Erro ao carregar arquivo na SPLS", ex);
            }
        }
Esempio n. 4
0
 public System.Threading.Tasks.Task <WebServiceSPLS.AtualizarDadosResponse> AtualizarDadosAsync(string idVisual, string usuario, string senha, string nomeDoCliente, WebServiceSPLS.ArrayOfString metadadosC)
 {
     WebServiceSPLS.AtualizarDadosRequest inValue = new WebServiceSPLS.AtualizarDadosRequest();
     inValue.Body               = new WebServiceSPLS.AtualizarDadosRequestBody();
     inValue.Body.idVisual      = idVisual;
     inValue.Body.usuario       = usuario;
     inValue.Body.senha         = senha;
     inValue.Body.nomeDoCliente = nomeDoCliente;
     inValue.Body.metadadosC    = metadadosC;
     return(((WebServiceSPLS.Sistema1Soap)(this)).AtualizarDadosAsync(inValue));
 }
Esempio n. 5
0
 public System.Threading.Tasks.Task <WebServiceSPLS.InserirDadosEDocumentoResponse> InserirDadosEDocumentoAsync(string usuario, string senha, string nomeDoCliente, string dept, string doc, byte[] arquivo, string nomeDoArquivo, WebServiceSPLS.ArrayOfString metadadosC)
 {
     WebServiceSPLS.InserirDadosEDocumentoRequest inValue = new WebServiceSPLS.InserirDadosEDocumentoRequest();
     inValue.Body               = new WebServiceSPLS.InserirDadosEDocumentoRequestBody();
     inValue.Body.usuario       = usuario;
     inValue.Body.senha         = senha;
     inValue.Body.nomeDoCliente = nomeDoCliente;
     inValue.Body.dept          = dept;
     inValue.Body.doc           = doc;
     inValue.Body.arquivo       = arquivo;
     inValue.Body.nomeDoArquivo = nomeDoArquivo;
     inValue.Body.metadadosC    = metadadosC;
     return(((WebServiceSPLS.Sistema1Soap)(this)).InserirDadosEDocumentoAsync(inValue));
 }