//添加罚牌记录 private void addCardRecordToolStripMenuItem_Click(object sender, EventArgs e) { if (SystemParam.getMatch() != null) { SystemParam.setAddPlayerCardRecordForm(new addPlayerCardRecordcs()); SystemParam.getAddPlayerCardRecordsForm().ShowDialog(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } }
//罚牌总览 private void cardRecordToolStripMenuItem_Click(object sender, EventArgs e) { if (!this.checkChildFormExist("CardRecordManage")) { if (SystemParam.getMatch() != null) { SystemParam.setCardRecordManageForm(new CardRecordManage(SystemParam.getMainForm())); SystemParam.getCardRecordManageForm().Show(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } } }
//打开 private void toolStripButton_Open_Click(object sender, EventArgs e) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); }
//显示球赛状态 private void toolStripButton_showRecord_Click(object sender, EventArgs e) { if (!this.checkChildFormExist("AvaliableInfo")) { if (SystemParam.getMatch() != null) { SystemParam.setAvaliableInfoForm(new AvaliableInfo(SystemParam.getMainForm())); SystemParam.getAvaliableInfoForm().Show(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } } }
//打开事件 private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); }
//窗体加载 //窗体显示 private void MainForm_Shown(object sender, EventArgs e) { //设置窗体最大化 this.WindowState = FormWindowState.Maximized; //默认设置数据读取 DefaultSetDAO.getDefaultSet(); //显示打开球队 DefaultPage defaultPage = new DefaultPage(this); SystemParam.setDefaultPageForm(defaultPage); defaultPage.Show(); //ReportOfInfo report = new ReportOfInfo(this); // report.Show(); if(SystemParam.checkExistMatch()){ //如果系统存在赛事,显示打开赛事 OpenMatch form = new OpenMatch(); form.ShowDialog(); } else{ CreateMatch newMatch = new CreateMatch(); newMatch.Show(); } }
//添加比赛信息 private void createMatchGameToolStripMenuItem_Click(object sender, EventArgs e) { if (SystemParam.getMatch() != null) { //显示新建比赛信息的窗体 CreateNewGame form = new CreateNewGame(); form.ShowDialog(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } }
//双击文本框 private void textBox_playerName_MouseDoubleClick(object sender, MouseEventArgs e) { if (SystemParam.getMatch() != null) { SelectPlayerInfo form = new SelectPlayerInfo(); form.ShowDialog(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } }
//确定按钮 private void OK_Click(object sender, EventArgs e) { try { matchID = Convert.ToInt32(dataGridView_match.Rows[rowIndex].Cells["match_ID"].Value); match = ContentDAO.getMatchInfo(matchID); SystemParam.setMatchID(matchID); SystemParam.setMatch(match); SystemParam.setCurrentSelectedSeason(season); //测试 SystemParam.setCurrentSelectedMatchName(match.getName()); SystemParam.getDefaultPageForm().UpdateTreeView(season.getmatchName(), 5); //刷新主窗体中显示的数据信息 if (!SystemParam.getMainForm().checkChildFormExist("AvaliableInfo")) { if (SystemParam.getMatch() != null) { SystemParam.setAvaliableInfoForm(new AvaliableInfo(SystemParam.getMainForm())); SystemParam.getAvaliableInfoForm().Show(); } else { if (MessageBox.Show("请先选择打开一个赛事", "打开赛事提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { OpenMatch openMatch = new OpenMatch(); openMatch.ShowDialog(); } } } else { SystemParam.getAvaliableInfoForm().flushDataInfo(SystemParam.getMatch()); try { SystemParam.getTeamManageForm().flushDataInfo(); } catch (Exception ex) { MessageBox.Show("当前赛事没有球队"); } } //关闭本窗体 this.Close(); } catch { MessageBox.Show("请选择相应的赛季!","提示"); } }