Ejemplo n.º 1
0
        protected void lnkSubmit_Click(object sender, EventArgs e)
        {
            string LeagueID = Request.QueryString["LeagueID"];


            Game game = new Game();

            game.TeamOne  = txtTeamOne.Value;
            game.TeamTwo  = txtTeamTwo.Value;
            game.Venue    = txtVenue.Value;
            game.sDate    = DateTime.ParseExact(txtDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = Convert.ToInt32(LeagueID);
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues"); //uploading an image
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;

            Response.Redirect("ViewGame.aspx?G_ID=" + GameID);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string             ID  = Request.QueryString["L_ID"];
            MatchServiceClient msc = new MatchServiceClient();
            List <Game>        gm  = new List <Game>();

            gm = msc.LeagueStats(ID);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// The <c>Match</c> constructor.
 /// </summary>
 public Match()
 {
     InitializeComponent();
     _context                             = new InstanceContext(this);
     _matchServiceClient                  = new MemoryGameService.MatchServiceClient(_context);
     _imageCards                          = new List <ImageCard>();
     _numberOfMovementsAllowed            = 0;
     _cardsFlippedInCurrentTurn           = new List <ImageCard>();
     _playerHasFormedAPair                = false;
     _windowIsBeingClosedByTheCloseButton = true;
 }
Ejemplo n.º 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Game gameTicket        = new Game();
            MatchServiceClient msc = new MatchServiceClient();

            gameTicket.ID           = 1;
            gameTicket.ticket_Price = Convert.ToDecimal(txtTicketPrice.Text);
            gameTicket.ticket_pDate = DateTime.ParseExact(txtTicketDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            gameTicket.NumTicket    = Convert.ToInt32(txtQuantity.Text);
            string res  = msc.CreateGameTicket(gameTicket);
            int    blah = 0;
        }
Ejemplo n.º 5
0
        protected void btnStats_Click(object sender, EventArgs e)
        {
            Game gameStats = new Game();

            gameStats.ID           = 1;
            gameStats.BestPlayer   = txtBPlayer.Text;
            gameStats.TeamOnePos   = Convert.ToInt32(txtT1_Pos.Text);
            gameStats.TeamTwoPos   = Convert.ToInt32(txtT2_Pos.Text);
            gameStats.TeamOneFouls = Convert.ToInt32(txtT1_Foul.Text);
            gameStats.TeamTwoFouls = Convert.ToInt32(txtT2_Foul.Text);
            MatchServiceClient msc = new MatchServiceClient();
            string             res = msc.GameStats(gameStats);
            int blah = 0;
        }
Ejemplo n.º 6
0
        protected void lnkAddLeague_Click(object sender, EventArgs e)
        {
            string             gameID = Request.QueryString["G_ID"];
            string             lgID   = Request.QueryString["L_ID"];
            TeamServiceClient  tsc    = new TeamServiceClient();
            List <MyTeamModel> teams  = new List <MyTeamModel>();

            teams = tsc.getTeamsByGameID(gameID);

            //string gameID = Request.QueryString["G_ID"];
            Game gameStats = new Game();

            gameStats.ID         = Convert.ToInt32(gameID);
            gameStats.BestPlayer = TextBestPlayer.Value;


            gameStats.TeamOnePos            = Convert.ToInt32(txt1Position.Value);
            gameStats.TeamOneFouls          = Convert.ToInt32(txt1Foul.Value);
            gameStats.TeamOneCornerKick     = Convert.ToInt32(txtT1_CK.Value);
            gameStats.TeamOneGoalScored     = Convert.ToInt32(txt1_GS.Value);
            gameStats.TeamOneYellowCard     = Convert.ToInt32(txtT1_YC.Value);
            gameStats.TeamOneRedCard        = Convert.ToInt32(txtT1_RC.Value);
            gameStats.TeamOne_OveralAverage = Convert.ToDecimal(txt1Average.Value);

            gameStats.TeamTwoFouls          = Convert.ToInt32(txt2Foul.Value);
            gameStats.TeamTwoPos            = Convert.ToInt32(txt2Position.Value);
            gameStats.TeamTwoCornerKick     = Convert.ToInt32(txtT2_CK.Value);
            gameStats.TeamTwoGoalScored     = Convert.ToInt32(txt2_GS.Value);
            gameStats.TeamTwoYellowCard     = Convert.ToInt32(txtT2_YC.Value);
            gameStats.TeamTwoRedCard        = Convert.ToInt32(txtT2_RC.Value);
            gameStats.TeamTwo_OveralAverage = Convert.ToDecimal(txt2Average.Value);

            MatchServiceClient msc = new MatchServiceClient();
            string             res = msc.GameStats(gameStats);

            if (res.Contains("success"))
            {
                bestplayer BPlayer = new bestplayer();
                BPlayer.leagueID = Convert.ToInt32(lgID);
                BPlayer.Name     = TextBestPlayer.Value;
                BPlayer.Goals    = Convert.ToInt32(txtBestPlayerGoals.Value);
                //Calculate Average
                msc.AddBestPlayer(BPlayer);
                Response.Redirect("ViewGameStats.aspx?G_ID=" + gameID + "&L_ID=" + lgID);
            }
        }
Ejemplo n.º 7
0
        protected void btnMatch_Click(object sender, EventArgs e)
        {
            Game game = new Game();

            game.TeamOne  = txtTeamOne.Text;
            game.TeamTwo  = txtTeamTwo.Text;
            game.Venue    = txtVenue.Text;
            game.Type     = txtGameType.Text;
            game.sDate    = DateTime.ParseExact(txtGameDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = 14;
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flGameImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues");
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;
        }
Ejemplo n.º 8
0
        protected void lnkSubmit_Click(object sender, EventArgs e)
        {
            string LeagueID = Request.QueryString["LeagueID"];

            //Populate dropdownlist
            //TeamServiceClient teamClient = new TeamServiceClient();
            //List<rep_Teams> teams = teamClient.getLeagueTeams(LeagueID);
            //dl_Teams.DataSource = teams;
            //dl_Teams.DataTextField = "Name";
            //dl_Teams.DataValueField = "S_ID";
            //dl_Teams.DataBind();

            if (dl_Teams.SelectedValue.Equals(d2_Teams.SelectedValue))
            {
                Response.Redirect("AddGame.aspx?LeagueID=" + LeagueID);
            }

            Game game = new Game();

            game.TeamOne  = dl_Teams.Text;
            game.TeamTwo  = d2_Teams.Text;
            game.Venue    = txtVenue.Value;
            game.sDate    = DateTime.ParseExact(txtDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = Convert.ToInt32(LeagueID);
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues");
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;

            Response.Redirect("ViewGame.aspx?G_ID=" + GameID);
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string gameID   = Request.QueryString["G_ID"];
            int    LoggedID = Convert.ToInt32(Session["ID"]);
            //DeleteGameStatsGameByID
            //DeleteGameByID
            //deleteImageByID
            FileClient         flClient     = new FileClient();
            string             dl_Image     = flClient.deleteGameImageByID(gameID);
            MatchServiceClient gameClient   = new MatchServiceClient();
            string             dl_GameStats = gameClient.DeleteGameStatsGameByID(gameID);
            string             dl_Game      = gameClient.DeleteGameByID(gameID);

            if (dl_Game.ToLower().Contains("success"))
            {
                //Popup
                Response.Redirect("GameManagement.aspx?UserID=" + LoggedID);
            }
            else
            {
                //Popup
                Response.Redirect("");
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int GameID             = Convert.ToInt32(Request.QueryString["G_ID"]);
            MatchServiceClient msc = new MatchServiceClient();
            TeamServiceClient  tsc = new TeamServiceClient();
            Team gm = new Team();

            gm = msc.GetGameByID(Convert.ToString(GameID));
            List <MyTeamModel> teams = tsc.getTeamsByGameID(Convert.ToString(GameID));

            //Team tm = teams.First();
            //Team tm2 = teams.Last();
            try
            {
                if (teams != null || teams.Count() != 0)
                {
                    MyTeamModel t1 = teams.First();
                    MyTeamModel t2 = teams.Last();
                    if (t1 != null || t2 != null)
                    {
                        List <Player> T1players = t1.players;
                        List <Player> T2players = t2.players;
                        if (T1players != null || T2players != null)
                        {
                            string html = "";
                            html += "<img style='width: 100%; display: block;' src='" + t1.ImagePath + "' alt='image'/>";
                            img1Div.InnerHtml = html;

                            html              = "";
                            html             += "<b>" + t1.TeamName + "</b>";
                            T1Name.InnerHtml  = html;
                            T1_Desc.InnerHtml = t1.Desc;
                            T2_Desc.InnerHtml = t2.Desc;
                            html              = "";
                            html             += "<img style='width: 100%; display: block;' src='" + t2.ImagePath + "' alt='image'/>";
                            img2Div.InnerHtml = html;
                            html              = "";
                            html             += "<b>" + t2.TeamName + "</b>";
                            t2Name.InnerHtml  = html;

                            html  = "";
                            html += gm.sDate + " : " + gm.Venue;
                            Venue_Time.InnerHtml = html;

                            html = "";
                            if (T1players != null || T2players != null)
                            {
                                foreach (Player pl in T1players)
                                {
                                    html += "<tr>";
                                    html += "<th scope='row'>" + pl.Position + "</th>";
                                    html += "<td>" + pl.Name + "</td>";
                                    html += "<td>" + pl.PerformanceRate + "</td></tr>";
                                }
                                player1.InnerHtml = html;

                                html = "";
                                foreach (Player pl in T2players)
                                {
                                    html += "<tr>";
                                    html += "<th scope='row'>" + pl.Position + "</th>";
                                    html += "<td>" + pl.Name + "</td>";
                                    html += "<td>" + pl.PerformanceRate + "</td></tr>";
                                }
                                player2.InnerHtml = html;
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                //DO Something
            }
            // MyTeamModel t1 = teams.ElementAt(0);
            //     MyTeamModel t2 = teams.ElementAt(1);
        }