示例#1
0
        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;
                }
            }
        }
示例#2
0
        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");
            }
        }
示例#3
0
        private void editButton_Click_1(System.Object sender, System.EventArgs e)
        {
            List <Control> list = new List <Control>();

            foreach (object control_loopVariable in MainFlowLayoutPanel.Controls)
            {
                control = control_loopVariable;
                if (control is FixtureReviewUserControl)
                {
                    list.Add(control);
                }
            }

            foreach (Control control_loopVariable in list)
            {
                control = control_loopVariable;
                MainFlowLayoutPanel.Controls.Remove(control);
            }

            foreach (Fixture fixture in fixtures)
            {
                FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team);
                this.MainFlowLayoutPanel.Controls.Remove(review);
            }

            fixtureBoxList[0].Visible            = true;
            fixtureBoxList[0].backButton.Enabled = false;
            fixtureNo = 0;

            this.submitGroupBox.Visible = false;
            this.submitButton.Visible   = false;
            this.editButton.Visible     = false;
        }
示例#4
0
        public void reviewPredictions()
        {
            int previousFixtureNo = fixtureNo;

            fixtureNo = fixtureNo + 1;
            fixtureBoxList[fixtureNo - 1].Visible = false;

            if (fixtureBoxList[previousFixtureNo].homeRadioButton.Checked == true)
            {
                fixtures[previousFixtureNo].Prediction = 1;
            }
            if (fixtureBoxList[previousFixtureNo].awayRadioButton.Checked == true)
            {
                fixtures[previousFixtureNo].Prediction = 2;
            }
            if (fixtureBoxList[previousFixtureNo].drawRadioButton.Checked == true)
            {
                fixtures[previousFixtureNo].Prediction = 3;
            }

            this.MainMenuButton.Visible  = false;
            this.FlowLayoutPanel.Enabled = true;
            this.FlowLayoutPanel.Visible = true;
            this.submitButton.Visible    = true;
            this.editButton.Visible      = true;


            foreach (Fixture fixture in fixtures)
            {
                FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team);
                this.FlowLayoutPanel.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;
                }
            }
        }
示例#5
0
        public void reviewPredictions()
        {
            int previousFixtureNo = fixtureNo;
            fixtureNo = fixtureNo + 1;
            fixtureBoxList[fixtureNo - 1].Visible = false;

            if (fixtureBoxList[previousFixtureNo].homeRadioButton.Checked == true) {
                fixtures[previousFixtureNo].Prediction = 1;
            }
            if (fixtureBoxList[previousFixtureNo].awayRadioButton.Checked == true) {
                fixtures[previousFixtureNo].Prediction = 2;
            }
            if (fixtureBoxList[previousFixtureNo].drawRadioButton.Checked == true) {
                fixtures[previousFixtureNo].Prediction = 3;
            }

            this.MainMenuButton.Visible = false;
            this.FlowLayoutPanel.Enabled = true;
            this.FlowLayoutPanel.Visible = true;
            this.submitButton.Visible = true;
            this.editButton.Visible = true;

            foreach (Fixture fixture in fixtures) {
                FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team);
                this.FlowLayoutPanel.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;
                }
            }
        }
示例#6
0
        private void editButton_Click_1(System.Object sender, System.EventArgs e)
        {
            List<Control> list = new List<Control>();

            foreach (object control_loopVariable in MainFlowLayoutPanel.Controls) {
                control = control_loopVariable;
                if (control is FixtureReviewUserControl) {
                    list.Add(control);
                }
            }

            foreach (Control control_loopVariable in list) {
                control = control_loopVariable;
                MainFlowLayoutPanel.Controls.Remove(control);

            }

            foreach (Fixture fixture in fixtures) {
                FixtureReviewUserControl review = new FixtureReviewUserControl(fixture.Home_Team, fixture.Away_Team);
                this.MainFlowLayoutPanel.Controls.Remove(review);

            }

            fixtureBoxList[0].Visible = true;
            fixtureBoxList[0].backButton.Enabled = false;
            fixtureNo = 0;

            this.submitGroupBox.Visible = false;
            this.submitButton.Visible = false;
            this.editButton.Visible = false;
        }
示例#7
0
        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");
            }
        }