private void init_combo_players(int iddivision) { CEntryPlayers clEP = new CEntryPlayers(connect); CEntryTeam clET = new CEntryTeam(connect); List <STEntryPlayers> list; List <STEntryTeam> list_team; string text = null; try { comboBoxPlayer.Items.Clear(); list_team = clET.GetTeamParticipant(idseason, iddivision); foreach (STEntryTeam it in list_team) { list = clEP.GetListEntryPlayersReal(idseason, it.idteam, DateTime.Now, null); foreach (STEntryPlayers item in list) { CPlayer clPlayer = new CPlayer(connect, item.idplayer); text = string.Format("{0} {1} ({2})", clPlayer.stPlayer.family, clPlayer.stPlayer.name, clPlayer.stPlayer.personalnum); comboBoxPlayer.Items.Add(text); } } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void create() { try { FileInfo fi1 = new FileInfo(fullpath); StreamWriter sw = fi1.CreateText(); CEntryTeam clET = new CEntryTeam(connect); CEntryPlayers clEP = new CEntryPlayers(connect); List <STEntryPlayers> list_p; CPlayer clPlayer; string text; string number; List <STEntryTeamWithName> lst = clET.GetTeamParticipantWithName(IS.idseason, "EntryTeam.IdDivision, Team.NameTeam"); foreach (STEntryTeamWithName team in lst) { sw.WriteLine("-"); sw.WriteLine(team.name.ToString().ToUpper()); list_p = clEP.GetListEntryPlayersReal(IS.idseason, team.idteam, param, null); foreach (STEntryPlayers ep in list_p) { if (ep.priority == 0) { clPlayer = new CPlayer(connect, ep.idplayer); number = "0"; if (ep.number.Length > 0 && ep.number.Length <= 2) { number = ep.number; } text = string.Format("{0} {1}", number, clPlayer.stPlayer.family); sw.WriteLine(text); } } } sw.WriteLine("-"); sw.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void Stats_Load(object sender, EventArgs e) { string text; CTeam cl; CCity clc; int idcity1 = 0, idcity2 = 0; try { cl = new CTeam(connect, (int)gSTGame.idteam1); nameteam1 = cl.stTeam.name; idcity1 = cl.stTeam.idcity; cl = new CTeam(connect, (int)gSTGame.idteam2); nameteam2 = cl.stTeam.name; idcity2 = cl.stTeam.idcity; text = string.Format("Статистика игры: {0} - {1} {2}:{3}", nameteam1, nameteam2, gSTGame.apoints, gSTGame.bpoints); this.Text = text; clc = new CCity(connect, idcity1); if (clc.stFullCity.name != null) { radioButtonTeam1.Text = string.Format("{0} ({1},{2})", nameteam1, clc.stFullCity.name, clc.stFullCity.namecountry); } else { radioButtonTeam1.Text = nameteam1; } clc = new CCity(connect, idcity2); if (clc.stFullCity.name != null) { radioButtonTeam2.Text = string.Format("{0} ({1},{2})", nameteam2, clc.stFullCity.name, clc.stFullCity.namecountry); } else { radioButtonTeam2.Text = nameteam2; } curridteam = (int)gSTGame.idteam1; currnameteam = nameteam1; currentpoints = (int)gSTGame.apoints; clTC = new CEntryPlayers(connect); List <STEntryPlayers> lst = clTC.GetListEntryPlayersReal(IS.idseason, (int)gSTGame.idteam1, (DateTime)gSTGame.datetime, null); team1 = lst; team1.Sort(clep); lst = clTC.GetListEntryPlayersReal(IS.idseason, (int)gSTGame.idteam2, (DateTime)gSTGame.datetime, null); team2 = lst; team2.Sort(clep); currteam = team1; init_data(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void init_data_leader_team() { try { CEntryPlayers clEP = new CEntryPlayers(connect); List <STEntryPlayers> data_list1 = clEP.GetListEntryPlayersReal(IS.idseason, team1.id, DateTime.Now, null); List <STEntryPlayers> data_list2 = clEP.GetListEntryPlayersReal(IS.idseason, team2.id, DateTime.Now, null); List <RecordPlayerPreView> stTeam1 = CalculateStats(data_list1); List <RecordPlayerPreView> stTeam2 = CalculateStats(data_list2); dataGridViewLeader.Rows.Clear(); dataGridViewLeader.Rows.Add(9); /* Очки */ dataGridViewLeader.Rows[0].Cells[0].Value = GetStringData(stTeam1, 1); dataGridViewLeader.Rows[0].Cells[1].Value = "Очки"; dataGridViewLeader.Rows[0].Cells[2].Value = GetStringData(stTeam2, 1); /* Подборы */ dataGridViewLeader.Rows[1].Cells[0].Value = GetStringData(stTeam1, 2); dataGridViewLeader.Rows[1].Cells[1].Value = "Подборы"; dataGridViewLeader.Rows[1].Cells[2].Value = GetStringData(stTeam2, 2); /* Передачи */ dataGridViewLeader.Rows[2].Cells[0].Value = GetStringData(stTeam1, 3); dataGridViewLeader.Rows[2].Cells[1].Value = "Передачи"; dataGridViewLeader.Rows[2].Cells[2].Value = GetStringData(stTeam2, 3); /* Перехваты */ dataGridViewLeader.Rows[3].Cells[0].Value = GetStringData(stTeam1, 4); dataGridViewLeader.Rows[3].Cells[1].Value = "Перехваты"; dataGridViewLeader.Rows[3].Cells[2].Value = GetStringData(stTeam2, 4); /* Блок-шоты */ dataGridViewLeader.Rows[4].Cells[0].Value = GetStringData(stTeam1, 5); dataGridViewLeader.Rows[4].Cells[1].Value = "Блок-шоты"; dataGridViewLeader.Rows[4].Cells[2].Value = GetStringData(stTeam2, 5); /* Процент 2 очк. */ dataGridViewLeader.Rows[5].Cells[0].Value = GetStringData(stTeam1, 6); dataGridViewLeader.Rows[5].Cells[1].Value = "Процент 2 очк."; dataGridViewLeader.Rows[5].Cells[2].Value = GetStringData(stTeam2, 6); /* Процент 3 очк. */ dataGridViewLeader.Rows[6].Cells[0].Value = GetStringData(stTeam1, 7); dataGridViewLeader.Rows[6].Cells[1].Value = "Процент 3 очк."; dataGridViewLeader.Rows[6].Cells[2].Value = GetStringData(stTeam2, 7); /* Процент штраф. */ dataGridViewLeader.Rows[7].Cells[0].Value = GetStringData(stTeam1, 8); dataGridViewLeader.Rows[7].Cells[1].Value = "Процент штраф."; dataGridViewLeader.Rows[7].Cells[2].Value = GetStringData(stTeam2, 8); /* Процент с игры */ dataGridViewLeader.Rows[8].Cells[0].Value = GetStringData(stTeam1, 9); dataGridViewLeader.Rows[8].Cells[1].Value = "Процент с игры"; dataGridViewLeader.Rows[8].Cells[2].Value = GetStringData(stTeam2, 9); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }