示例#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()));
                }
            }
        }
示例#2
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;
            lbmatchtitle.Text = client.getMatchTitle((int)Session["matchid"]);
            if (ddlbatfirst.Items.Count == 1)
            {
                ddlbatfirst.Items.Add(new ListItem(team1, Session["team1id"].ToString()));
                ddlbatfirst.Items.Add(new ListItem(team2, Session["team2id"].ToString()));
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ServiceRef.LiveScoreServiceClient 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;
         lbmatchtitle.Text = client.getMatchTitle((int)Session["matchid"]);
         int team1id = (int)Session["team1id"];
         int team2id = (int)Session["team2id"];
         ddlwinteam.Items.Add(new ListItem(team1, team1id.ToString()));
         ddlwinteam.Items.Add(new ListItem(team2, team2id.ToString()));
     }
 }
示例#4
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)
            {
                ServiceRef.LiveScoreServiceClient 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;
                lbmatchtitle.Text = client.getMatchTitle((int)Session["matchid"]);

                int matchid = (int)Session["matchid"];
                int inn     = client.getInning(matchid);
                //For 2nd Innings
                if (inn == 2)
                {
                    Response.Redirect("matchEnd.aspx");
                }

                //Swap batteam and bowlteam
                int temp = (int)Session["batteamid"];
                Session["batteamid"]  = (int)Session["bowlteamid"];
                Session["bowlteamid"] = temp;

                //Declaring striker non striker
                List <Player> ob = client.getOpeners((int)Session["batteamid"]).ToList();
                Session["striker"]    = ob[0].Id;
                Session["nonstriker"] = ob[1].Id;

                //Select Bowler
                if (ddlfbowl.Items.Count == 0)
                {
                    int           bowlteamid = (int)Session["bowlteamid"];
                    List <Player> b          = client.getBowlers(bowlteamid).ToList <Player>();
                    foreach (Player p in b)
                    {
                        ddlfbowl.Items.Add(new ListItem(p.Name, p.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();
            }
        }