예제 #1
0
        private void UpdateMemberPosition(int iTeamPos, ref DataGridView dgv, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            int              iColumnIndex  = e.ColumnIndex;
            int              iRowIndex     = e.RowIndex;
            String           strColumnName = dgv.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgv.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                int iPositionID = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iPositionID = GVAR.Str2Int(CurCell1.Tag);
                }
                else
                {
                    return;
                }
                int iMemberID = GVAR.Str2Int(dgv.Rows[iRowIndex].Cells["F_MemberID"].Value);
                GVAR.g_ManageDB.UpdateMatchMembePosition(m_iMatchID, iMemberID, iTeamPos, iPositionID);
            }
        }
예제 #2
0
        private void dgvFederation_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            int iColumnIndex = e.ColumnIndex;
            int iRowIndex    = e.RowIndex;

            if (iColumnIndex < 0 || iRowIndex < 0)
            {
                return;
            }

            m_arySelIndex.Clear();
            m_arySelIndex.Add(iRowIndex);
            int    iInputKey     = -1;
            String strColumnName = dgvFederation.Columns[iColumnIndex].Name;

            if (strColumnName.CompareTo("Active") == 0)
            {
                string strGroupID = dgvFederation.Rows[iRowIndex].Cells["ID"].Value.ToString();

                DGVCustomComboBoxCell CurCell = dgvFederation.Rows[iRowIndex].Cells[iColumnIndex] as DGVCustomComboBoxCell;
                iInputKey = Convert.ToInt32(CurCell.Tag);

                UpdateFedarationActive(strGroupID, m_iActiveDisciplineID, iInputKey);
            }
            //m_iCurSelIdex = iRowIndex;
            m_bFederationActived = true;
        }
예제 #3
0
        private void dgvMatchOfficial_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            int              iColumnIndex  = e.ColumnIndex;
            int              iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMatchOfficial.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchOfficial.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                int iFunctionID = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iFunctionID = GVAR.Str2Int(CurCell1.Tag);
                }
                else
                {
                    return;
                }

                int iRegisterID = GVAR.Str2Int(dgvMatchOfficial.Rows[iRowIndex].Cells["F_RegisterID"].Value);
                GVAR.g_ManageDB.UpdateOfficialFunction(m_iMatchID, iRegisterID, iFunctionID);
            }
            ResetMatchOfficial();
        }
예제 #4
0
        private void dgvMatchResult_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            m_bIsDataModify = true;
            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMatchResult.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchResult.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iPosition = GetFieldValue(dgvMatchResult, iRowIndex, "F_CompetitionPosition");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    try
                    {
                        iInputValue = Convert.ToInt32(CurCell.Value);
                    }
                    catch (System.Exception ex)
                    {
                        ResetMatchResult();
                        return;
                    }
                }

                if (strColumnName.CompareTo("MatchResult") == 0)
                {
                    BDCommon.g_ManageDB.UpdateMatchResult(m_iMatchID, m_iMatchSplitID, iPosition, iInputKey);
                }
                else if (strColumnName.CompareTo("IRM") == 0)
                {
                    BDCommon.g_ManageDB.UpdateMatchIRM(m_iMatchID, m_iMatchSplitID, iPosition, iInputKey);
                }
                else if (strColumnName.CompareTo("MatchPoint") == 0)
                {
                    BDCommon.g_ManageDB.UpdateMatchScore(m_iMatchID, m_iMatchSplitID, iPosition, iInputValue);
                }
                else if (strColumnName.CompareTo("GamePoint") == 0)
                {
                    BDCommon.g_ManageDB.UpdateGameScore(m_iMatchID, m_iMatchSplitID, iPosition, iInputValue);
                }

                ResetMatchResult();
                dgvMatchResult.Rows[iRowIndex].Selected = true;
            }
        }
예제 #5
0
        private void dgvTeamPlayers_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            // Get current edited cell
            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvTeamPlayers.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvTeamPlayers.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iMatchSplitID = GetFieldValue(dgvTeamPlayers, iRowIndex, "F_MatchSplitID");
                Int32 iPosA         = GetFieldValue(dgvTeamPlayers, iRowIndex, "F_HomePosition");
                Int32 iPosB         = GetFieldValue(dgvTeamPlayers, iRowIndex, "F_AwayPosition");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    iInputValue = Convert.ToInt32(CurCell.Value);
                }

                if (strColumnName.CompareTo("HomeName") == 0)
                {
                    BDCommon.g_ManageDB.UpdateTeamSplitMember(m_iMatchID, iMatchSplitID, iInputKey, iPosA);
                }
                else if (strColumnName.CompareTo("AwayName") == 0)
                {
                    BDCommon.g_ManageDB.UpdateTeamSplitMember(m_iMatchID, iMatchSplitID, iInputKey, iPosB);
                }
                else if (strColumnName.CompareTo("Type") == 0)
                {
                    BDCommon.g_ManageDB.SetMatchSplitType(m_iMatchID, iMatchSplitID, iInputKey);
                }
                else if (strColumnName.CompareTo("TechOrder") == 0)
                {
                    BDCommon.g_ManageDB.SetMatchSplitTechOrder(m_iMatchID, iMatchSplitID, CurCell.Value.ToString());
                }
                ResetTeamSplitPlayers();
                dgvTeamPlayers.Rows[iRowIndex].Selected = true;
            }
        }
예제 #6
0
        private void dgvMatchOfficial_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMatchOfficial.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchOfficial.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iRegisterID = GetFieldValue(dgvMatchOfficial, iRowIndex, "F_RegisterID");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    try
                    {
                        iInputValue = Convert.ToInt32(CurCell.Value);
                    }
                    catch (System.Exception ex)
                    {
                        ResetMatchOfficials();
                        return;
                    }
                }

                if (strColumnName.CompareTo("Function") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchOfficialFunction(m_iMatchID, m_iMatchSplitID, iRegisterID, iInputKey);
                }
                else if (strColumnName.CompareTo("Order") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchOfficialOrder(m_iMatchID, m_iMatchSplitID, iRegisterID, iInputValue);
                }

                ResetMatchOfficials();

                dgvMatchOfficial.Rows[iRowIndex].Selected = true;
            }
        }
예제 #7
0
        private void dgvMatchPlayers_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMatchPlayers.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchPlayers.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iRegisterID = GetFieldValue(dgvMatchPlayers, iRowIndex, "F_RegisterID");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    iInputValue = Convert.ToInt32(CurCell.Value);
                }

                if (strColumnName.CompareTo("Position") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerPosition(m_iMatchID, m_iPos, iRegisterID, iInputKey);
                }
                if (strColumnName.CompareTo("Function") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerFunction(m_iMatchID, m_iPos, iRegisterID, iInputKey);
                }
                if (strColumnName.CompareTo("StartUp") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerStartUp(m_iMatchID, m_iPos, iRegisterID, iInputKey);
                }
                if (strColumnName.CompareTo("Regu") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerRegu(m_iMatchID, m_iPos, iRegisterID, iInputKey);
                }

                ResetMatchPlayers();
                dgvMatchPlayers.Rows[iRowIndex].Selected = true;
            }
        }
예제 #8
0
        private void dgvHoopResult_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvHoopResult.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvHoopResult.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iRegisterID = GetFieldValue(dgvHoopResult, iRowIndex, "F_RegisterID");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    try
                    {
                        iInputValue = Convert.ToInt32(CurCell.Value);
                        if (iInputValue >= 1 && iInputValue <= 3)
                        {
                            iInputValue *= 10;
                        }
                    }
                    catch (System.Exception ex)
                    {
                        FillMatchResultGridView();
                        return;
                    }
                }

                SECommon.g_ManageDB.UpdateHoopMatchResult(m_nCurMatchID, strColumnName, iRegisterID, iInputValue);
                FillMatchResultGridView();
                dgvHoopResult.Rows[iRowIndex].Selected = true;

                SECommon.g_SEPlugin.DataChangedNotify(OVRDataChangedType.emMatchResult, -1, -1, -1, m_nCurMatchID, m_nCurMatchID, null);
            }
        }
예제 #9
0
        private void dgvMatchOfficial_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMatchOfficial.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchOfficial.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iRegisterID = GetFieldValue(dgvMatchOfficial, iRowIndex, "F_RegisterID");

                Int32 iInputValue = 0;
                Int32 iInputKey   = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    iInputValue = Convert.ToInt32(CurCell.Value);
                }

                if (strColumnName.CompareTo("Function") == 0)
                {
                    if (!m_bIsTeam)
                    {
                        BDCommon.g_ManageDB.UpdateMatchOfficialFunction(m_iMatchID, -1, iRegisterID, iInputKey);
                    }
                    else
                    {
                        if (cmbMatches.SelectedIndex >= 0)
                        {
                            BDCommon.g_ManageDB.UpdateMatchOfficialFunction(m_iMatchID, (int)m_teamSplitIDs[cmbMatches.SelectedIndex], iRegisterID, iInputKey);
                        }
                    }
                }

                dgvMatchOfficial.Rows[iRowIndex].Selected = true;
            }
        }
예제 #10
0
        private void dgvVisitPenalty_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            int iRowIdx = e.RowIndex;
            int iColIdx = e.ColumnIndex;

            if (iRowIdx >= dgvVisitPenalty.RowCount || iRowIdx < 0 || iColIdx < 0)
            {
                return;
            }

            m_CurAction.Init();
            m_CurAction.AcitonID = GVAR.Str2Int(dgvVisitPenalty.Rows[iRowIdx].Cells["F_ActionID"].Value.ToString());
            if (dgvVisitPenalty.Columns[iColIdx].Name.CompareTo("ResultDes") == 0)
            {
                DataGridViewCell CurCell = dgvVisitPenalty.Rows[iRowIdx].Cells[iColIdx];
                if (CurCell != null)
                {
                    int iResultID = 0;
                    if (CurCell is DGVCustomComboBoxCell)
                    {
                        DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                        iResultID = GVAR.Str2Int(CurCell1.Tag);
                    }
                    else
                    {
                        return;
                    }

                    if (m_CurAction.AcitonID < 0)
                    {
                        AddPenaltyAction(ref dgvVisitPenalty, 2, iRowIdx, iColIdx, iResultID);
                    }
                    else
                    {
                        GVAR.g_ManageDB.GetMatchAction(m_MatchID, m_CurAction.AcitonID, ref m_CurAction);
                        EditPenaltyAction(ref dgvVisitPenalty, 2, iRowIdx, iColIdx, iResultID);
                    }
                    ResetVisitPenaltyDataGridView();
                }
            }
        }
예제 #11
0
 private void frmMatchResultEntry_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBoxEx.Show("If the result is valid and you accept it, press yes button,the result will not be recalculated when the match status become official.If you press no button,the result will be recalculated when match status become official! ", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
     {
         Int32            iInputKey1 = 0;
         Int32            iInputKey2 = 0;
         DataGridViewCell CurCell1   = dgvMatchResult.Rows[0].Cells[1];
         DataGridViewCell CurCell2   = dgvMatchResult.Rows[1].Cells[1];
         if (CurCell1 != null)
         {
             if (CurCell1 is DGVCustomComboBoxCell)
             {
                 DGVCustomComboBoxCell CurCell1tmp = CurCell1 as DGVCustomComboBoxCell;
                 iInputKey1 = Convert.ToInt32(CurCell1tmp.Tag);
             }
         }
         if (CurCell2 != null)
         {
             if (CurCell2 is DGVCustomComboBoxCell)
             {
                 DGVCustomComboBoxCell CurCell2tmp = CurCell2 as DGVCustomComboBoxCell;
                 iInputKey2 = Convert.ToInt32(CurCell2tmp.Tag);
             }
         }
         if ((iInputKey1 == 1 && iInputKey2 == 2) || (iInputKey1 == 2 && iInputKey2 == 1) || (iInputKey1 == 3 && iInputKey2 == 3))
         {
             this.DialogResult = DialogResult.Yes;
             return;
         }
         else
         {
             this.DialogResult = DialogResult.No;
             return;
         }
     }
     else
     {
         this.DialogResult = DialogResult.No;
         return;
     }
 }
예제 #12
0
        private void dgvPosition_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            DataGridView dgv = sender as DataGridView;
            // Get current edited cell
            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            String           strColumnName = dgv.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgv.Rows[iRowIndex].Cells[iColumnIndex];
            DataGridViewCell regCell       = dgv.Rows[iRowIndex].Cells[0];

            if (CurCell is DGVCustomComboBoxCell)
            {
                DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                int posID = Convert.ToInt32(CurCell1.Tag);
                int regID = Convert.ToInt32(regCell.Value);
                BDCommon.g_ManageDB.UpdateMatchPosition(m_iMatchID, regID, posID);
            }
        }
예제 #13
0
        private void UpdateMemberDSQ(int iTeamPos, ref DataGridView dgv, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            int iColumnIndex         = e.ColumnIndex;
            int iRowIndex            = e.RowIndex;
            DataGridViewCell CurCell = dgv.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                int iIRMID = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iIRMID = GVAR.Str2Int(CurCell1.Tag);
                }
                else
                {
                    return;
                }

                int iMemberID   = GVAR.Str2Int(dgv.Rows[iRowIndex].Cells["F_MemberID"].Value);
                int iRegisterID = 0;
                if (iTeamPos == 1)
                {
                    iRegisterID = m_iHomeRegisterID;
                }
                else if (iTeamPos == 2)
                {
                    iRegisterID = m_iVisitRegisterID;
                }
                GVAR.g_ManageDB.UpdateMemberDSQ(iRegisterID, iMemberID, iIRMID);
            }
        }
예제 #14
0
        private void dgvTeamB_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
                return;

            Int32 iColumnIndex = e.ColumnIndex;
            Int32 iRowIndex = e.RowIndex;
            String strColumnName = dgvTeamB.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell = dgvTeamB.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32 iRegisterID = GetFieldValue(dgvTeamB, iRowIndex, "F_RegisterID");

                String strInputValue = "";
                Int32 iInputKey = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }

                strInputValue = Convert.ToString(CurCell.Value);

                if (strColumnName.CompareTo("PlayPos") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerPlayPosition(m_nCurMatchID, m_nCurMatchType, m_nCurTeamSplitID, 2, iRegisterID, strInputValue);
                }
                else if (strColumnName.CompareTo("Active") == 0)
                {
                    SECommon.g_ManageDB.UpdateMatchPlayerActive(m_nCurMatchID, m_nCurMatchType, m_nCurTeamSplitID, 2, iRegisterID, iInputKey);
                }

                SECommon.g_SEPlugin.DataChangedNotify(OVRDataChangedType.emSplitCompetitor, -1, -1, -1, m_nCurMatchID, m_nCurMatchID, null);
                GetMatchPlayerList();
            }
        }
예제 #15
0
        private void dgvEventRecords_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            int nRow = e.RowIndex;
            int nCol = e.ColumnIndex;

            if (nRow < 0 && nCol < 0)
            {
                return;
            }

            if (dgvEventRecords.Columns[nCol].Name == "F_Active")
            {
                return;
            }

            DataGridViewRow row        = dgvEventRecords.Rows[nRow];
            String          strColName = dgvEventRecords.Columns[nCol].Name;

            String strColValue = Obj2Str(row.Cells[nCol].Value);
            String strEventID  = Obj2Str(row.Cells["F_EventID"].Value);
            String strReocrdID = Obj2Str(row.Cells["F_RecordID"].Value);


            int nEventID  = Str2Int(strEventID);
            int nRecordID = Str2Int(strReocrdID);

            if (strColName == "F_RecordType")
            {
                strColName = "F_RecordTypeID";

                DGVCustomComboBoxCell CurCell1 = dgvEventRecords.Rows[nRow].Cells[nCol] as DGVCustomComboBoxCell;
                strColValue = Convert.ToString(CurCell1.Tag);
            }

            ModifyEventRecord(nEventID, nRecordID, m_RecordModule.DatabaseConnection, strColName, strColValue);
        }
예제 #16
0
        private void dgvMatchOfficial_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            int iColumnIndex = e.ColumnIndex;
            int iRowIndex    = e.RowIndex;
            //String strColumnName = dgvMatchOfficial.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell = dgvMatchOfficial.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                if (CurCell is DGVCustomComboBoxCell)
                {
                    int iRegisterID = Str2Int(dgvMatchOfficial.Rows[iRowIndex].Cells["F_RegisterID"].Value);
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    switch (dgvMatchOfficial.Columns[iColumnIndex].Name)
                    {
                    case "Function":
                        int iFunctionID = 0;
                        iFunctionID = Str2Int(CurCell.Tag);
                        UpdateOfficialFunction(m_iMatchID, iRegisterID, iFunctionID);
                        break;

                    case "Position":
                        int iPositionID = 0;
                        iPositionID = Str2Int(CurCell.Tag);
                        UpdateOfficialPosition(m_iMatchID, iRegisterID, iPositionID);
                        break;
                    }
                }
            }
            ResetMatchOfficial();
        }
예제 #17
0
        private void dgv_Session_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (dgv_Session.Columns[e.ColumnIndex].Name.CompareTo("Number") == 0)
            {
                string strOldData = m_dtOldSession.Rows[0]["Number"].ToString();
                string strNewData = "";
                if (dgv_Session.Rows[e.RowIndex].Cells["Number"].Value != null)
                {
                    strNewData = dgv_Session.Rows[e.RowIndex].Cells["Number"].Value.ToString();

                    bool bIsInt = true;
                    for (int i = 0; i < strNewData.Length; i++)
                    {
                        if (!Char.IsNumber(strNewData, i))
                        {
                            bIsInt = false;
                        }
                    }
                    if (!bIsInt)
                    {
                        dgv_Session.Rows[e.RowIndex].Cells["Number"].Value = strOldData;
                        return;
                    }
                }
                if (strNewData == strOldData)
                {
                    return;
                }
                if (strNewData.Length == 0)
                {
                    m_dtOldSession.Rows[0]["Number"] = DBNull.Value;
                }
                else
                {
                    m_dtOldSession.Rows[0]["Number"] = strNewData;
                }
            }
            else if (dgv_Session.Columns[e.ColumnIndex].Name.CompareTo("StartTime") == 0)
            {
                string strOldData = m_dtOldSession.Rows[0]["StartTime"].ToString();
                string strNewData = "";
                if (dgv_Session.Rows[e.RowIndex].Cells["StartTime"].Value != null)
                {
                    strNewData = dgv_Session.Rows[e.RowIndex].Cells["StartTime"].Value.ToString();
                    try
                    {
                        DateTime dtTemp = Convert.ToDateTime(strNewData);
                    }
                    catch
                    {
                        dgv_Session.Rows[e.RowIndex].Cells["StartTime"].Value = strOldData;
                        return;
                    }
                }
                if (strNewData == strOldData)
                {
                    return;
                }
                if (strNewData.Length == 0)
                {
                    m_dtOldSession.Rows[0]["StartTime"] = DBNull.Value;
                }
                else
                {
                    m_dtOldSession.Rows[0]["StartTime"] = strNewData;
                }
            }
            else if (dgv_Session.Columns[e.ColumnIndex].Name.CompareTo("EndTime") == 0)
            {
                string strOldData = m_dtOldSession.Rows[0]["EndTime"].ToString();
                string strNewData = "";
                if (dgv_Session.Rows[e.RowIndex].Cells["EndTime"].Value != null)
                {
                    strNewData = dgv_Session.Rows[e.RowIndex].Cells["EndTime"].Value.ToString();
                    try
                    {
                        DateTime dtTemp = Convert.ToDateTime(strNewData);
                    }
                    catch
                    {
                        dgv_Session.Rows[e.RowIndex].Cells["EndTime"].Value = strOldData;
                        return;
                    }
                }
                if (strNewData == strOldData)
                {
                    return;
                }
                if (strNewData.Length == 0)
                {
                    m_dtOldSession.Rows[0]["EndTime"] = DBNull.Value;
                }
                else
                {
                    m_dtOldSession.Rows[0]["EndTime"] = strNewData;
                }
            }
            else if (dgv_Session.Columns[e.ColumnIndex].Name.CompareTo("Type") == 0)
            {
                string strOldData             = m_dtOldSession.Rows[0]["F_SessionTypeID"].ToString();
                DGVCustomComboBoxCell boxCell = dgv_Session.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                m_dtOldSession.Rows[0]["Type"] = boxCell.Value;
                if (strNewData.Length != 0)
                {
                    m_dtOldSession.Rows[0]["F_SessionTypeID"] = strNewData;
                    dgv_Session.Rows[e.RowIndex].Cells["F_SessionTypeID"].Value = strNewData;
                }
                else
                {
                    m_dtOldSession.Rows[0]["F_SessionTypeID"] = DBNull.Value;
                    dgv_Session.Rows[e.RowIndex].Cells["F_SessionTypeID"].Value = DBNull.Value;
                }
            }
            else
            {
                return;
            }

            string strSessionID = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["F_SessionID"].Value != null)
            {
                strSessionID = dgv_Session.Rows[e.RowIndex].Cells["F_SessionID"].Value.ToString();
            }
            string strSessionDate = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["Date"].Value != null)
            {
                strSessionDate = dgv_Session.Rows[e.RowIndex].Cells["Date"].Value.ToString();
            }
            string strSessionNumber = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["Number"].Value != null)
            {
                strSessionNumber = dgv_Session.Rows[e.RowIndex].Cells["Number"].Value.ToString();
            }
            string strSessionTypeID = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["F_SessionTypeID"].Value != null)
            {
                strSessionTypeID = dgv_Session.Rows[e.RowIndex].Cells["F_SessionTypeID"].Value.ToString();
            }
            string strSessionStartTime = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["StartTime"].Value != null)
            {
                strSessionStartTime = dgv_Session.Rows[e.RowIndex].Cells["StartTime"].Value.ToString();
            }
            string strSessionEndTime = "";

            if (dgv_Session.Rows[e.RowIndex].Cells["EndTime"].Value != null)
            {
                strSessionEndTime = dgv_Session.Rows[e.RowIndex].Cells["EndTime"].Value.ToString();
            }

            this.UpdateSession(strSessionID, strSessionDate, strSessionNumber, strSessionTypeID, strSessionStartTime, strSessionEndTime);
        }
예제 #18
0
        private void dgvMember_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            int              iColumnIndex  = e.ColumnIndex;
            int              iRowIndex     = e.RowIndex;
            String           strColumnName = dgvMember.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMember.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                string strInputVaule = "";
                int    iInputKey     = 0;
                if (CurCell is DGVCustomComboBoxCell)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                }
                else
                {
                    if (CurCell.Value != null)
                    {
                        strInputVaule = Convert.ToString(CurCell.Value);
                    }
                }

                int iRegisterID = Convert.ToInt32(m_strRegisterID);
                int iMemberID   = Convert.ToInt32(dgvMember.Rows[iRowIndex].Cells["RegisterID"].Value);

                bool bResult = true;
                if (strColumnName.CompareTo("Function") == 0)
                {
                    bResult = UpdateMemberFunction(iRegisterID, iMemberID, iInputKey);
                }
                else if (strColumnName.CompareTo("Position") == 0)
                {
                    bResult = UpdateMemberPosition(iRegisterID, iMemberID, iInputKey);
                }
                else if (strColumnName.CompareTo("Order") == 0)
                {
                    bResult = UpdateMemberOrder(iRegisterID, iMemberID, strInputVaule);
                }
                else if (strColumnName.CompareTo("ShirtNumber") == 0)
                {
                    bResult = UpdateMemberShirtNum(iRegisterID, iMemberID, strInputVaule);
                }
                else if (strColumnName.CompareTo("Comment") == 0)
                {
                    bResult = UpdateMemberComment(iRegisterID, iMemberID, strInputVaule);
                }

                if (!bResult)
                {
                    int iSelIndex = e.RowIndex;
                    ResetMemberGrid();

                    if (dgvMember.Rows.Count > 0)
                    {
                        dgvMember.ClearSelection();
                        if (iSelIndex < 0 || iSelIndex > dgvMember.Rows.Count)
                        {
                            iSelIndex = 0;
                        }
                        dgvMember.Rows[iSelIndex].Selected        = true;
                        dgvMember.FirstDisplayedScrollingRowIndex = iSelIndex;
                    }
                }
            }
        }
예제 #19
0
        private void dgv_Scheduled_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Date") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["Date"].ToString();

                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["Date"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["Date"].Value.ToString();
                    try
                    {
                        DateTime dtTemp = Convert.ToDateTime(strNewData);
                    }
                    catch
                    {
                        dgv_Scheduled.Rows[e.RowIndex].Cells["Date"].Value = strOldData;
                        return;
                    }
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strOldSessionID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_SessionID"].Value.ToString();

                dgv_Scheduled.Rows[e.RowIndex].Cells["Session"].Value     = DBNull.Value;
                dgv_Scheduled.Rows[e.RowIndex].Cells["F_SessionID"].Value = DBNull.Value;

                string strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchDate(strMatchID, strNewData);
                this.UpdateMatchSession(strMatchID, "");

                int iMatchID      = Convert.ToInt32(strMatchID);
                int iOldSessionID = -1;
                if (strOldSessionID.Length != 0)
                {
                    iOldSessionID = Convert.ToInt32(strOldSessionID);
                }

                List <OVRDataChanged> changedList = new List <OVRDataChanged>();
                changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchDate, -1, -1, -1, iMatchID, iMatchID, null));
                if (strOldSessionID.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchSessionReset, -1, -1, -1, iMatchID, iOldSessionID, null));
                }

                m_matchScheduleModule.DataChangedNotify(changedList);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Session") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["F_SessionID"].ToString();

                DGVCustomComboBoxCell boxCell = dgv_Scheduled.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                if (strNewData.Length == 0)
                {
                    dgv_Scheduled.Rows[e.RowIndex].Cells["F_SessionID"].Value = DBNull.Value;
                }
                else
                {
                    dgv_Scheduled.Rows[e.RowIndex].Cells["F_SessionID"].Value = strNewData;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchSession(strMatchID, strNewData);

                int iMatchID      = Convert.ToInt32(strMatchID);
                int iOldSessionID = -1;
                if (strOldData.Length != 0)
                {
                    iOldSessionID = Convert.ToInt32(strOldData);
                }
                int iNewSessionID = -1;
                if (strNewData.Length != 0)
                {
                    iNewSessionID = Convert.ToInt32(strNewData);
                }

                List <OVRDataChanged> changedList = new List <OVRDataChanged>();
                if (strOldData.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchSessionReset, -1, -1, -1, iMatchID, iOldSessionID, null));
                }
                if (strNewData.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchSessionSet, -1, -1, -1, iMatchID, iNewSessionID, null));
                }

                m_matchScheduleModule.DataChangedNotify(changedList);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("R.Num") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["R.Num"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["R.Num"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["R.Num"].Value.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateRaceNumber(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchInfo, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("M.Code") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["M.Code"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["M.Code"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["M.Code"].Value.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchCode(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchInfo, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("StartTime") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["StartTime"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["StartTime"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["StartTime"].Value.ToString();
                    try
                    {
                        DateTime dtTemp = Convert.ToDateTime(strNewData);
                    }
                    catch
                    {
                        dgv_Scheduled.Rows[e.RowIndex].Cells["StartTime"].Value = strOldData;
                        return;
                    }
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchStartTime(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchDate, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("EndTime") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["EndTime"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["EndTime"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["EndTime"].Value.ToString();
                    try
                    {
                        DateTime dtTemp = Convert.ToDateTime(strNewData);
                    }
                    catch
                    {
                        dgv_Scheduled.Rows[e.RowIndex].Cells["EndTime"].Value = strOldData;
                        return;
                    }
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchEndTime(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchDate, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Round") == 0)
            {
                string strOldData             = m_dtOldScheduled.Rows[0]["F_RoundID"].ToString();
                DGVCustomComboBoxCell boxCell = dgv_Scheduled.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                if (strNewData.Length == 0)
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_RoundID"].Value = DBNull.Value;
                }
                else
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_RoundID"].Value = strNewData;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchRound(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchInfo, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Status") == 0)
            {
                string strOldData             = m_dtOldScheduled.Rows[0]["F_MatchStatusID"].ToString();
                DGVCustomComboBoxCell boxCell = dgv_Scheduled.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                if (strNewData.Length == 0)
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchStatusID"].Value = DBNull.Value;
                }
                else
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchStatusID"].Value = strNewData;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                if (!this.UpdateMatchStatus(strMatchID, strNewData))
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["Status"].Value = m_dtOldScheduled.Rows[0]["Status"].ToString();
                    if (strOldData.Length == 0)
                    {
                        this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchStatusID"].Value = DBNull.Value;
                    }
                    else
                    {
                        this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchStatusID"].Value = strOldData;
                    }
                }

                //int iMatchID = Convert.ToInt32(strMatchID);
                //m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchStatus, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Venue") == 0)
            {
                string strOldData             = m_dtOldScheduled.Rows[0]["F_VenueID"].ToString();
                DGVCustomComboBoxCell boxCell = dgv_Scheduled.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                if (strNewData.Length == 0)
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_VenueID"].Value = DBNull.Value;
                }
                else
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_VenueID"].Value = strNewData;
                }

                string strOldCourtID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_CourtID"].Value.ToString();
                dgv_Scheduled.Rows[e.RowIndex].Cells["Court"].Value     = DBNull.Value;
                dgv_Scheduled.Rows[e.RowIndex].Cells["F_CourtID"].Value = DBNull.Value;

                string strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchVenue(strMatchID, strNewData);
                this.UpdateMatchCourt(strMatchID, "");

                int iMatchID    = Convert.ToInt32(strMatchID);
                int iOldCourtID = -1;
                if (strOldCourtID.Length != 0)
                {
                    iOldCourtID = Convert.ToInt32(strOldCourtID);
                }

                List <OVRDataChanged> changedList = new List <OVRDataChanged>();
                changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchInfo, -1, -1, -1, iMatchID, iMatchID, null));
                if (strOldCourtID.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchCourtReset, -1, -1, -1, iMatchID, iOldCourtID, null));
                }

                m_matchScheduleModule.DataChangedNotify(changedList);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("Court") == 0)
            {
                string strOldData             = m_dtOldScheduled.Rows[0]["F_CourtID"].ToString();
                DGVCustomComboBoxCell boxCell = dgv_Scheduled.Rows[e.RowIndex].Cells[e.ColumnIndex] as DGVCustomComboBoxCell;
                Int32 iKey = 0;
                iKey = Convert.ToInt32(boxCell.Tag);

                string strNewData = "";
                if (iKey == -1)
                {
                    strNewData = "";
                }
                else if (iKey == 0)
                {
                    strNewData = strOldData;
                }
                else
                {
                    strNewData = iKey.ToString();
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                if (strNewData.Length == 0)
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_CourtID"].Value = DBNull.Value;
                }
                else
                {
                    this.dgv_Scheduled.Rows[e.RowIndex].Cells["F_CourtID"].Value = strNewData;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchCourt(strMatchID, strNewData);

                int iMatchID    = Convert.ToInt32(strMatchID);
                int iOldCourtID = -1;
                if (strOldData.Length != 0)
                {
                    iOldCourtID = Convert.ToInt32(strOldData);
                }
                int iNewCourtID = -1;
                if (strNewData.Length != 0)
                {
                    iNewCourtID = Convert.ToInt32(strNewData);
                }

                List <OVRDataChanged> changedList = new List <OVRDataChanged>();
                if (strOldData.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchCourtReset, -1, -1, -1, iMatchID, iOldCourtID, null));
                }
                if (strNewData.Length != 0)
                {
                    changedList.Add(new OVRDataChanged(OVRDataChangedType.emMatchCourtSet, -1, -1, -1, iMatchID, iNewCourtID, null));
                }

                m_matchScheduleModule.DataChangedNotify(changedList);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("O.I.S") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["O.I.S"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.S"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.S"].Value.ToString();

                    bool bIsInt = true;
                    for (int i = 0; i < strNewData.Length; i++)
                    {
                        if (!Char.IsNumber(strNewData, i))
                        {
                            bIsInt = false;
                        }
                    }
                    if (!bIsInt)
                    {
                        dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.S"].Value = strOldData;
                        return;
                    }
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchOrderInSession(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchOrderInSession, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
            else if (dgv_Scheduled.Columns[e.ColumnIndex].Name.CompareTo("O.I.R") == 0)
            {
                string strOldData = m_dtOldScheduled.Rows[0]["O.I.R"].ToString();
                string strNewData = "";
                if (dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.R"].Value != null)
                {
                    strNewData = dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.R"].Value.ToString();

                    bool bIsInt = true;
                    for (int i = 0; i < strNewData.Length; i++)
                    {
                        if (!Char.IsNumber(strNewData, i))
                        {
                            bIsInt = false;
                        }
                    }
                    if (!bIsInt)
                    {
                        dgv_Scheduled.Rows[e.RowIndex].Cells["O.I.R"].Value = strOldData;
                        return;
                    }
                }

                if (strNewData == strOldData)
                {
                    return;
                }

                string strMatchID = "";
                strMatchID = dgv_Scheduled.Rows[e.RowIndex].Cells["F_MatchID"].Value.ToString();

                this.UpdateMatchOrderInRound(strMatchID, strNewData);

                int iMatchID = Convert.ToInt32(strMatchID);
                m_matchScheduleModule.DataChangedNotify(OVRDataChangedType.emMatchInfo, -1, -1, -1, iMatchID, iMatchID, null);

                return;
            }
        }
예제 #20
0
        private void dgvMatchMF_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            Int32            iColumnIndex  = e.ColumnIndex;
            Int32            iRowIndex     = e.RowIndex;
            Int32            iMFCode       = Convert.ToInt32(dgvMatchMF.Rows[iRowIndex].Cells["F_MFCode"].Value.ToString());
            String           strColumnName = dgvMatchMF.Columns[iColumnIndex].Name;
            DataGridViewCell CurCell       = dgvMatchMF.Rows[iRowIndex].Cells[iColumnIndex];

            if (CurCell != null)
            {
                Int32  iInputValue    = 1;
                Int32  iInputKey      = 0;
                String strInputString = "";

                //基于列进行判断
                if (strColumnName.CompareTo("F_MovementType") == 0)
                {
                    strInputString = "'" + CurCell.Value.ToString() + "'";
                    GVAR.g_EQDBManager.UpdateMovementType(MatchConfigID, iMFCode, strInputString);
                }
                if (strColumnName.CompareTo("F_MFLongName") == 0)
                {
                    DGVCustomComboBoxCell CurCell1 = CurCell as DGVCustomComboBoxCell;
                    iInputKey = Convert.ToInt32(CurCell1.Tag);
                    GVAR.g_EQDBManager.UpdateMatchMFLongName(MatchConfigID, iMFCode, iInputKey);
                }
                if (strColumnName.CompareTo("F_SubFencesDes") == 0 || strColumnName.CompareTo("F_MFCodeDes") == 0)
                {
                    strInputString = "'" + CurCell.Value.ToString() + "'";
                    GVAR.g_EQDBManager.UpdateMatchMF(MatchConfigID, iMFCode, strColumnName, strInputString);
                }
                if (strColumnName.CompareTo("F_SubFences") == 0 || strColumnName.CompareTo("F_Coefficient") == 0)
                {
                    if (CurCell.Value != null)
                    {
                        strInputString = CurCell.Value.ToString();
                        try
                        {
                            iInputValue = Convert.ToInt32(CurCell.Value);
                        }
                        catch (System.Exception ex)
                        {
                            iInputValue = 1;
                            DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
                        }
                    }
                    else
                    {
                        iInputValue = 1;
                    }
                    GVAR.g_EQDBManager.UpdateMatchMF(MatchConfigID, iMFCode, strColumnName, iInputValue);
                }
                //如果舞步系数修改,则同时更新config中的MaxMovementScore
                if (m_strMatchRuleCode.Equals("DR") && strColumnName.CompareTo("F_Coefficient") == 0)
                {
                    GVAR.g_EQDBManager.UpdateMatchMaxMovementScore(MatchConfigID);
                }
            }
        }