Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            client = new ServiceRef.LiveScoreServiceClient("BasicHttpBinding_ILiveScoreService");
            string team1 = client.getTeamName((int)Session["team1id"]);
            string team2 = client.getTeamName((int)Session["team2id"]);

            lbteam1.Text = team1;
            lbteam2.Text = team2;
            int matchid = (int)Session["matchid"];

            lbmatchtitle.Text = client.getMatchTitle(matchid);
            double overs = (double)Session["overs"];

            //Converting #.6 over to #.0
            overs            = Math.Ceiling(overs);
            Session["overs"] = overs;
            lbover.Text      = overs.ToString();

            int bowlerid   = (int)Session["bowler"];
            int bowlteamid = (int)Session["bowlteamid"];
            int batteamid  = (int)Session["batteamid"];

            double bowlovers = client.getPlayerDetails(bowlerid).Overs;

            bowlovers = Math.Ceiling(bowlovers);

            //Updating over
            client.updateBowlOver(bowlovers, bowlerid);
            client.updateTeamOver(overs, batteamid);

            //For all overs done
            int movers = client.getMatchOvers(matchid);

            //Match m = client.getMatchDetails((int)Session["matchid"]);
            if (overs == (double)movers)
            {
                Response.Redirect("inning.aspx");
            }

            //Adding bowlers to dropdownlist
            //ddlnextbowl.Items.Clear();
            if (ddlnextbowl.Items.Count == 0)
            {
                List <Player> b = client.getBowlers(bowlteamid).ToList <Player>();
                foreach (Player p in b)
                {
                    //Current bowler cannot bowl again
                    if (p.Id == bowlerid)
                    {
                        continue;
                    }
                    ddlnextbowl.Items.Add(new ListItem(p.Name, p.Id.ToString()));
                }
            }
        }
Example #2
0
        protected void ddlnextbat_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlbat.Items.Clear();
            int    notoutpid = -1;
            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"];
            }
            Player notoutp = client.getPlayerDetails(notoutpid);

            ddlbat.Items.Add(new ListItem(notoutp.Name, notoutp.Id.ToString()));
            int    nextbatid = Int32.Parse(ddlnextbat.SelectedValue);
            Player n         = client.getPlayerDetails(nextbatid);

            ddlbat.Items.Add(new ListItem(n.Name, n.Id.ToString()));
        }
Example #3
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();
            }
        }