public double dCarregaValorSaque() { double dReturn = 0; // Loading data System.Collections.ArrayList arlCondicaoCampo = new System.Collections.ArrayList(); System.Collections.ArrayList arlCondicaoComparador = new System.Collections.ArrayList(); System.Collections.ArrayList arlCondicaoValor = new System.Collections.ArrayList(); arlCondicaoCampo.Add("idExportador"); arlCondicaoComparador.Add(mdlDataBaseAccess.Comparador.Igual); arlCondicaoValor.Add(m_nIdExportador); arlCondicaoCampo.Add("idPe"); arlCondicaoComparador.Add(mdlDataBaseAccess.Comparador.Igual); arlCondicaoValor.Add(m_strPe); mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaques = m_cls_dba_ConnectionDB.GetTbSaques(arlCondicaoCampo, arlCondicaoComparador, arlCondicaoValor, null, null); if (typDatSetSaques.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaques.tbSaques.Rows[0]; if ((dtrwSaque.IsdValorNull()) || (dtrwSaque.dValor == 0)) { dReturn = dValorFaturaSemAntecipado(); dtrwSaque.dValor = dReturn; m_cls_dba_ConnectionDB.SetTbSaques(typDatSetSaques); } else { dReturn = dtrwSaque.dValor; } } return(dReturn); }
private void vCarregaDadosDefault() { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; vCarregaDadosDefault(ref dtrwSaque); } }
private bool bSalvaDados() { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count == 0) { return(false); } mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; dtrwSaque.mstrDataVencimento = m_strData; m_cls_dba_ConnectionDB.SetTbSaques(typDatSetSaque); return(m_cls_dba_ConnectionDB.Erro == null); }
private bool bSalvaValorExtensoSaque(string strValorExtenso) { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; dtrwSaque.mstrValor = strValorExtenso; m_cls_dba_ConnectionDB.SetTbSaques(typDatSetSaque); return(m_cls_dba_ConnectionDB.Erro == null); } else { return(false); } }
private void vCaregaDadosValorExtenso() { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; if (!dtrwSaque.IsmstrValorNull()) { m_strValorExtenso = dtrwSaque.mstrValor; } else { m_strValorExtenso = this.ValorExtensoDefault; } } }
private void vCarregaDados() { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; if (!dtrwSaque.IsmstrDataVencimentoNull()) { m_strData = dtrwSaque.mstrDataVencimento; } else { m_strData = this.DataDefault; } } }
private void vCarregaDadosDefault(ref mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque) { // Idioma int nIdIdioma = 3; if (!dtrwSaque.IsnIdIdiomaNull()) { nIdIdioma = dtrwSaque.nIdIdioma; } System.Windows.Forms.ImageList ilBandeiras = null; clsEsquemaPagamentoFaturaComercial obj = new clsEsquemaPagamentoFaturaComercial(ref m_cls_ter_tratadorErro, ref m_cls_dba_ConnectionDB, m_strEnderecoExecutavel, ref ilBandeiras, m_nIdExportador, m_strIdPe); obj.MostrarPorValores = true; obj.MostrarCondicaoAntecipada = false; obj.vRetornaValores(nIdIdioma, out m_strCondicaoPagamentoDefault); }
protected override void salvaDadosBDEspecificos() { try { if (m_typDatSetTbSaques != null) { if (m_typDatSetTbSaques.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwTbSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)m_typDatSetTbSaques.tbSaques.Rows[0]; dtrwTbSaque.bCondicaoPagamentoAvista = m_bValorBooleano; } m_cls_dba_ConnectionDB.SetTbSaques(m_typDatSetTbSaques); } } catch (Exception err) { Object erro = err; m_cls_ter_tratadorErro.trataErro(ref erro); } }
private void vCaregaDadosValorExtensoDefault() { mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaque = XsdDatSetSaque(); if (typDatSetSaque.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaque.tbSaques.Rows[0]; // Idioma int nIdIdioma = 3; if (!dtrwSaque.IsnIdIdiomaNull()) { nIdIdioma = dtrwSaque.nIdIdioma; } // Moeda int nIdMoeda = 28; string strTemp; bool bTemp; mdlMoeda.clsMoeda objMoeda = new mdlMoeda.clsMoedaComercial(ref m_cls_ter_tratadorErro, ref m_cls_dba_ConnectionDB, m_strEnderecoExecutavel, m_nIdExportador, m_strIdPE); objMoeda.retornaValores(out nIdMoeda, out strTemp, out strTemp, out bTemp); m_strValorExtensoDefault = mdlConversao.clsValorExtenso.strRetornaValorExtenso(this.Valor, nIdIdioma, nIdMoeda); } }
protected override void carregaDadosBD() { try { if (m_typDatSetTbSaques != null) { if (m_typDatSetTbSaques.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwTbSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)m_typDatSetTbSaques.tbSaques.Rows[0]; if (!dtrwTbSaque.IsbCondicaoPagamentoAvistaNull()) { m_bValorBooleano = dtrwTbSaque.bCondicaoPagamentoAvista; } } } } catch (Exception err) { Object erro = err; m_cls_ter_tratadorErro.trataErro(ref erro); } }
public bool bSalvaValorSaque(double dValor) { bool bReturn = false; System.Collections.ArrayList arlCondicaoCampo = new System.Collections.ArrayList(); System.Collections.ArrayList arlCondicaoComparador = new System.Collections.ArrayList(); System.Collections.ArrayList arlCondicaoValor = new System.Collections.ArrayList(); arlCondicaoCampo.Add("idExportador"); arlCondicaoComparador.Add(mdlDataBaseAccess.Comparador.Igual); arlCondicaoValor.Add(m_nIdExportador); arlCondicaoCampo.Add("idPe"); arlCondicaoComparador.Add(mdlDataBaseAccess.Comparador.Igual); arlCondicaoValor.Add(m_strPe); mdlDataBaseAccess.Tabelas.XsdTbSaques typDatSetSaques = m_cls_dba_ConnectionDB.GetTbSaques(arlCondicaoCampo, arlCondicaoComparador, arlCondicaoValor, null, null); if (typDatSetSaques.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque = (mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow)typDatSetSaques.tbSaques.Rows[0]; dtrwSaque.dValor = dValor; m_cls_dba_ConnectionDB.SetTbSaques(typDatSetSaques); bReturn = (m_cls_dba_ConnectionDB.Erro == null); } return(bReturn); }
protected override void SalvaDadosBDEspecificos() { try { if (m_bModificado) { if (m_typDatSetTbSaques.tbSaques.Rows.Count > 0) { mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaques = m_typDatSetTbSaques.tbSaques.FindByidExportadoridPE(m_nIdExportador, m_strCodigo); if (dtrwSaques != null) { dtrwSaques.nIdIdioma = m_nIdioma; m_cls_dba_ConnectionDB.SetTbSaques(m_typDatSetTbSaques); } } } } catch (Exception err) { Object erro = err; m_cls_ter_tratadorErro.trataErro(ref erro); } }
private void vCarregaDadosDefault(ref mdlDataBaseAccess.Tabelas.XsdTbSaques.tbSaquesRow dtrwSaque) { // Idioma int nIdIdioma = 3; if (!dtrwSaque.IsnIdIdiomaNull()) { nIdIdioma = dtrwSaque.nIdIdioma; } System.Windows.Forms.ImageList ilBandeiras = null; mdlEsquemaPagamento.clsEsquemaPagamento objEsq = new mdlEsquemaPagamento.clsEsquemaPagamentoFaturaComercial(ref m_cls_ter_tratadorErro, ref m_cls_dba_ConnectionDB, m_strEnderecoExecutavel, ref ilBandeiras, m_nIdExportador, m_strIdPE); System.Text.StringBuilder strbData = new System.Text.StringBuilder(); if ((objEsq.CondicaoAvista) > 0) { switch (nIdIdioma) { case (int)mdlConstantes.Idioma.Portugues: strbData.Append("A Vista"); break; case (int)mdlConstantes.Idioma.Ingles: strbData.Append("At Sight"); break; } } if (((objEsq.CondicaoPostecipado) > 0) && (objEsq.PostecipadoCondicao != mdlEsquemaPagamento.DocumentoCondicao.Aceite)) { System.DateTime dtData = System.DateTime.Now; string strFormato = "dd/MMM/yyyy"; switch (objEsq.PostecipadoCondicao) { case mdlEsquemaPagamento.DocumentoCondicao.Conhecimento: mdlData.clsData objDataConhecimento = new mdlData.DataEmbarque.Faturas.clsDataEmbarqueComercial(ref m_cls_ter_tratadorErro, ref m_cls_dba_ConnectionDB, m_strEnderecoExecutavel, m_nIdExportador, m_strIdPE); dtData = objDataConhecimento.Data; if (dtData.Equals(mdlConstantes.clsConstantes.DATANULA)) { m_strDataDefault = ""; return; } break; case mdlEsquemaPagamento.DocumentoCondicao.Fatura: mdlData.clsData objData = new mdlData.DataEmissao.Faturas.clsDataEmissaoComercial(ref m_cls_ter_tratadorErro, ref m_cls_dba_ConnectionDB, m_strEnderecoExecutavel, m_nIdExportador, m_strIdPE); dtData = objData.Data; break; case mdlEsquemaPagamento.DocumentoCondicao.Saque: if (!dtrwSaque.IsdtDataEmissaoNull()) { dtData = dtrwSaque.dtDataEmissao; } break; } vIncrementaData(ref dtData, objEsq.PostecipadoUnidadeTempo, objEsq.PostecipadoQuantTempo); if (strbData.Length != 0) { strbData.Append(" , "); } strbData.Append(dtData.ToString(strFormato)); for (int i = 1; i < objEsq.PostecipadoQuantidadeParcelas; i++) { vIncrementaData(ref dtData, objEsq.PostecipadoUnidadeTempo, objEsq.PostecipadoIntervalo); strbData.Append(" , "); strbData.Append(dtData.ToString(strFormato)); } } m_strDataDefault = strbData.ToString(); }