private void dgvSearchResults_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { int seriesID = Convert.ToInt32(dgvSearchResults.Rows[e.RowIndex].Cells[0].Value); string dataSource = "XML"; frmTVShow frmTvShow = new frmTVShow(); frmTVShow.ShowID = seriesID; if (_favourites.Keys.Contains(seriesID)) { dataSource = "DB"; } frmTVShow.SeriesSource = dataSource; frmTvShow.ShowDialog(); _dbManager.OpenConnection(); _favourites = _dbManager.GetFavourites(); _dbManager.CloseConnection(); PopulateUpcomingEpisodes(); PopulateMissedEpisodes(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnShowMore_Click(object sender, EventArgs e) { string source = "DB"; frmTVShow frmTvShow = new frmTVShow(); frmTVShow.ShowID = _seriesID; frmTVShow.SeriesSource = source; frmTvShow.ShowDialog(); _dbManager.OpenConnection(); _favourites = _dbManager.GetFavourites(); _dbManager.CloseConnection(); PopulateFavoutitesPanel(); }