public static DAOBarco getInstance() { if (DAOBarco.c != null) { return(c); } else { c = new DAOBarco(); return(c); } }
//ELIMINAR Barco public int eliminarBarco(string placa) { NpgsqlConnection conn = DAOBarco.getInstanceDAO(); conn.Open(); String sql = "DELETE FROM \"Barco\" WHERE \"Placa\" = '" + placa + "'"; NpgsqlCommand cmd = new NpgsqlCommand(sql, conn); int resp = cmd.ExecuteNonQuery(); //CONTROLAR EXCEPTION DE UNIQUE conn.Close(); return(resp); }