Ejemplo n.º 1
0
        protected void btnStats_Click(object sender, EventArgs e)
        {
            Game gameStats = new Game();

            gameStats.ID           = 1;
            gameStats.BestPlayer   = txtBPlayer.Text;
            gameStats.TeamOnePos   = Convert.ToInt32(txtT1_Pos.Text);
            gameStats.TeamTwoPos   = Convert.ToInt32(txtT2_Pos.Text);
            gameStats.TeamOneFouls = Convert.ToInt32(txtT1_Foul.Text);
            gameStats.TeamTwoFouls = Convert.ToInt32(txtT2_Foul.Text);
            MatchServiceClient msc = new MatchServiceClient();
            string             res = msc.GameStats(gameStats);
            int blah = 0;
        }
Ejemplo n.º 2
0
        protected void lnkAddLeague_Click(object sender, EventArgs e)
        {
            string             gameID = Request.QueryString["G_ID"];
            string             lgID   = Request.QueryString["L_ID"];
            TeamServiceClient  tsc    = new TeamServiceClient();
            List <MyTeamModel> teams  = new List <MyTeamModel>();

            teams = tsc.getTeamsByGameID(gameID);

            //string gameID = Request.QueryString["G_ID"];
            Game gameStats = new Game();

            gameStats.ID         = Convert.ToInt32(gameID);
            gameStats.BestPlayer = TextBestPlayer.Value;


            gameStats.TeamOnePos            = Convert.ToInt32(txt1Position.Value);
            gameStats.TeamOneFouls          = Convert.ToInt32(txt1Foul.Value);
            gameStats.TeamOneCornerKick     = Convert.ToInt32(txtT1_CK.Value);
            gameStats.TeamOneGoalScored     = Convert.ToInt32(txt1_GS.Value);
            gameStats.TeamOneYellowCard     = Convert.ToInt32(txtT1_YC.Value);
            gameStats.TeamOneRedCard        = Convert.ToInt32(txtT1_RC.Value);
            gameStats.TeamOne_OveralAverage = Convert.ToDecimal(txt1Average.Value);

            gameStats.TeamTwoFouls          = Convert.ToInt32(txt2Foul.Value);
            gameStats.TeamTwoPos            = Convert.ToInt32(txt2Position.Value);
            gameStats.TeamTwoCornerKick     = Convert.ToInt32(txtT2_CK.Value);
            gameStats.TeamTwoGoalScored     = Convert.ToInt32(txt2_GS.Value);
            gameStats.TeamTwoYellowCard     = Convert.ToInt32(txtT2_YC.Value);
            gameStats.TeamTwoRedCard        = Convert.ToInt32(txtT2_RC.Value);
            gameStats.TeamTwo_OveralAverage = Convert.ToDecimal(txt2Average.Value);

            MatchServiceClient msc = new MatchServiceClient();
            string             res = msc.GameStats(gameStats);

            if (res.Contains("success"))
            {
                bestplayer BPlayer = new bestplayer();
                BPlayer.leagueID = Convert.ToInt32(lgID);
                BPlayer.Name     = TextBestPlayer.Value;
                BPlayer.Goals    = Convert.ToInt32(txtBestPlayerGoals.Value);
                //Calculate Average
                msc.AddBestPlayer(BPlayer);
                Response.Redirect("ViewGameStats.aspx?G_ID=" + gameID + "&L_ID=" + lgID);
            }
        }