public watchListForm(BusinessTier.User usr, BusinessTier.BusinessLogic b) { InitializeComponent(); this.loggedUser = usr; this.bLogic = b; searchAutocomplete(); if (bLogic.isWatchlistEmpty(loggedUser.id)) { watchlistDataGridView.Rows.Clear(); removeFromWatchlist.Enabled = false; } else { populateWatchListTable(); removeFromWatchlist.Enabled = true; //populateGraph(); } industriesComboBox.ValueMember = "Industry"; industriesComboBox.DisplayMember = "Industry"; industriesComboBox.DataSource = bLogic.populateIndustryDropDown(); }
private void removeFromWatchlist_Click(object sender, EventArgs e) { if (watchlistDataGridView.SelectedCells.Count > 0) { int selectedrowindex = watchlistDataGridView.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = watchlistDataGridView.Rows[selectedrowindex]; string symbol = Convert.ToString(selectedRow.Cells["Symbol"].Value); bLogic.RemoveFromWatchlist(loggedUser.id, symbol); if (bLogic.isWatchlistEmpty(loggedUser.id)) { removeFromWatchlist.Enabled = false; watchlistDataGridView.DataSource = null; zg1.GraphPane.CurveList.Clear(); zg1.GraphPane.GraphObjList.Clear(); GraphPane myPane = zg1.GraphPane; zg1.AxisChange(); zg1.Invalidate(); } else { populateWatchListTable(); //populateGraph(); } } }