예제 #1
0
 public static DAOBarco getInstance()
 {
     if (DAOBarco.c != null)
     {
         return(c);
     }
     else
     {
         c = new DAOBarco();
         return(c);
     }
 }
예제 #2
0
        //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);
        }