Beispiel #1
0
 public ComparePlayer(String player1, String team1, String player2, String team2)
 {
     this.player1 = player1;
     this.team1   = team1;
     this.player2 = player2;
     this.team2   = team2;
     pl1          = TeamsConnection.comparingPlayers(player1, team1);
     pl2          = TeamsConnection.comparingPlayers(player2, team2);
     pst1         = TeamsConnection.comparingFormerTeams(player1, team1);
     pst2         = TeamsConnection.comparingFormerTeams(player2, team2);
 }
Beispiel #2
0
 public League(String lg)
 {
     teams         = TeamsConnection.displayTeams(lg);
     league        = lg;
     lastChamp     = TeamsConnection.lastChampion(lg);
     topChampions  = TeamsConnection.top5Champions();
     topCupWinners = TeamsConnection.top5CupWinners();
     topCurrentLeagueAppearances = TeamsConnection.top10LeagueAppearances(lg, true);
     topCurrentLeagueScorers     = TeamsConnection.top10LeagueScorers(lg, true);
     topOverallLeagueAppearances = TeamsConnection.top10LeagueAppearances(lg, false);
     topOverallLeagueScorers     = TeamsConnection.top10LeagueScorers(lg, false);
     leagueForeignGoals          = TeamsConnection.LeagueGoalsFromForeigners(lg);
 }
Beispiel #3
0
 public CompareTeam(String name1, String league1, String name2, String league2)
 {
     this.name1           = name1;
     this.name2           = name2;
     this.league1         = league1;
     this.league2         = league2;
     team1                = TeamsConnection.ComparingTeams(name1);
     team2                = TeamsConnection.ComparingTeams(name2);
     pos1                 = TeamsConnection.getTeamPosition(name1, league1);
     pos2                 = TeamsConnection.getTeamPosition(name2, league2);
     presentCommonPlayers = TeamsConnection.ActivePlayersPlayedInBothTeams(name1, name2);
     allTimeCommonPlayers = TeamsConnection.PlayersPlayedInBothTeams(name1, name2);
 }
Beispiel #4
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            List <PastTeams> pastteams  = new List <PastTeams>();
            String           playerID   = TeamsConnection.transferedPlayerId(ddlPlayers.SelectedValue, ddlTeams.SelectedValue);
            String           newTeam    = ddlTeams2.SelectedValue;
            String           formerTeam = ddlTeams.SelectedValue;
            String           lb         = loanedBy.Text;

            using (TransactionScope tran = new TransactionScope())
            {
                if (ptlabel.Visible || PastTeamsFlag2.Checked)
                {
                    int psts = Convert.ToInt16(PastTeamsNumber.Text);
                    if (psts > 0)
                    {
                        bool   fl      = false;
                        String team    = null;
                        String country = null;

                        foreach (TextBox t in ts)
                        {
                            if (!fl)
                            {
                                team = GetValue(t.ID);
                                fl   = true;
                            }
                            else
                            {
                                country = GetValue(t.ID);
                                pastteams.Add(new PastTeams(playerID, team, country));
                                fl = false;
                            }
                        }
                        TeamsConnection.addPastTeamsOfNewPlayer(pastteams);
                    }
                }

                if (!TeamsConnection.isPastTeam(playerID, formerTeam) && !PastTeamsFlag.Checked && !formerTeam.Equals("Εκτός Βάσης"))
                {
                    pastteams.Clear();
                    pastteams.Add(new PastTeams(playerID, formerTeam, "Ελλάδα"));
                    TeamsConnection.addPastTeamsOfNewPlayer(pastteams);
                }
                TeamsConnection.transferPlayerToTeam(playerID, newTeam, lb);
                tran.Complete();
            }
        }
Beispiel #5
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            String        league    = dllLeague.SelectedValue;
            int           homeScore = Convert.ToInt16(GetValue("h_score"));
            int           awayScore = Convert.ToInt16(GetValue("a_score"));
            List <Scorer> pls;

            using (TransactionScope tran = new TransactionScope())
            {
                pls = new List <Scorer>();
                String playerID;
                int    goals;


                for (int i = 0; i < hnames.Length; i++)
                {
                    if (!GetValue(happs[i].ID).Equals("0"))
                    {
                        goals    = Convert.ToInt16(GetValue(hgoals[i].ID));
                        playerID = TeamsConnection.transferedPlayerId(hnames[i], homeTeam);
                        pls.Add(new Scorer(playerID, goals));
                    }
                }

                for (int i = 0; i < anames.Length; i++)
                {
                    if (!GetValue(aapps[i].ID).Equals("0"))
                    {
                        goals    = Convert.ToInt16(GetValue(agoals[i].ID));
                        playerID = TeamsConnection.transferedPlayerId(anames[i], awayTeam);
                        pls.Add(new Scorer(playerID, goals));
                    }
                }

                TeamsConnection.updateGoalsForAwayPointsAndGames(homeTeam, homeScore, awayScore);
                TeamsConnection.updateGoalsForAwayPointsAndGames(awayTeam, awayScore, homeScore);
                TeamsConnection.updatePlayerAppearancesGoals(pls, league);

                tran.Complete();
            }
        }
Beispiel #6
0
        //String foreignGoals;

        public TeamOfLeague(String tm, String league)
        {
            t                  = tm;
            l                  = league;
            players            = TeamsConnection.displayPlayers(t);
            pastTeams          = TeamsConnection.loadPastTeams();
            team               = TeamsConnection.displayCurrentTeam(t, l);
            loaned             = TeamsConnection.LoanedPlayers(t);
            currentAppearances = TeamsConnection.top5Appearances(t, l, true);
            currentGoals       = TeamsConnection.Top5goalscorers(t, l, true);
            overallAppearances = TeamsConnection.top5Appearances(t, l, false);
            overallGoals       = TeamsConnection.Top5goalscorers(t, l, false);
            avHeight           = TeamsConnection.averageHeight(t);
            avAge              = TeamsConnection.averageAge(t);
            travellers         = TeamsConnection.top3travellers(t);
            formerPlayers      = TeamsConnection.FormerPlayers(t);
            foreigners         = TeamsConnection.foreigners(t);
            info               = TeamsConnection.teamInfo(t);

            //foreignGoals = TeamsConnection.TeamGoalsFromForeigners(t, l);
        }
Beispiel #7
0
 public PlayerOfTeam(String pID, String tm, String lg)
 {
     playerID = pID;
     team     = tm;
     league   = lg;
     player   = TeamsConnection.getPlayerByID(pID, lg);
     overallLeagueAppearancesTeamOrder   = TeamsConnection.getLeagueAppearancesTeamOrder(pID, tm, lg, false);
     overallLeagueAppearancesLeagueOrder = TeamsConnection.getLeagueAppearancesLeagueOrder(pID, lg, false);
     presentLeagueAppearancesTeamOrder   = TeamsConnection.getLeagueAppearancesTeamOrder(pID, tm, lg, true);
     presentLeagueAppearancesLeagueOrder = TeamsConnection.getLeagueAppearancesLeagueOrder(pID, lg, true);
     overallLeagueGoalsTeamOrder         = TeamsConnection.getLeagueGoalsTeamOrder(pID, tm, lg, false);
     overallLeagueGoalsLeagueOrder       = TeamsConnection.getLeagueGoalsLeagueOrder(pID, lg, false);
     presentLeagueGoalsTeamOrder         = TeamsConnection.getLeagueGoalsTeamOrder(pID, tm, lg, true);
     presentLeagueGoalsLeagueOrder       = TeamsConnection.getLeagueGoalsLeagueOrder(pID, lg, true);
     overallLeagueGoalsRateTeamOrder     = TeamsConnection.getLeagueGoalsRateTeamOrder(pID, tm, lg, false);
     overallLeagueGoalsRateLeagueOrder   = TeamsConnection.getLeagueGoalsRateLeagueOrder(pID, lg, false);
     presentLeagueGoalsRateTeamOrder     = TeamsConnection.getLeagueGoalsRateTeamOrder(pID, tm, lg, true);
     presentLeagueGoalsRateLeagueOrder   = TeamsConnection.getLeagueGoalsRateLeagueOrder(pID, lg, true);
     info      = TeamsConnection.teamInfo(tm);
     pastTeams = TeamsConnection.getPastTeamsOfPlayer(pID);
 }
Beispiel #8
0
 private void loading()
 {
     lpid.Text = TeamsConnection.getLastPlayerID();
 }
 public PlayersPassedFromTeam(String team)
 {
     this.team = team;
     players   = TeamsConnection.getAllTheFormerOrPresentPlayers(team);
 }
Beispiel #10
0
 public PlayerSearch(String nam, int r)
     : base(nam)
 {
     playersSearched = TeamsConnection.getPlayersSearched(nam, 432423);
     flag            = false;
 }
Beispiel #11
0
 public PlayerSearch(String nam) : base(nam)
 {
     playersSearched = TeamsConnection.getPlayersSearched(nam);
     name            = nam;
     flag            = true;
 }
Beispiel #12
0
 public PlayerPlayedInCountry(String country)
 {
     this.country = country;
     players      = TeamsConnection.getAllPlayersPlayingInCountry(country);
 }
Beispiel #13
0
 public PlayerComingFromCountry(String country)
 {
     this.country = country;
     players      = TeamsConnection.getAllPlayersComingFromCountry(country);
 }
 public TeamOfFootballLeague(String t) :
     base(t, "Football League")
 {
     formerSups = TeamsConnection.FormerSuperleaguePlayers(t);
 }
Beispiel #15
0
        protected void newPlayerSubmit_Click(object sender, EventArgs e)
        {
            bool flag = false;

            if (npid.Text.Equals(""))
            {
                npid.Text = "FILL ME";
                flag      = true;
            }
            if (npname.Text.Equals(""))
            {
                npname.Text = "FILL ME";
                flag        = true;
            }
            if (npteam.Text.Equals(""))
            {
                npteam.Text = "FILL ME";
                flag        = true;
            }
            if (npheight.Text.Equals(""))
            {
                npheight.Text = "FILL ME";
                flag          = true;
            }
            if (npsgoals.Text.Equals(""))
            {
                npsgoals.Text = "FILL ME";
                flag          = true;
            }
            if (npfgoals.Text.Equals(""))
            {
                npfgoals.Text = "FILL ME";
                flag          = true;
            }
            if (npage.Text.Equals(""))
            {
                npage.Text = "FILL ME";
                flag       = true;
            }
            if (npposition.Text.Equals(""))
            {
                npposition.Text = "FILL ME";
                flag            = true;
            }
            if (npcountry.Text.Equals(""))
            {
                npcountry.Text = "FILL ME";
                flag           = true;
            }
            if (npsapps.Text.Equals(""))
            {
                npsapps.Text = "FILL ME";
                flag         = true;
            }
            if (npfapps.Text.Equals(""))
            {
                npfapps.Text = "FILL ME";
                flag         = true;
            }
            if (nploanedby.Text.Equals(""))
            {
                nploanedby.Text = "FILL ME";
                flag            = true;
            }
            if (npspapps.Text.Equals(""))
            {
                npspapps.Text = "FILL ME";
                flag          = true;
            }
            if (npfpapps.Text.Equals(""))
            {
                npfpapps.Text = "FILL ME";
                flag          = true;
            }
            if (npspgoals.Text.Equals(""))
            {
                npspgoals.Text = "FILL ME";
                flag           = true;
            }
            if (npfpgoals.Text.Equals(""))
            {
                npfpgoals.Text = "FILL ME";
                flag           = true;
            }
            if (npptnumber.Text.Equals(""))
            {
                npptnumber.Text = "FILL ME";
                flag            = true;
            }
            if (flag)
            {
                return;
            }
            using (TransactionScope tran = new TransactionScope())
            {
                float h = float.Parse(npheight.Text);

                /*float hei = (float)h;
                 * if (h.ToString().Length == 3)
                 * {
                 *  hei =(float) (h * 0.01f);
                 * }
                 * else if ((h.ToString().Length == 2))
                 * {
                 *  hei = (double) (h * 0.1f);
                 * }*/
                Player player = new Player(npid.Text, npname.Text, npteam.Text, h, Convert.ToInt16(npsgoals.Text)
                                           , Convert.ToInt16(npfgoals.Text), Convert.ToInt16(npage.Text), npposition.Text, npcountry.Text, Convert.ToInt16(npsapps.Text),
                                           Convert.ToInt16(npfapps.Text), nploanedby.Text, Convert.ToInt16(npspapps.Text), Convert.ToInt16(npfpapps.Text), Convert.ToInt16(npspgoals.Text),
                                           Convert.ToInt16(npfpgoals.Text));
                int res = TeamsConnection.addNewPlayer(player);


                if (res == -1)
                {
                    newPlayerWarnings.Text = "An error occured while inserting the players' personal data";
                    return;
                }

                int ptnum = Convert.ToInt16(npptnumber.Text);

                if (ptnum == 0)
                {
                    tran.Complete();
                    Response.Redirect(Request.RawUrl);
                    return;
                }
                List <PastTeams> psts    = new List <PastTeams>();
                bool             fl      = false;
                String           team    = null;
                String           country = null;

                foreach (TextBox t in ts)
                {
                    if (!fl)
                    {
                        team = GetValue(t.ID);
                        fl   = true;
                    }
                    else
                    {
                        country = GetValue(t.ID);
                        psts.Add(new PastTeams(npid.Text, team, country));
                        fl = false;
                    }
                }

                /*int counter = 0;
                 * foreach (TableRow row in table.Rows)
                 * {
                 *  bool fl = false;
                 *  string team = null;
                 *  string country = null;
                 *  TextBox t = null;
                 *  foreach (TableCell cell in row.Cells)
                 *  {
                 *      if (!cell.Text.Equals("TEAM") && !cell.Text.Equals("COUNTRY"))
                 *      {
                 *          if (!fl) {
                 *              t = cell.FindControl("pt" + counter) as TextBox;
                 *              team = t.Text;
                 *          }
                 *          else
                 *          {
                 *              t = cell.FindControl("ptc" + counter) as TextBox;
                 *              country = t.Text;
                 *              psts.Add(new PastTeams(npid.Text, team, country));
                 *              counter++;
                 *          }
                 *          fl = true;
                 *      }
                 *  }
                 * }*/

                res = TeamsConnection.addPastTeamsOfNewPlayer(psts);
                if (res == -1)
                {
                    newPlayerWarnings.Text = "An error occured while inserting the players' past teams' data";
                    return;
                }
                tran.Complete();
            }
            Response.Redirect(Request.RawUrl);
        }
Beispiel #16
0
        private void createControls(String team, Panel panel, bool home)
        {
            String prefix;

            if (home)
            {
                prefix = "h";
            }
            else
            {
                prefix = "a";
            }
            List <String> teamPlayers = TeamsConnection.displayPlayers(team, 23);

            TextBox[] goals = new TextBox[teamPlayers.Count];
            TextBox   score;

            TextBox[] apps  = new TextBox[teamPlayers.Count];
            String[]  names = new String[teamPlayers.Count];
            table          = new Table();
            table.CssClass = "players";
            TableCell cell;
            TableCell cell2;
            TableCell cell3;
            TableRow  row;
            TextBox   c;
            Label     l;
            TextBox   t;

            cell            = new TableCell();
            cell2           = new TableCell();
            row             = new TableRow();
            cell.Text       = "SCORE";
            cell.ColumnSpan = 2;
            score           = new TextBox();
            score.ID        = prefix + "_score";
            score.Width     = 15;
            score.Text      = "0";
            cell2.Controls.Add(score);
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            table.Rows.Add(row);
            cell       = new TableCell();
            cell2      = new TableCell();
            cell3      = new TableCell();
            row        = new TableRow();
            cell.Text  = "PLAYED";
            cell2.Text = "NAME";
            cell3.Text = "GOALS";
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            table.Rows.Add(row);
            int counter = 0;

            foreach (String pl in teamPlayers)
            {
                row   = new TableRow();
                cell  = new TableCell();
                cell2 = new TableCell();
                cell3 = new TableCell();
                c     = new TextBox();
                c.ID  = prefix + "_app_" + counter.ToString();
                if (prefix.Equals("h"))
                {
                    c.TextChanged += new EventHandler(onHomePlayerNumber_Change);
                }
                else
                {
                    c.TextChanged += new EventHandler(onAwayPlayerNumber_Change);
                }
                c.Text  = "0";
                c.Width = 10;
                //c.AutoPostBack = true;
                l          = new Label();
                l.Text     = pl;
                l.CssClass = "playerName";
                t          = new TextBox();
                t.ID       = prefix + "_goals_" + counter.ToString();
                t.Width    = 10;
                t.Text     = "0";
                t.CssClass = "playerGoals";
                cell.Controls.Add(c);
                cell2.Controls.Add(l);
                cell3.Controls.Add(t);
                goals[counter] = t;
                apps[counter]  = c;
                names[counter] = pl;
                row.Cells.Add(cell);
                row.Cells.Add(cell2);
                row.Cells.Add(cell3);
                table.Rows.Add(row);
                counter++;
            }
            panel.Controls.Add(table);
            if (home)
            {
                happs  = apps;
                hgoals = goals;
                hnames = names;
                hscore = score;
            }
            else
            {
                aapps  = apps;
                agoals = goals;
                anames = names;
                ascore = score;
            }
        }
Beispiel #17
0
 public TeamSearch(String nam) : base(nam)
 {
     teamsSearched = TeamsConnection.getTeamsSearched(nam);
 }