private void out_referee() { CReferee clRef; List <STReferee> list; try { clRef = new CReferee(connect); list = clRef.GetList(); List <STSmartBookReferee> lst_smart = new List <STSmartBookReferee>(); STSmartBookReferee item; foreach (STReferee row in list) { item = new STSmartBookReferee(); item.idref = row.idref; item.name = row.name; item.family = row.family; lst_smart.Add(item); } CSmartBookReferee clSmart = new CSmartBookReferee(pathbook); clSmart.Write(lst_smart); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
/* инициализаци¤ списка судей */ private void init_combo_referee() { string text = null; try { comboBoxStReferee.Items.Clear(); comboBoxReferee1.Items.Clear(); comboBoxReferee2.Items.Clear(); clReferee = new CReferee(connect); List <STReferee> lst = clReferee.GetList(); comboBoxStReferee.Items.Add(""); comboBoxReferee1.Items.Add(""); comboBoxReferee2.Items.Add(""); foreach (STReferee item in lst) { if (item.vf == 1) { text = string.Format("{0} {1}", item.family, item.name); comboBoxStReferee.Items.Add(text); comboBoxReferee1.Items.Add(text); comboBoxReferee2.Items.Add(text); } } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
public Referee(SqlConnection cn, STInfoSeason inf, ushort md) { InitializeComponent(); connect = cn; IS = inf; mode = md; clReferee = new CReferee(connect); this.WindowState = FormWindowState.Maximized; }
private void init_data() { try { dataGridViewStatReferee.Rows.Clear(); list = clWork.GetListData(IS.idseason); if (list.Count > 0) { dataGridViewStatReferee.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { dataGridViewStatReferee.Rows[i].Cells[0].Value = list[i].idgame; clReferee = new CReferee(connect, list[i].idreferee); dataGridViewStatReferee.Rows[i].Cells[1].Value = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name); CTeam clTeam = new CTeam(connect, list[i].idteam); dataGridViewStatReferee.Rows[i].Cells[2].Value = clTeam.stTeam.name; int sum = list[i].cntfoulsd + list[i].cntfoulsp + list[i].cntfoulst + list[i].cntfoulsu; dataGridViewStatReferee.Rows[i].Cells[3].Value = sum.ToString(); dataGridViewStatReferee.Rows[i].Cells[4].Value = list[i].cntfoulsp.ToString(); dataGridViewStatReferee.Rows[i].Cells[5].Value = list[i].cntfoulsu.ToString(); dataGridViewStatReferee.Rows[i].Cells[6].Value = list[i].cntfoulst.ToString(); dataGridViewStatReferee.Rows[i].Cells[7].Value = list[i].cntfoulsd.ToString(); dataGridViewStatReferee.Rows[i].Cells[8].Value = list[i].cntfoulsc.ToString(); dataGridViewStatReferee.Rows[i].Cells[9].Value = list[i].cntfoulsb.ToString(); dataGridViewStatReferee.Rows[i].Cells[10].Value = list[i].filename; dataGridViewStatReferee.Rows[i].Cells[11].Value = list[i].idreferee; if (flawour.idgame == list[i].idgame && flawour.idreferee == list[i].idreferee && flawour.idteam == list[i].idteam) { gpos = i; } } dataGridViewStatReferee.AllowUserToAddRows = false; } else { dataGridViewStatReferee.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
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 DlgReferee(SqlConnection cn, ushort md) { InitializeComponent(); connect = cn; mode = md; clReferee = new CReferee(connect); clParam = new CParamApp(); gid = clReferee.GetFreeId(); caption = "Ќовый судь¤"; }
public DlgReferee(SqlConnection cn, ushort md, STReferee st) { InitializeComponent(); connect = cn; mode = md; gstReferee = st; gid = gstReferee.idref; clReferee = new CReferee(connect); clParam = new CParamApp(); caption = "–едактировать данные судьи"; }
private int get_referee(string text) { int ret = 0; try { char[] del = { ' ' }; string[] words = text.Split(del); string famili = words[0]; string name = words[1]; CReferee cl = new CReferee(connect, famili, name); ret = cl.stRef.idref; } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } return(ret); }
private void init_list() { CPlayer clPlayer; CCoach clCoach; CTeam clTeam; CGame clGame; STGame game; string text = null; string name1, name2; try { list = clTF.GetListData(IS.idseason); dataGridViewTehFouls.Rows.Clear(); if (list.Count > 0) { g_f = true; dataGridViewTehFouls.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { dataGridViewTehFouls.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); } dataGridViewTehFouls.Rows[i].Cells[1].Value = text; clTeam = new CTeam(connect, list[i].idteam); dataGridViewTehFouls.Rows[i].Cells[2].Value = clTeam.stTeam.name; clGame = new CGame(connect); game = clGame.GetGame(list[i].idseason, list[i].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} - {2} ", game.idgame, name1, name2); dataGridViewTehFouls.Rows[i].Cells[3].Value = text; dataGridViewTehFouls.Rows[i].Cells[4].Value = list[i].date.ToLongDateString(); dataGridViewTehFouls.Rows[i].Cells[5].Value = list[i].descript; if (list[i].idreferee > 0) { CReferee clRef = new CReferee(connect, list[i].idreferee); text = string.Format("{0} {1}", clRef.stRef.family, clRef.stRef.name); dataGridViewTehFouls.Rows[i].Cells[6].Value = text; } if (flawour.Equals(list[i])) { gpos = i; } } dataGridViewTehFouls.AllowUserToAddRows = false; } else { dataGridViewTehFouls.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void PrepareEditGame(STGame data) { string text; try { /* номер игры */ textBoxNum.Text = data.idgame.ToString(); /* дата\врем¤ игры */ if (data.datetime != null) { dateTimePickerDate.Value = new DateTime(data.datetime.Value.Year, data.datetime.Value.Month, data.datetime.Value.Day, 0, 0, 0, 0); dateTimePickerTime.Value = new DateTime(data.datetime.Value.Year, data.datetime.Value.Month, data.datetime.Value.Day, data.datetime.Value.Hour, data.datetime.Value.Minute, 0, 0); } /* дивизион */ if (data.iddivision != null) { clDivision = new CDivision(connect, IS.idseason, (int)data.iddivision); comboBoxDivision.Text = clDivision.stDiv.name; } /* стади¤ */ if (data.idstage != null) { clScheme = new CScheme(connect, IS.idseason, (int)data.iddivision, (int)data.idstage); comboBoxStage.Text = clScheme.stScheme.namestage; } /* группа */ if (data.idgroup != null) { clGroup = new CGroup(connect, IS.idseason, (int)data.iddivision, (int)data.idgroup); comboBoxGroup.Text = clGroup.stGroup.namegroup; } /* номер тура */ if (data.round != null) { comboBoxRound.Text = data.round.ToString(); } /* площадка */ if (data.idplace != null) { clPlace = new CPlace(connect, (int)data.idplace); comboBoxPlace.Text = clPlace.stPlace.name; } /* команда 1 */ if (data.idteam1 != null) { clTeam = new CTeam(connect, (int)data.idteam1); comboBoxTeam1.Text = clTeam.stTeam.name; } /* команда 2 */ if (data.idteam2 != null) { clTeam = new CTeam(connect, (int)data.idteam2); comboBoxTeam2.Text = clTeam.stTeam.name; } /* данный команд */ if (data.aper1 != null) { textBoxAPer1.Text = data.aper1.ToString(); } if (data.aper2 != null) { textBoxAPer2.Text = data.aper2.ToString(); } if (data.adopper != null) { textBoxADopPer.Text = data.adopper.ToString(); } if (data.ateamfouls1 != null) { textBoxAF1.Text = data.ateamfouls1.ToString(); } if (data.ateamfouls2 != null) { textBoxAF2.Text = data.ateamfouls2.ToString(); } if (data.ateamfouls3 != null) { textBoxAF3.Text = data.ateamfouls3.ToString(); } if (data.ateamfouls4 != null) { textBoxAF4.Text = data.ateamfouls4.ToString(); } if (data.bper1 != null) { textBoxBPer1.Text = data.bper1.ToString(); } if (data.bper2 != null) { textBoxBPer2.Text = data.bper2.ToString(); } if (data.bdopper != null) { textBoxBDopPer.Text = data.bdopper.ToString(); } if (data.bteamfouls1 != null) { textBoxBF1.Text = data.bteamfouls1.ToString(); } if (data.bteamfouls2 != null) { textBoxBF2.Text = data.bteamfouls2.ToString(); } if (data.bteamfouls3 != null) { textBoxBF3.Text = data.bteamfouls3.ToString(); } if (data.bteamfouls4 != null) { textBoxBF4.Text = data.bteamfouls4.ToString(); } if (data.apointsper1 != null) { textBoxAPoints1.Text = data.apointsper1.ToString(); } if (data.apointsper2 != null) { textBoxAPoints2.Text = data.apointsper2.ToString(); } if (data.apointsper3 != null) { textBoxAPoints3.Text = data.apointsper3.ToString(); } if (data.apointsper4 != null) { textBoxAPoints4.Text = data.apointsper4.ToString(); } if (data.apointsdopper != null) { textBoxADopPoints.Text = data.apointsdopper.ToString(); } if (data.apoints != null) { textBoxAPoints.Text = data.apoints.ToString(); } if (data.bpointsper1 != null) { textBoxBPoints1.Text = data.bpointsper1.ToString(); } if (data.bpointsper2 != null) { textBoxBPoints2.Text = data.bpointsper2.ToString(); } if (data.bpointsper3 != null) { textBoxBPoints3.Text = data.bpointsper3.ToString(); } if (data.bpointsper4 != null) { textBoxBPoints4.Text = data.bpointsper4.ToString(); } if (data.bpointsdopper != null) { textBoxBDopPoints.Text = data.bpointsdopper.ToString(); } if (data.bpoints != null) { textBoxBPoints.Text = data.bpoints.ToString(); } /* флаг технического результата */ if (data.flagteh != null) { if (data.flagteh == 1) { checkBoxTeh.Checked = true; } } /* команда - победитель */ if (data.idteamwins != null) { clTeam = new CTeam(connect, (int)data.idteamwins); labelTeamWins.Text = clTeam.stTeam.name; } /* судьи */ if (data.idstreferee != null) { clReferee = new CReferee(connect, (int)data.idstreferee); text = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name); comboBoxStReferee.Text = text; } if (data.idreferee1 != null) { clReferee = new CReferee(connect, (int)data.idreferee1); text = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name); comboBoxReferee1.Text = text; } if (data.idreferee2 != null) { clReferee = new CReferee(connect, (int)data.idreferee2); text = string.Format("{0} {1}", clReferee.stRef.family, clReferee.stRef.name); comboBoxReferee2.Text = text; } /* оценки судь¤м */ if (data.srrefereepoints != null) { textBoxPointsStrefree.Text = data.srrefereepoints.ToString(); } if (data.referee1points != null) { textBoxPointsReferee1.Text = data.referee1points.ToString(); } if (data.referee2points != null) { textBoxPointsReferee2.Text = data.referee2points.ToString(); } /* секретарь */ if (data.idwriting != null) { clParticipant = new CParticipant(connect, (int)data.idwriting); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxSecretar.Text = text; } /* секретарь */ if (data.idoperpanel != null) { clParticipant = new CParticipant(connect, (int)data.idoperpanel); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxOperPanel.Text = text; } /* видеооператор */ if (data.idopervideo != null) { clParticipant = new CParticipant(connect, (int)data.idopervideo); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxOperVideo.Text = text; } /* врач */ if (data.idmedical != null) { clParticipant = new CParticipant(connect, (int)data.idmedical); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxMedic.Text = text; } /* диктор */ if (data.iddiktor != null) { clParticipant = new CParticipant(connect, (int)data.iddiktor); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxDiktor.Text = text; } /* подсчЄт статистики */ if (data.idstatister != null) { clParticipant = new CParticipant(connect, (int)data.idstatister); text = string.Format("{0} {1}", clParticipant.stPart.family, clParticipant.stPart.name); comboBoxStatist.Text = text; } /* остальна¤ статистика */ if (data.cntlook != null) { textBoxCntLook.Text = data.cntlook.ToString(); } if (data.changelider != null) { textBoxChangeLider.Text = data.changelider.ToString(); } if (data.maxpointsteam1 != null) { textBoxMaxPointsA.Text = data.maxpointsteam1.ToString(); } if (data.maxpointsteam2 != null) { textBoxMaxPointsB.Text = data.maxpointsteam2.ToString(); } if (data.equalsresult != null) { textBoxEqualsResult.Text = data.equalsresult.ToString(); } if (data.maxdiff != null) { textBoxMaxDiff.Text = data.maxdiff.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }