Esempio n. 1
0
 private void carregaDadosBDNotaSelecionada()
 {
     try
     {
         mdlDataBaseAccess.Tabelas.XsdTbNotasFiscais.tbNotasFiscaisRow dtrwTbNotasFiscais = null;
         dtrwTbNotasFiscais = m_typDatSetTbNotasFiscais.tbNotasFiscais.FindBynIdExportadorstrIdPenNotaFiscal((short)m_nIdExportador, m_strIdPE, m_nIdNotaFiscal);
         if ((dtrwTbNotasFiscais != null) && (!m_bCadastroNova))
         {
             m_strNumeroNota = (dtrwTbNotasFiscais.IsstrNumeroNull() ? "" : dtrwTbNotasFiscais.strNumero);
             m_dtEmissaoNota = (dtrwTbNotasFiscais.IsdtEmissaoNull() ? System.DateTime.Now : dtrwTbNotasFiscais.dtEmissao);
             m_dValorNota    = (dtrwTbNotasFiscais.IsdValorNull() ? 0 : dtrwTbNotasFiscais.dValor);
         }
         else
         {
             m_strNumeroNota = "";
             m_dtEmissaoNota = System.DateTime.Now;
             m_dValorNota    = 0;
         }
     }
     catch (Exception err)
     {
         Object erro = err;
         m_cls_ter_tratadorErro.trataErro(ref erro);
     }
 }
Esempio n. 2
0
 protected void carregaDadosBD()
 {
     try
     {
         m_dValorNotasFiscais   = 0;
         m_strNotasFiscais      = "";
         m_strDatasNotasFiscais = "";
         mdlDataBaseAccess.Tabelas.XsdTbNotasFiscais.tbNotasFiscaisRow dtrwTbNotasFiscais = null;
         for (int nCount = 0; nCount < m_typDatSetTbNotasFiscais.tbNotasFiscais.Rows.Count; nCount++)
         {
             dtrwTbNotasFiscais      = (mdlDataBaseAccess.Tabelas.XsdTbNotasFiscais.tbNotasFiscaisRow)m_typDatSetTbNotasFiscais.tbNotasFiscais.Rows[nCount];
             m_dValorNotasFiscais   += (dtrwTbNotasFiscais.IsdValorNull() ? 0 : dtrwTbNotasFiscais.dValor);
             m_strDatasNotasFiscais += (dtrwTbNotasFiscais.IsdtEmissaoNull() ? "?, " : dtrwTbNotasFiscais.dtEmissao.ToString("dd/MM/yyyy") + ", ");
             m_strNotasFiscais      += (dtrwTbNotasFiscais.IsstrNumeroNull() ? "?, " : dtrwTbNotasFiscais.strNumero + ", ");
         }
         if (m_strDatasNotasFiscais.Length > 2)
         {
             m_strDatasNotasFiscais = m_strDatasNotasFiscais.Remove(m_strDatasNotasFiscais.Length - 2, 2);
         }
         if (m_strNotasFiscais.Length > 2)
         {
             m_strNotasFiscais = m_strNotasFiscais.Remove(m_strNotasFiscais.Length - 2, 2);
         }
     }
     catch (Exception err)
     {
         Object erro = err;
         m_cls_ter_tratadorErro.trataErro(ref erro);
     }
 }