private void init_list_team(List <STEntryTeam> lst) { bool bp; try { checkedListBoxTeam.Items.Clear(); List <STEntryTeam> list_all = clET.GetTeamParticipant(IS.idseason); bp = false; foreach (STEntryTeam eteam in list_all) { foreach (STEntryTeam team in lst) { if (eteam.idteam == team.idteam) { bp = true; } } clTeam = new CTeam(connect, eteam.idteam); checkedListBoxTeam.Items.Add(clTeam.stTeam.name, bp); bp = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
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 init_data() { CTeam clTeam; try { dataGridViewFinalResult.Rows.Clear(); list_team = clET.GetTeamParticipant(IS.idseason, currdiv.id); if (list_team.Count > 0) { g_f = true; dataGridViewFinalResult.Rows.Add(list_team.Count); for (int i = 0; i < list_team.Count; i++) { STFinalResult st = clWork.GetData(IS.idseason, currdiv.id, list_team[i].idteam); clTeam = new CTeam(connect, list_team[i].idteam); if (st.rang > 0) { dataGridViewFinalResult.Rows[i].Cells[0].Value = st.rang.ToString(); } else { dataGridViewFinalResult.Rows[i].Cells[0].Value = ""; } dataGridViewFinalResult.Rows[i].Cells[1].Value = clTeam.stTeam.name; if (flawour.idteam == list_team[i].idteam) { gpos = i; } } dataGridViewFinalResult.ClearSelection(); dataGridViewFinalResult.AllowUserToAddRows = false; } else { dataGridViewFinalResult.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void init_combo_team(int iddiv) { try { CEntryTeam clET = new CEntryTeam(connect); List <STEntryTeam> lst = clET.GetTeamParticipant(IS.idseason, iddiv); foreach (STEntryTeam item in lst) { clTeam = new CTeam(connect, item.idteam); comboBoxTeam.Items.Add(clTeam.stTeam.name); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void init_data() { CTeam clTeam; CDivision clDivision; CPlayer clPlayer; CCoach clCoach; CEntryPlayers clEP = new CEntryPlayers(connect); string text; try { g_f = false; dataGridViewTeamPart.Rows.Clear(); list = new List <STEntryTeam>(); if (iddiv == 0) { list = clTeamParticipant.GetTeamParticipant((int)IS.idseason); } else { list = clTeamParticipant.GetTeamParticipant((int)IS.idseason, iddiv); } if (list.Count > 0) { g_f = true; dataGridViewTeamPart.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { /* № п\п */ dataGridViewTeamPart.Rows[i].Cells[0].Value = (i + 1).ToString(); /* Команда */ clTeam = new CTeam(connect, list[i].idteam); dataGridViewTeamPart.Rows[i].Cells[1].Value = clTeam.stTeam.name; /* Главный тренер */ if (list[i].idcoach1 != null) { clCoach = new CCoach(connect, (int)list[i].idcoach1); text = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); dataGridViewTeamPart.Rows[i].Cells[2].Value = text; } /* Помощник тренера */ if (list[i].idcoach2 != null && list[i].idcoach2 != 0) { clCoach = new CCoach(connect, (int)list[i].idcoach2); text = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); if (list[i].idcoach3 != null && list[i].idcoach3 != 0) { clCoach = new CCoach(connect, (int)list[i].idcoach3); string text1 = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); text = text + ", " + text1; } dataGridViewTeamPart.Rows[i].Cells[3].Value = text; } /* Капитан */ if (list[i].idcaptain != null) { clPlayer = new CPlayer(connect, (int)list[i].idcaptain); text = string.Format("{0} {1}", clPlayer.stPlayer.family, clPlayer.stPlayer.name); dataGridViewTeamPart.Rows[i].Cells[4].Value = text; } /* Число игроков в команде */ dataGridViewTeamPart.Rows[i].Cells[5].Value = clEP.GetCntPlayers(list[i].idseason, list[i].idteam, null); /* Дата заявки */ dataGridViewTeamPart.Rows[i].Cells[6].Value = list[i].datein.ToShortDateString(); /* Дивизион */ clDivision = new CDivision(connect, list[i].idseason, list[i].iddivision); dataGridViewTeamPart.Rows[i].Cells[7].Value = clDivision.stDiv.name; double power = get_power(list[i].idteam); dataGridViewTeamPart.Rows[i].Cells[8].Value = power.ToString(); } dataGridViewTeamPart.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void out_coach() { CCoach clCoach; List <STCoach> list; CEntryTeam clET = new CEntryTeam(connect); List <STEntryTeam> lst_et = clET.GetTeamParticipant(IS.idseason); try { clCoach = new CCoach(connect); // list = clCoach.GetList(); List <STSmartBookCoach> lst_smart = new List <STSmartBookCoach>(); STSmartBookCoach item; foreach (STEntryTeam row in lst_et) { if (row.idcoach1 != null && row.idcoach1 > 0) { item = new STSmartBookCoach(); clCoach = new CCoach(connect, (int)row.idcoach1); item.family = clCoach.stCoach.family; item.idcoach = clCoach.stCoach.idcoach; item.name = clCoach.stCoach.name; item.idteam = row.idteam; lst_smart.Add(item); } if (row.idcoach2 != null && row.idcoach2 > 0) { item = new STSmartBookCoach(); clCoach = new CCoach(connect, (int)row.idcoach2); item.family = clCoach.stCoach.family; item.idcoach = clCoach.stCoach.idcoach; item.name = clCoach.stCoach.name; item.idteam = row.idteam; lst_smart.Add(item); } if (row.idcoach3 != null && row.idcoach3 > 0) { item = new STSmartBookCoach(); clCoach = new CCoach(connect, (int)row.idcoach3); item.family = clCoach.stCoach.family; item.idcoach = clCoach.stCoach.idcoach; item.name = clCoach.stCoach.name; item.idteam = row.idteam; lst_smart.Add(item); } } CSmartBookCoach clSmart = new CSmartBookCoach(pathbook); clSmart.Write(lst_smart); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void init_data() { g_f = false; gpos = -1; CPlayer clPlayer; CTeam clTeam; CEntryTeam clET; string text; try { full_list = new List <STEntryPlayers>(); List <STEntryPlayers> data_list = clWork.GetListEntryPlayers(IS.idseason, param_idteam, "IdTeam,Number"); if (param_iddiv > 0) { clET = new CEntryTeam(connect); List <STEntryTeam> lstet = clET.GetTeamParticipant(IS.idseason, param_iddiv); foreach (STEntryPlayers step in data_list) { foreach (STEntryTeam stet in lstet) { if (step.idteam == stet.idteam) { full_list.Add(step); break; } } } } else { full_list = data_list; } dataGridViewEntryPlayers.Rows.Clear(); Color colortext; Color colorfont; int currteam = 0; bool fl = false; string amplua = ""; int npp = 1; if (full_list.Count > 0) { currteam = full_list[0].idteam; g_f = true; dataGridViewEntryPlayers.Rows.Add(full_list.Count); for (int i = 0; i < full_list.Count; i++) { if (currteam != full_list[i].idteam) { currteam = full_list[i].idteam; fl = !fl; npp = 1; } if (fl) { colorfont = Color.LightCyan; } else { colorfont = Color.White; } colortext = Color.Black; dataGridViewEntryPlayers.Rows[i].DefaultCellStyle.BackColor = colorfont; clET = new CEntryTeam(connect, IS.idseason, full_list[i].idteam); if (full_list[i].datein != clET.gstTeamPart.datein) { colortext = Color.Blue; } dataGridViewEntryPlayers.Rows[i].Cells[0].Value = npp.ToString(); if (full_list[i].amplua != null) { if (full_list[i].amplua == 1) { amplua = "З"; } if (full_list[i].amplua == 2) { amplua = "Ф"; } if (full_list[i].amplua == 3) { amplua = "Ц"; } } else { amplua = ""; } dataGridViewEntryPlayers.Rows[i].Cells[1].Value = amplua; clPlayer = new CPlayer(connect, full_list[i].idplayer); text = string.Format("{0} {1} {2}", clPlayer.stPlayer.family, clPlayer.stPlayer.name, clPlayer.stPlayer.payname); dataGridViewEntryPlayers.Rows[i].Cells[2].Value = text; clTeam = new CTeam(connect, full_list[i].idteam); dataGridViewEntryPlayers.Rows[i].Cells[3].Value = clTeam.stTeam.name; dataGridViewEntryPlayers.Rows[i].Cells[4].Value = full_list[i].number; if (full_list[i].growing != null) { dataGridViewEntryPlayers.Rows[i].Cells[5].Value = full_list[i].growing.ToString(); } if (full_list[i].weight != null) { dataGridViewEntryPlayers.Rows[i].Cells[6].Value = full_list[i].weight.ToString(); } dataGridViewEntryPlayers.Rows[i].Cells[7].Value = full_list[i].datein.ToShortDateString(); if (full_list[i].dateout != null) { DateTime dt = (DateTime)full_list[i].dateout; dataGridViewEntryPlayers.Rows[i].Cells[8].Value = dt.ToShortDateString(); colortext = colortext = Color.Red; } dataGridViewEntryPlayers.Rows[i].Cells[9].Value = full_list[i].idplayer.ToString(); dataGridViewEntryPlayers.Rows[i].Cells[10].Value = clPlayer.stPlayer.personalnum; dataGridViewEntryPlayers.Rows[i].Cells[11].Value = full_list[i].priority.ToString(); dataGridViewEntryPlayers.Rows[i].DefaultCellStyle.ForeColor = colortext; if (flawour.Equals(full_list[i])) { gpos = i; } npp++; } dataGridViewEntryPlayers.AllowUserToAddRows = false; } else { dataGridViewEntryPlayers.AllowUserToAddRows = false; } toolStripStatusLabel1.Text = string.Format("Количество записей: {0}", full_list.Count); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }