// ------------------------------------------------------------------- // BUTTONS ----------------------------------------------------------- // ------------------------------------------------------------------- private void Buy_btn_Click(object sender, EventArgs e) { // ge selected item values Stock stock = (Stock)StockMarket_listView.SelectedItems[0].Tag; int quantity = (int)quantity_numericupdown.Value; // make the buy (insert new purchased stock) for (int i = 0; i < quantity; i++) { DB_API.InsertPurchasedStock(this.account_id, stock.Company, (double)stock.AskPrice); } // update MyStocks listView PopulateMyStocksListView(); }