Example #1
0
        private void InGameHome_Load(object sender, EventArgs e)
        {
            AttributesForm SkillsForm = new AttributesForm();

            SkillsForm.Close();
            TxtAbility.Text = this.controller.GameObjects.CurrentTeamAvgTotalAbility().ToString();
            var manager = this.controller.GameObjects.ManagerEntity;
            var team    = this.controller.GameObjects.GetCurrentTeam();

            FixtureView.DataSource = controller.GetCurrentFixturesAsDataTable();

            TxtTeamName.Text    = manager.AssignedClub;
            TxtManagerName.Text = manager.Name;

            TxtDay.Text       = controller.GameObjects.GameWeek.ToString();
            TxtLeaguePos.Text = team.LeaguePos.ToString();

            //XmlDataDocument xmlDatadoc = new XmlDataDocument();
            //xmlDatadoc.DataSet.ReadXml("D:\\documents\\FMProject\\FMProject\\Data\\CurrentGameData\\AmendableLeagueData.xml");
            //DataSet ds = new DataSet("PremierLeagueLeagueTable");
            //ds = xmlDatadoc.DataSet;
            LeagueView.DataSource = controller.GameObjects.Teams;// ds.Tables[1];

            var Winner = this.LeagueView.Rows[0];

            Winner.DefaultCellStyle.BackColor = Color.Gold;

            foreach (DataGridViewRow i in LeagueView.Rows)
            {
                if (i == this.LeagueView.Rows[1] || i == this.LeagueView.Rows[2] || i == this.LeagueView.Rows[3])
                {
                    i.DefaultCellStyle.BackColor = Color.Green;
                }
            }

            foreach (DataGridViewRow j in LeagueView.Rows)
            {
                if (j == this.LeagueView.Rows[4] || j == this.LeagueView.Rows[5])
                {
                    j.DefaultCellStyle.BackColor = Color.LightGreen;
                }
            }

            foreach (DataGridViewRow i in LeagueView.Rows)
            {
                if (i == this.LeagueView.Rows[17] || i == this.LeagueView.Rows[18] || i == this.LeagueView.Rows[19])
                {
                    i.DefaultCellStyle.BackColor = Color.Red;
                }
            }


            controller.StartUpFunction();
        }
Example #2
0
        private void ButContinue_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.AssignedClub))
            {
                controller.GameObjects.ManagerEntity.AssignedClub = ClubList.Text;
            }

            if (ListNationalityPrimary.Text == "None" == false)
            {
                if (ListNationalitySecondary == ListNationalityPrimary == false)
                {
                    if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.PrimaryNationality))
                    {
                        controller.GameObjects.ManagerEntity.PrimaryNationality = ListNationalityPrimary.Text;
                    }

                    if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.SecondaryNationality))
                    {
                        controller.GameObjects.ManagerEntity.SecondaryNationality = ListNationalitySecondary.Text;
                    }
                }
                else
                {
                    MessageBox.Show("Please Enter Your Nationality and Do Not Choose The Same Nationality");
                }
            }
            if (ListLanguagePrimary.Text == "None" == false)
            {
                if (ListLanguageSecondary.Text == ListLanguagePrimary.Text == false)
                {
                    if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.PrimaryLanguage))
                    {
                        controller.GameObjects.ManagerEntity.PrimaryLanguage = ListLanguagePrimary.Text;
                    }

                    if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.SecondaryLanguage))
                    {
                        controller.GameObjects.ManagerEntity.SecondaryLanguage = ListLanguageSecondary.Text;
                    }
                }
                else
                {
                    MessageBox.Show("Please Enter Your Language and Do Not Choose The Same Language");
                }
            }

            if (string.IsNullOrEmpty(TxtUsername.Text) == false)
            {
                if (string.IsNullOrEmpty(controller.GameObjects.ManagerEntity.Name))
                {
                    controller.GameObjects.ManagerEntity.Name = TxtUsername.Text;
                }
            }
            else
            {
                MessageBox.Show("Please Enter Your Name");
            }

            if (string.IsNullOrEmpty(TxtUsername.Text) == false)
            {
                if (ListLanguagePrimary.Text == ListLanguageSecondary.Text == false)
                {
                    if (ListNationalityPrimary.Text == ListNationalitySecondary.Text == false)
                    {
                        controller.GameObjects.ManagerEntity.Name                 = TxtUsername.Text;
                        controller.GameObjects.ManagerEntity.PrimaryLanguage      = ListLanguagePrimary.Text;
                        controller.GameObjects.ManagerEntity.SecondaryLanguage    = ListLanguageSecondary.Text;
                        controller.GameObjects.ManagerEntity.PrimaryNationality   = ListNationalityPrimary.Text;
                        controller.GameObjects.ManagerEntity.SecondaryNationality = ListNationalitySecondary.Text;
                        this.Hide();
                        AttributesForm afForm = new AttributesForm();
                        afForm.Show(); this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Please Enter Your First Name");
                    }
                }
            }
            // a series of conditions to make sure everything is filled in accordingly before we progress to the next stage of creating your manager profile
        }