Beispiel #1
0
 public Autorizacoes GetCCbyId(string autor_id)
 {
     try
     {
         string         sql   = "SELECT cred_id, credito, data, debito FROM Contacorrente WHERE autorizacao_id = " + autor_id;
         BD             BD    = new BD();
         SafeDataReader dr    = BD.GetDataReader(sql, null);
         Autorizacoes   autor = new Autorizacoes();
         try
         {
             if (dr.Read())
             {
                 autor.Credenciado.Cred_id = dr.GetInt32("CRED_ID");
                 autor.Credito             = dr.GetFloat("CREDITO");
                 autor.Data   = dr.GetDateTime("DATA");
                 autor.Debito = dr.GetFloat("DEBITO");
             }
         }
         finally
         {
             dr.Close();
         }
         return(autor);
     }
     catch
     {
         throw new Exception("Não foi possível recuperar dados da ContaCorrente");
     }
 }