public void refreshCurrentView(final int newTab, final int newType) { currentViewingItems.clear(); if (newTab == 1) { currentViewingItems = MTSStorage.getInstance().getBuyNow(newType); } else if (newTab == 4) { for (int i : cart) { if (newType == 0 || (GameConstants.getInventoryType(i).getType() == newType)) { currentViewingItems.add(i); } } } }
public void loadNotYetSold() throws SQLException { final PreparedStatement ps = DatabaseConnection.getConnection() .prepareStatement("SELECT * FROM mts_items WHERE characterid = ?"); ps.setInt(1, characterId); final ResultSet rs = ps.executeQuery(); int pId; while (rs.next()) { pId = rs.getInt("id"); if (MTSStorage.getInstance().check(pId)) { notYetSold.add(pId); } } rs.close(); ps.close(); }
public void loadCart() throws SQLException { final PreparedStatement ps = DatabaseConnection.getConnection() .prepareStatement("SELECT * FROM mts_cart WHERE characterid = ?"); ps.setInt(1, characterId); final ResultSet rs = ps.executeQuery(); int iId; while (rs.next()) { iId = rs.getInt("itemid"); if (iId < 0) { owedNX -= iId; } else if (MTSStorage.getInstance().check(iId)) { cart.add(iId); } } rs.close(); ps.close(); }