private void calcFinalTime() { if (MatchConfigID == 7) { m_fFinalTime = m_fCurrentTime - GVAR.StrTime2Decimal(txt_PauseTime.Text) + GVAR.StrTime2Decimal(txt_CorrectTime.Text); m_strFinalTime = GVAR.Float2StrTime(m_fFinalTime); txt_FinalTime.Text = m_strFinalTime; } else { m_fFinalTime = m_fCurrentTime - GVAR.Str2Decimal(txt_PauseTime.Text) + GVAR.Str2Decimal(txt_CorrectTime.Text); m_strFinalTime = m_fFinalTime.ToString(); txt_FinalTime.Text = m_strFinalTime; } }
public OVREQJPTimeForm(int m_iCurMatchConfigID, string strTime) { InitializeComponent(); m_strCurrentTime = strTime; txt_FinalTime.Text = strTime; MatchConfigID = m_iCurMatchConfigID; if (MatchConfigID == 7) { m_fFinalTime = GVAR.StrTime2Decimal(strTime); m_fCurrentTime = GVAR.StrTime2Decimal(strTime); } else { m_fFinalTime = GVAR.Str2Decimal(strTime); m_fCurrentTime = GVAR.Str2Decimal(strTime); } Localization(); }
public static Decimal StrTime2Decimal(Object strObj) { if (strObj == null) { return(0); } if (strObj.ToString().Length == 0) { return(0); } try { string[] sArray = strObj.ToString().Split(new string[] { "'" }, StringSplitOptions.RemoveEmptyEntries); return(GVAR.Str2Decimal(sArray[0]) * 60 + GVAR.Str2Decimal(sArray[1])); } catch (System.Exception errorFmt) { MessageBox.Show(errorFmt.ToString()); } return(0); }
//每个动作分打完后都需要发送一次分数给OVR,OVR需要计算当前的平均分 private void HandleXmlScore(int judgeNum, XmlDocument xmlScore) { // 获取比赛标示和比分列表 XmlNodeList xmlScoreList = null; xmlScoreList = xmlScore.SelectNodes("/Scores/Score"); //分数是否有效 bool bIsLegal = true; //是否确认提交 bool bIsValidated = false; //当前舞步 int iScore = 0; //直接入库,存入resultdetail foreach (XmlNode xmlScoreNode in xmlScoreList) { iScore++; string strScoreID = ((XmlElement)xmlScoreNode).GetAttribute("ScoreID"); string strScoreValue = ((XmlElement)xmlScoreNode).GetAttribute("ScoreValue"); //如果为"",表示没打分 decimal fScore = GVAR.Str2Decimal(strScoreValue); if (!strScoreID.Equals("F_TotalScore") && !strScoreID.Equals("F_Status")) { if (!strScoreID.Equals("F_0") && !IslegalSocre(strScoreValue)) { bIsLegal = false; } //将打过的分更新到数据库,调用存储过程更新resultdetail if (strScoreValue != "") { GVAR.g_EQDBManager.UpdateDetailScore(m_iCurMatchID, m_iCurRegisterID, judgeNum, strScoreID, fScore); } else { GVAR.g_EQDBManager.UpdateDetailScoreNull(m_iCurMatchID, m_iCurRegisterID, judgeNum, strScoreID); } } //如果扣分不为0 if (strScoreID.Equals("F_0")) { GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, 1); GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, 2); GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, 3); GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, 4); GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, 5); } //如果ipad发送了V按钮,同时分数都合法,则更新detail的状态为1 if (strScoreID.Equals("F_Status") && GVAR.Str2Int(strScoreValue) == 1 && bIsLegal) { GVAR.g_EQDBManager.UpdateDetailScore(m_iCurMatchID, m_iCurRegisterID, judgeNum, "F_Status", 1); bIsValidated = true; } } //计算和更新裁判点总分和百分比分 GVAR.g_EQDBManager.UpdateJudgePointsWhenDetailScoreChange(m_iCurMatchID, m_iCurRegisterID, judgeNum); //更新当前总 GVAR.g_EQDBManager.UpdateCurPointsWhenScoreChanged(m_iCurMatchID, m_iCurRegisterID, 1); //更新累计总 GVAR.g_EQDBManager.UpdateTotPointsWhenCurPointsChanged(m_iCurMatchID, m_iCurRegisterID); //触发dataentry刷新dgv //如果IPAD点击了确认,刷新主界面 if (bIsValidated) { m_EventIpadMark(this, new frmIPadMark2frmDataEntryEventArgs(frmIPadMark2frmDataEntryEventType.emUpdateDgvResult, null)); } m_EventIpadMark(this, new frmIPadMark2frmDataEntryEventArgs(frmIPadMark2frmDataEntryEventType.emUpdateDgvResultDetail, null)); //自动显示下一个动作 //MovementNextOperate(); }