示例#1
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()));
                }
            }
        }