protected void Page_Load(object sender, EventArgs e)
        {
            client = new ServiceRef.LiveScoreServiceClient("BasicHttpBinding_ILiveScoreService");
            int matchid = (int)Session["matchid"];
            int team2   = (int)Session["batteamid"];
            int team1   = (int)Session["bowlteamid"];

            bat1  = client.getAllBatsman(team1).ToList();
            bat2  = client.getAllBatsman(team2).ToList();
            bowl1 = client.getBowlers(team2).ToList();
            bowl2 = client.getBowlers(team1).ToList();

            int winid = client.getWinnerId(matchid);

            lbwinner.Text = client.getTeamDetails(winid).Name;
            lbendcom.Text = client.getEndComm(matchid);

            //Team1 stats
            Team t1 = client.getTeamDetails(team1);

            lbteam1.Text   = t1.Name;
            lbscore1.Text  = t1.Score.ToString();
            lbwick1.Text   = t1.Wickets.ToString();
            lbover1.Text   = t1.Overs.ToString();
            lbrr1.Text     = t1.Runrate.ToString();
            lbwide1.Text   = t1.Wideball.ToString();
            lbnoball1.Text = t1.Noball.ToString();

            //Team2 stats
            Team t2 = client.getTeamDetails(team2);

            lbteam2.Text   = t2.Name;
            lbscore2.Text  = t2.Score.ToString();
            lbwick2.Text   = t2.Wickets.ToString();
            lbover2.Text   = t2.Overs.ToString();
            lbrr2.Text     = t2.Runrate.ToString();
            lbwide2.Text   = t2.Wideball.ToString();
            lbnoball2.Text = t2.Noball.ToString();
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            client = new ServiceRef.LiveScoreServiceClient("BasicHttpBinding_ILiveScoreService");
            Team batteam = client.getTeamDetails((int)Session["batteamid"]);

            //For all wickets down
            if (batteam.Wickets == 10)
            {
                Response.Redirect("inning.aspx");
            }

            string team1 = client.getTeamName((int)Session["team1id"]);
            string team2 = client.getTeamName((int)Session["team2id"]);

            lbteam1.Text      = team1;
            lbteam2.Text      = team2;
            lbmatchtitle.Text = client.getMatchTitle((int)Session["matchid"]);
            List <Player> p = client.getNextBatsmans((int)Session["batteamid"]).ToList();
            int           notoutpid;
            Player        striker = client.getPlayerDetails((int)Session["striker"]);

            //Striker is out
            if (striker.Status == (int)Player.OutStatus.OUT)
            {
                notoutpid = (int)Session["nonstriker"];
            }
            //Non striker is out
            else
            {
                notoutpid = (int)Session["striker"];
            }
            if (ddlnextbat.Items.Count == 1)
            {
                foreach (Player a in p)
                {
                    if (a.Id == notoutpid)
                    {
                        continue;
                    }
                    ddlnextbat.Items.Add(new ListItem(a.Name, a.Id.ToString()));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                client = new ServiceRef.LiveScoreServiceClient("BasicHttpBinding_ILiveScoreService");
                int mid = (int)Session["matchid"];
                int inn = client.getInning(mid);
                if (inn == 1)
                {
                    string tosscomm = client.getTossCom(mid);
                    lbtoss.Text   = tosscomm;
                    lbinning.Text = inn.ToString() + "st Innings";
                }
                else
                {
                    string inncomm = client.getInnComment(mid);
                    lbtoss.Text   = inncomm;
                    lbinning.Text = inn.ToString() + "nd Innings";
                    Team bowlteam = client.getTeamDetails((int)Session["bowlteamid"]);
                    int  target   = bowlteam.Score + 1;
                    lbtarget.Text = "Target: " + target.ToString();
                }
                string team1 = client.getTeamName((int)Session["team1id"]);
                string team2 = client.getTeamName((int)Session["team2id"]);
                lbteam1.Text      = team1;
                lbteam2.Text      = team2;
                lbmatchtitle.Text = client.getMatchTitle((int)Session["matchid"]);
                int bid = (int)Session["batteamid"];

                //Batting Team stats
                Team t = client.getTeamDetails(bid);
                lbbatteam.Text  = t.Name;
                lbtscore.Text   = t.Score.ToString();
                lbtwickets.Text = t.Wickets.ToString();
                lbtover.Text    = t.Overs.ToString();
                lbtrr.Text      = t.Runrate.ToString();

                Player str    = client.getPlayerDetails((int)Session["striker"]);
                Player nonstr = client.getPlayerDetails((int)Session["nonstriker"]);
                Player bowl   = client.getPlayerDetails((int)Session["bowler"]);

                //Striker stats
                lbbat1name.Text  = str.Name;
                lbbat1runs.Text  = str.Batruns.ToString();
                lbbat1balls.Text = str.Balls.ToString();
                lbbat1fours.Text = str.Fours.ToString();
                lbbat1sixes.Text = str.Sixes.ToString();
                lbbat1strk.Text  = str.Strikerate.ToString();

                //Non Striker Stats
                lbbat2name.Text  = nonstr.Name;
                lbbat2runs.Text  = nonstr.Batruns.ToString();
                lbbat2balls.Text = nonstr.Balls.ToString();
                lbbat2fours.Text = nonstr.Fours.ToString();
                lbbat2sixes.Text = nonstr.Sixes.ToString();
                lbbat2strk.Text  = nonstr.Strikerate.ToString();

                //Bowler stats
                lbbowl.Text     = bowl.Name;
                lbbowlover.Text = bowl.Overs.ToString();
                lbbowlrun.Text  = bowl.Bowlruns.ToString();
                lbbowlwick.Text = bowl.Wickets.ToString();
                lbbowleco.Text  = bowl.Economy.ToString();

                c = client.getCommentary(mid).ToList();
            }
        }