public List<Marca> selectAll()
 {
     FbConnection conn = ConnectionFactory.getConnection();
     FbCommand query = new FbCommand(SELECTALL, conn);
     FbDataReader reader = null;
     List<Marca> lista = null;
     try
     {
         conn.Open();
         reader = query.ExecuteReader();
         while (reader.Read())
         {
             Marca marca = new Marca();
             marca.setCodMarca(int.Parse(reader["codMarca"].ToString()));
             marca.setDescricao(reader["descricao"].ToString());
             lista.Add(marca);
         }
     }
     catch (FbException ex)
     {
         ex.Message.ToString();
     }
     finally
     {
         ConnectionFactory.closeAll(conn, query, reader);
     }
     return lista;
 }
 public Marca selectById(Marca marca)
 {
     FbConnection conn = ConnectionFactory.getConnection();
     FbCommand query = new FbCommand(SELECTBYID, conn);
     FbDataReader reader = null;
     try
     {
         query.Parameters.AddWithValue("@codMarca", marca.getCodMarca());
         conn.Open();
         reader = query.ExecuteReader();
         if (reader.Read()) {
             marca.setCodMarca(int.Parse(reader["codMarca"].ToString()));
             marca.setDescricao(reader["descricao"].ToString());
         }
     }
     catch (FbException ex)
     {
         ex.Message.ToString();
     }
     finally
     {
         ConnectionFactory.closeAll(conn, query, reader);
     }
     return marca;
 }