public string[] LoadPlayers(bool AllPlayers = true) { CoreDiploScore.DipDbDataSet DataSet = new CoreDiploScore.DipDbDataSet(); CoreDiploScore.DipDbDataSet.PlayersDataTable Dt1 = DataSet.Players; CoreDiploScore.DipDbDataSetTableAdapters.PlayersTableAdapter DTA = new DipDbDataSetTableAdapters.PlayersTableAdapter(); if (AllPlayers) { DTA.Fill(Dt1); } else { DTA.FillPlayersByTournamentID(Dt1, Class_ActiveTournament); } int numeroRighe = Dt1.Rows.Count; string[] Lista = new string[numeroRighe]; for (int i = 0; i < numeroRighe; i++) { string outVal = Dt1.Rows[i].ItemArray[0].ToString(); outVal = Dt1.Rows[i].ItemArray[3].ToString() + PublicClass.Separator + outVal; outVal = Dt1.Rows[i].ItemArray[2].ToString() + PublicClass.Separator + outVal; outVal = Dt1.Rows[i].ItemArray[1].ToString() + PublicClass.Separator + outVal; Lista[i] = outVal; } return(Lista); }
public bool WritePlayersForRoundAndGame(string[] PlayerText, int Round_CB, int Game_CB) { bool retVal = false; CoreDiploScore.DipDbDataSet DataSet = new CoreDiploScore.DipDbDataSet(); CoreDiploScore.DipDbDataSet.GamesDataTable Dt1 = DataSet.Games; CoreDiploScore.DipDbDataSetTableAdapters.GamesTableAdapter DTA = new DipDbDataSetTableAdapters.GamesTableAdapter(); DTA.Fill(Dt1); DipDbDataSet.GamesRow myDR = Dt1.NewGamesRow(); int Counter = 1; //do not enter game id starting at the next position myDR[Counter] = Convert.ToInt32(Game_CB); Counter++; myDR[Counter] = Convert.ToInt32(Round_CB); Counter++; myDR[Counter] = Class_ActiveTournament; Counter++; for (int i = 0; i < CoreDiploScore.PublicClass.NUMBEROFPLAYERS; i++) { // "Austria", "Germany", "Italy", "France", "UK", "Russia", "Turkey", "Total" string[] splitResult = PlayerText[i].Split(PublicClass.SeparatorChar); myDR[Counter + i] = Convert.ToInt32(splitResult[3]); } Dt1.Rows.Add(myDR); DTA.Update(DataSet.Games); return(retVal); }