Beispiel #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()));
                }
            }
        }
        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();
        }
        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()));
                    }
                }
            }
        }
Beispiel #4
0
        protected void ddlbatfirst_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlfbowl.Items.Clear();
            int bid = Int32.Parse(ddlbatfirst.SelectedValue);
            int bwid;

            if (bid == (int)Session["team1id"])
            {
                bwid = (int)Session["team2id"];
            }
            else
            {
                bwid = (int)Session["team1id"];
            }
            List <Player> b = client.getBowlers(bwid).ToList <Player>();

            foreach (Player p in b)
            {
                ddlfbowl.Items.Add(new ListItem(p.Name, p.Id.ToString()));
            }
        }