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(); }
private void dgvMatchConfig_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } Int32 iColumnIndex = e.ColumnIndex; Int32 iRowIndex = e.RowIndex; String strColumnName = dgvMatchConfig.Columns[iColumnIndex].Name; DataGridViewCell CurCell = dgvMatchConfig.Rows[iRowIndex].Cells[iColumnIndex]; Int32 iInputValue = 0; decimal fInputValue = 0; String strInputString = ""; //如果是combobox则保存CurCell的Tag if (CurCell.Value == null) { GVAR.g_EQDBManager.UpdateMatchConfigNull(MatchConfigID, strColumnName); } else { if (dgvMatchConfig.Columns[e.ColumnIndex].Name == "F_RiderInterval" || dgvMatchConfig.Columns[e.ColumnIndex].Name == "F_Judge" || dgvMatchConfig.Columns[e.ColumnIndex].Name == "F_Type") { strInputString = "'" + CurCell.Value.ToString() + "'"; GVAR.g_EQDBManager.UpdateMatchConfig(MatchConfigID, strColumnName, strInputString); } else if (dgvMatchConfig.Columns[e.ColumnIndex].Name == "F_Penalties") { try { fInputValue = Convert.ToDecimal(CurCell.Value); } catch (System.Exception ex) { fInputValue = 0; } GVAR.g_EQDBManager.UpdateMatchConfig(MatchConfigID, strColumnName, fInputValue); } else if (dgvMatchConfig.Columns[e.ColumnIndex].Name == "F_TimeAllowed" && m_iMatchConfigID == 7) { try { iInputValue = GVAR.Str2Int(GVAR.StrTime2Decimal(CurCell.Value).ToString()); GVAR.g_EQDBManager.UpdateMatchConfig(MatchConfigID, strColumnName, iInputValue); } catch (System.Exception ex) { GVAR.g_EQDBManager.UpdateMatchConfigNull(MatchConfigID, strColumnName); } } else { try { iInputValue = Convert.ToInt32(CurCell.Value); GVAR.g_EQDBManager.UpdateMatchConfig(MatchConfigID, strColumnName, iInputValue); } catch (System.Exception ex) { GVAR.g_EQDBManager.UpdateMatchConfigNull(MatchConfigID, strColumnName); } } } }