private void ReviewForm_Load(System.Object sender, System.EventArgs e) { FixtureBuilder fb = new FixtureBuilder(); fixtures = fb.getBet(); this.ReviewBetsFlowLayoutPanel.Enabled = true; this.ReviewBetsFlowLayoutPanel.Visible = true; this.FinishReviewGroupBox.Visible = true; this.MainMenuButton.Visible = true; foreach (Fixture fixture in fixtures) { FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team); this.ReviewBetsFlowLayoutPanel.Controls.Add(review); if (fixture.Prediction == 1) { review.homeFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 2) { review.awayFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 3) { review.drawLabel.BackColor = Color.LightGreen; } } }
private void betSlipButton_Click_1(System.Object sender, System.EventArgs e) { this.MainFlowLayoutPanel.Controls.Clear(); FixtureBuilder fb = new FixtureBuilder(); fixtures = fb.getBet(); this.submitGroupBox.Visible = false; try { foreach (Fixture fixture in fixtures) { FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team); this.MainFlowLayoutPanel.Controls.Add(review); if (fixture.Prediction == 1) { review.homeFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 2) { review.awayFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 3) { review.drawLabel.BackColor = Color.LightGreen; } } } catch (NullReferenceException ex) { Interaction.MsgBox("Not enough users have entered their predictions yet. Please try later"); } }
private void betSlipButton_Click_1(System.Object sender, System.EventArgs e) { this.MainFlowLayoutPanel.Controls.Clear(); FixtureBuilder fb = new FixtureBuilder(); fixtures = fb.getBet(); this.submitGroupBox.Visible = false; try { foreach (Fixture fixture in fixtures) { FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team); this.MainFlowLayoutPanel.Controls.Add(review); if (fixture.Prediction == 1) { review.homeFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 2) { review.awayFixtureLabel.BackColor = Color.LightGreen; } if (fixture.Prediction == 3) { review.drawLabel.BackColor = Color.LightGreen; } } } catch (NullReferenceException ex) { Interaction.MsgBox("Not enough users have entered their predictions yet. Please try later"); } }