/* инициализация списка тренеров */ private void init_combo_coach() { CCoach clCoach; string text; try { clCoach = new CCoach(connect); list_coach = clCoach.GetList(); comboBoxCoach1.Items.Add(""); comboBoxCoach2.Items.Add(""); comboBoxCoach3.Items.Add(""); foreach (STCoach item in list_coach) { text = string.Format("{0} {1}", item.family, item.name); comboBoxCoach1.Items.Add(text); comboBoxCoach2.Items.Add(text); comboBoxCoach3.Items.Add(text); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
void init_list2ch() { int[] arr = {}; string name; checkedListBox2ch.Items.Clear(); for (int i = 0; i < arr.Length; i++) { clCoach = new CCoach(connect, arr[i]); name = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, arr[i]); if (mode == 0) { checkedListBox2ch.Items.Add(name, false); } else { if (arr[i] == Data[11]) { checkedListBox2ch.Items.Add(name, true); } else { checkedListBox2ch.Items.Add(name, false); } } } }
/* вставка данных */ private void set_data() { CCoach clCoach; CPlayer clPlayer; string text; try { team = new CTeam(connect, stTeamPart.idteam); comboBoxNameTeam.Text = team.stTeam.name; CCity city = new CCity(connect, team.stTeam.idcity); labelDisl.Text = string.Format("{0}, {1}", city.stFullCity.name, city.stFullCity.nameregion); dateTimePickerDateIn.Value = stTeamPart.datein; div = new CDivision(connect, (int)IS.idseason, stTeamPart.iddivision); comboBoxDivision.Text = div.stDiv.name; clTeamComposition = new CEntryPlayers(connect); team_composition = clTeamComposition.GetListEntryPlayers(IS.idseason, stTeamPart.idteam, "Number"); init_data(team_composition); init_combo_captain(); if (stTeamPart.idcoach1 != null) { clCoach = new CCoach(connect, (int)stTeamPart.idcoach1); text = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); comboBoxCoach1.Text = text; } if (stTeamPart.idcoach2 != null) { clCoach = new CCoach(connect, (int)stTeamPart.idcoach2); text = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); comboBoxCoach2.Text = text; } if (stTeamPart.idcoach3 != null) { clCoach = new CCoach(connect, (int)stTeamPart.idcoach3); text = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); comboBoxCoach3.Text = text; } if (stTeamPart.idcaptain != null) { clPlayer = new CPlayer(connect, (int)stTeamPart.idcaptain); string num = get_num_captain((int)stTeamPart.idcaptain); text = string.Format("#{0} {1} {2}", num, clPlayer.stPlayer.family, clPlayer.stPlayer.name); comboBoxCaptain.Text = text; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
public Coach(SqlConnection cn, STInfoSeason inf, ushort md) { InitializeComponent(); connect = cn; IS = inf; mode = md; clCoach = new CCoach(connect); this.WindowState = FormWindowState.Maximized; }
private void set_data() { string text; try { textBoxId.Text = gstTF.id.ToString(); clTeam = new CTeam(connect, gstTF.idteam); comboBoxTeam.Text = clTeam.stTeam.name; if (gstTF.typepart == 0) { radioButtonPlayer.Checked = true; clPlayer = new CPlayer(connect, gstTF.idpart); text = string.Format("{0} {1} ({2})", clPlayer.stPlayer.family, clPlayer.stPlayer.name, clPlayer.stPlayer.personalnum); comboBoxPart.Text = text; } if (gstTF.typepart == 1) { radioButtonCoach.Checked = true; clCoach = new CCoach(connect, gstTF.idpart); text = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, clCoach.stCoach.personalnum); comboBoxPart.Text = text; } textBoxNGame.Text = gstTF.idgame.ToString(); game = clGame.GetGame(gstTF.idseason, gstTF.idgame); clTeam = new CTeam(connect, (int)game.idteam1); name1 = clTeam.stTeam.name; clTeam = new CTeam(connect, (int)game.idteam2); name2 = clTeam.stTeam.name; text = string.Format("{0} - {1}", name1, name2); textBoxDescriptGame.Text = text; textBoxDescript.Text = gstTF.descript; if (gstTF.idreferee > 0) { clReferee = new CReferee(connect, (int)gstTF.idreferee); text = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name); comboBoxReferee.Text = text; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
public DlgCoach(SqlConnection cn, ushort md) { InitializeComponent(); connect = cn; mode = md; clCoach = new CCoach(connect); clParam = new CParamApp(); gid = clCoach.GetFreeId(); caption = "Ќовый тренер"; }
public DlgCoach(SqlConnection cn, ushort md, STCoach st) { InitializeComponent(); connect = cn; mode = md; gstCoach = st; gid = gstCoach.idcoach; clCoach = new CCoach(connect); clParam = new CParamApp(); caption = "–едактировать данные тренера"; }
private void set_data() { string text; try { textBoxId.Text = gstDV.id.ToString(); clDiv = new CDivision(connect, idseason, gstDV.iddivision); comboBoxDivision.Text = clDiv.stDiv.name; clTeam = new CTeam(connect, gstDV.idteam); comboBoxTeam.Text = clTeam.stTeam.name; if (gstDV.typepart == 0) { radioButtonPlayer.Checked = true; clPlayer = new CPlayer(connect, gstDV.idpart); text = string.Format("{0} {1} ({2})", clPlayer.stPlayer.family, clPlayer.stPlayer.name, clPlayer.stPlayer.personalnum); comboBoxPart.Text = text; } if (gstDV.typepart == 1) { radioButtonCoach.Checked = true; clCoach = new CCoach(connect, gstDV.idpart); text = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, clCoach.stCoach.personalnum); comboBoxPart.Text = text; } textBoxCntGame.Text = gstDV.cntgame.ToString(); dateTimePickerDateBegin.Value = gstDV.datebegin; dateTimePickerDateEnd.Value = gstDV.dateend; textBoxDescript.Text = gstDV.descript; } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private int get_id_coach(string text) { int ret = 0; try { char[] del = { ' ' }; string[] words = text.Split(del); string famili = words[0]; string name = words[1]; CCoach cl = new CCoach(connect, famili, name); ret = cl.stCoach.idcoach; } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } return(ret); }
void init_list1ch() { int[] arr = { 123, 9, 68, 4, 62, 78, 43, 55, 6, 170, 193, 85, 108, 195, 203, 225, 26, 148, 190, 75, 226, 120 }; string name; checkedListBox1ch.Items.Clear(); List <STCoach> lst_p = new List <STCoach>(); for (int i = 0; i < arr.Length; i++) { clCoach = new CCoach(connect, arr[i]); lst_p.Add(clCoach.stCoach); } ListCompareNameCoach comp = new ListCompareNameCoach(); lst_p.Sort(comp); foreach (STCoach item in lst_p) { name = string.Format("{0} {1} ({2})", item.family, item.name, item.idcoach); if (mode == 0) { checkedListBox1ch.Items.Add(name, false); } else { if (item.idcoach == Data[5]) { checkedListBox1ch.Items.Add(name, true); } else { checkedListBox1ch.Items.Add(name, false); } } } }
private void init_data() { try { dataGridViewStatCoach.Rows.Clear(); list = clWork.GetListData(IS.idseason); if (list.Count > 0) { dataGridViewStatCoach.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { dataGridViewStatCoach.Rows[i].Cells[0].Value = list[i].idgame; clTeam = new CTeam(connect, list[i].idteam); dataGridViewStatCoach.Rows[i].Cells[1].Value = clTeam.stTeam.name; clCoach = new CCoach(connect, list[i].idcoach); dataGridViewStatCoach.Rows[i].Cells[2].Value = string.Format("{0} {1}", clCoach.stCoach.family, clCoach.stCoach.name); dataGridViewStatCoach.Rows[i].Cells[3].Value = list[i].cntfoulst.ToString(); dataGridViewStatCoach.Rows[i].Cells[4].Value = list[i].cntfoulsd.ToString(); dataGridViewStatCoach.Rows[i].Cells[5].Value = list[i].filename; } dataGridViewStatCoach.AllowUserToAddRows = false; } else { dataGridViewStatCoach.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
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_list() { CPlayer clPlayer; CCoach clCoach; CTeam clTeam; CGame clGame; STGame game; string text = null; string name1, name2; try { list = clDv.GetListData(IS.idseason); dataGridViewDV.Rows.Clear(); if (list.Count > 0) { g_f = true; dataGridViewDV.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { dataGridViewDV.Rows[i].Cells[0].Value = list[i].id.ToString(); if (list[i].typepart == 0) { clPlayer = new CPlayer(connect, list[i].idpart); text = string.Format("{0} {1}", clPlayer.stPlayer.family.ToUpper(), clPlayer.stPlayer.name); } else if (list[i].typepart == 1) { clCoach = new CCoach(connect, list[i].idpart); text = string.Format("{0} {1} (тренер)", clCoach.stCoach.family.ToUpper(), clCoach.stCoach.name); } dataGridViewDV.Rows[i].Cells[1].Value = text; clTeam = new CTeam(connect, list[i].idteam); dataGridViewDV.Rows[i].Cells[2].Value = clTeam.stTeam.name; dataGridViewDV.Rows[i].Cells[3].Value = list[i].cntgame; dataGridViewDV.Rows[i].Cells[4].Value = list[i].datebegin.ToLongDateString(); dataGridViewDV.Rows[i].Cells[5].Value = list[i].dateend.ToLongDateString(); dataGridViewDV.Rows[i].Cells[6].Value = list[i].descript; if (flawour.Equals(list[i])) { gpos = i; } } dataGridViewDV.AllowUserToAddRows = false; } else { dataGridViewDV.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private STDiscvalification read_data() { STDiscvalification ret = new STDiscvalification(); string text; try { ret.idseason = idseason; if (textBoxId.Text.Length > 0) { ret.id = int.Parse(textBoxId.Text.Trim()); } else { ret.id = 0; } if (radioButtonPlayer.Checked == true) { ret.typepart = 0; char[] del = { ' ', '(', ')' }; string s = comboBoxPart.Text.Trim(); string[] words = s.Split(del); clPlayer = new CPlayer(connect, words[0].Trim(), words[1].Trim(), words[3].Trim()); ret.idpart = clPlayer.stPlayer.idplayer; } if (radioButtonCoach.Checked == true) { ret.typepart = 1; char[] del = { ' ', '(', ')' }; string s = comboBoxPart.Text.Trim(); string[] words = s.Split(del); clCoach = new CCoach(connect, words[0].Trim(), words[1].Trim(), words[3].Trim()); ret.idpart = clCoach.stCoach.idcoach; } if (comboBoxTeam.Text.Length > 0) { clTeam = new CTeam(connect, comboBoxTeam.Text.Trim()); ret.idteam = clTeam.stTeam.id; } if (textBoxCntGame.Text.Length > 0) { ret.cntgame = int.Parse(textBoxCntGame.Text.Trim()); } else { ret.cntgame = 0; } ret.datebegin = new DateTime(dateTimePickerDateBegin.Value.Year, dateTimePickerDateBegin.Value.Month, dateTimePickerDateBegin.Value.Day, 0, 0, 0, 0); ret.dateend = new DateTime(dateTimePickerDateEnd.Value.Year, dateTimePickerDateEnd.Value.Month, dateTimePickerDateEnd.Value.Day, 0, 0, 0, 0); ret.descript = textBoxDescript.Text.Trim(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } return(ret); }
private STTehnicFouls read_data() { STTehnicFouls ret = new STTehnicFouls(); string text; try { ret.idseason = idseason; if (textBoxId.Text.Length > 0) { ret.id = int.Parse(textBoxId.Text.Trim()); } else { ret.id = 0; } if (radioButtonPlayer.Checked == true) { ret.typepart = 0; char[] del = { ' ', '(', ')' }; string s = comboBoxPart.Text.Trim(); string[] words = s.Split(del); clPlayer = new CPlayer(connect, words[0].Trim(), words[1].Trim(), words[3].Trim()); ret.idpart = clPlayer.stPlayer.idplayer; } if (radioButtonCoach.Checked == true) { ret.typepart = 1; char[] del = { ' ', '(', ')' }; string s = comboBoxPart.Text.Trim(); string[] words = s.Split(del); clCoach = new CCoach(connect, words[0].Trim(), words[1].Trim(), words[3].Trim()); ret.idpart = clCoach.stCoach.idcoach; } if (comboBoxTeam.Text.Length > 0) { clTeam = new CTeam(connect, comboBoxTeam.Text.Trim()); ret.idteam = clTeam.stTeam.id; } if (textBoxNGame.Text.Length > 0) { ret.idgame = int.Parse(textBoxNGame.Text.Trim()); } else { ret.idgame = 0; } if (ret.idgame > 0) { STGame st = clGame.GetGame(idseason, ret.idgame); ret.date = new DateTime(st.datetime.Value.Year, st.datetime.Value.Month, st.datetime.Value.Day, 0, 0, 0, 0); } else { ret.date = DateTime.Now; } ret.descript = textBoxDescript.Text.Trim(); if (comboBoxReferee.Text.Length > 0) { ret.idreferee = get_referee(comboBoxReferee.Text.Trim()); } else { ret.idreferee = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } return(ret); }
private void init_combo_part() { int idteam = 0; CEntryPlayers clEP = new CEntryPlayers(connect); CEntryTeam clET; string text; try { comboBoxPart.Items.Clear(); if (comboBoxTeam.Text.Length > 0) { clTeam = new CTeam(connect, comboBoxTeam.Text.Trim()); idteam = clTeam.stTeam.id; } else { idteam = 0; } if (radioButtonPlayer.Checked == true) { List <STEntryPlayers> lst = clEP.GetListEntryPlayers(idseason, idteam, null); foreach (STEntryPlayers step in lst) { clPlayer = new CPlayer(connect, step.idplayer); text = string.Format("{0} {1} ({2})", clPlayer.stPlayer.family, clPlayer.stPlayer.name, clPlayer.stPlayer.personalnum); comboBoxPart.Items.Add(text); } } if (radioButtonCoach.Checked == true) { clET = new CEntryTeam(connect, idseason, idteam); if (clET.gstTeamPart.idcoach1 != null) { clCoach = new CCoach(connect, (int)clET.gstTeamPart.idcoach1); if (clCoach.stCoach.idcoach > 0) { text = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, clCoach.stCoach.personalnum); comboBoxPart.Items.Add(text); } } if (clET.gstTeamPart.idcoach2 != null) { clCoach = new CCoach(connect, (int)clET.gstTeamPart.idcoach2); if (clCoach.stCoach.idcoach > 0) { text = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, clCoach.stCoach.personalnum); comboBoxPart.Items.Add(text); } } if (clET.gstTeamPart.idcoach3 != null) { clCoach = new CCoach(connect, (int)clET.gstTeamPart.idcoach3); if (clCoach.stCoach.idcoach > 0) { text = string.Format("{0} {1} ({2})", clCoach.stCoach.family, clCoach.stCoach.name, clCoach.stCoach.personalnum); comboBoxPart.Items.Add(text); } } } } 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()); } }