public bool statInfoReferesh() { //此函数功能是刷新界面中所有技术统计类控件 //在切换比赛,切换Tab,有动作删除,添加时都会调用 //获取新数据,这个数据包含3个表 DataSet dataAction = Common.dbActionListGetList(Common.g_nMatchID, GetStatCurSet()); DataTable tblActionList = dataAction != null && dataAction.Tables.Count > 0 ? dataAction.Tables[0] : null; DataTable tblPositionA = dataAction != null && dataAction.Tables.Count > 1 ? dataAction.Tables[1] : null; DataTable tblPositionB = dataAction != null && dataAction.Tables.Count > 2 ? dataAction.Tables[2] : null; bool bRet = true; //主界面上的ActionList bRet &= dgvActionListRefresh(tblActionList); //技术统计界面的东东 if (_tabMain.SelectedTab == _tabHeaderTeamA) { bRet &= btnStatEntryPlayersOnCourtRefresh(tblPositionA); } else if (_tabMain.SelectedTab == _tabHeaderTeamB) { bRet &= btnStatEntryPlayersOnCourtRefresh(tblPositionB); } btnStatEntryCancel_Click(btnStatEntryCancel, new EventArgs()); //点击取消按钮,把STAT按钮状态恢复 return(bRet); }
//int _nScore = 0; //bool _bDirPlus = true; //轮询数据库刷新用的 private void timerDbRefresh_Tick(object sender, EventArgs e) { //避免在执行期间,时钟多重启动 m_timerDbRefresh.Enabled = false; // Auto add Score for test. /* * ////// * int nScore = Common.g_Game.GetScoreSet(false); * Debug.Assert(nScore == _nScore); * * if (_bDirPlus && nScore == 25) _bDirPlus = false; * if (!_bDirPlus && nScore == 0) _bDirPlus = true; * * if (_bDirPlus) * { * BtnScoreAddReduce_Click(btnScoreAddA, null); * _nScore++; * } * else * { * BtnScoreAddReduce_Click(btnScoreReduceA, null); * _nScore--; * } * * Debug.Assert(Common.g_Game.GetScoreSet(false) == _nScore); * //////// */ string timeDbModify = Common.dbMatchModifyTimeGet(); if (Common.m_TimeDbModify != timeDbModify) { Common.m_TimeDbModify = timeDbModify; UpdateMatchStatus(); bool bRunning = (btnx_Running.Checked || btnx_Revision.Checked); bool bStartlist = btnx_StartList.Checked; bool bStat = _tabMain.SelectedTab == _tabHeaderStatDouble || _tabMain.SelectedTab == _tabHeaderTeamA || _tabMain.SelectedTab == _tabHeaderTeamB; SetMatchOperateEnable(bRunning, bStartlist, bStat); scoreInfoRefresh(); timeoutSubtitutionRefresh(); propertyGridSetup.Refresh(); //做STAT的按钮们都没有点,全部刷新,如果点中过某些STAT,则只刷新列表 if (btnStatEntryTemErr.Enabled == true) { statInfoReferesh(); } else { DataSet dataAction = Common.dbActionListGetList(Common.g_nMatchID, GetStatCurSet()); DataTable tblActionList = dataAction != null && dataAction.Tables.Count > 0 ? dataAction.Tables[0] : null; dgvActionListRefresh(tblActionList); } } m_timerDbRefresh.Enabled = true; }