コード例 #1
0
        private void UpdateMemberStartup(int iTeampos, ref DataGridView dgv, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= dgv.RowCount || e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex != dgv.Columns["Startup"].Index)
            {
                return;
            }


            string strRegisterID = dgv.Rows[e.RowIndex].Cells["F_MemberID"].Value.ToString();

            if (GVAR.Str2Int(dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) == 1)
            {
                GVAR.g_ManageDB.UpdateMemberStartup(m_iMatchID, iTeampos, strRegisterID, false);
            }
            else
            {
                if ((iTeampos == 1 && m_iHomeStartup < 11) || (iTeampos == 2 && m_iVisitStartup < 11))
                {
                    GVAR.g_ManageDB.UpdateMemberStartup(m_iMatchID, iTeampos, strRegisterID, true);
                }
            }

            if (iTeampos == 1)
            {
                GVAR.g_ManageDB.ResetMemberGrid(m_iMatchID, m_iHomeRegisterID, 1, ref dgvMember_Home, ref m_iHomeStartup);
            }
            else if (iTeampos == 2)
            {
                GVAR.g_ManageDB.ResetMemberGrid(m_iMatchID, m_iVisitRegisterID, 2, ref dgvMember_Visit, ref m_iVisitStartup);
            }
        }
コード例 #2
0
        private void cmbPeriod_SelectedIndexChanged(object sender, EventArgs e)
        {
            int m_iPeriod = GVAR.Str2Int(cmbPeriod.SelectedValue);

            GVAR.g_ManageDB.UpdateMatchPeriodsSet(m_iMatchID, m_iPeriod);
            GVAR.g_MatchPeriodSet = m_iPeriod;
        }
コード例 #3
0
        private bool SetPlayerUnActive(int iSelRegisterID, int iTeampos)
        {
            DataGridView dgv = new DataGridView();

            if (iTeampos == 1)
            {
                dgv = dgvHomeList;
            }
            else
            {
                dgv = dgvVisitList;
            }

            for (int i = 0; i < dgv.Rows.Count; i++)
            {
                if (GVAR.Str2Int(dgv.Rows[i].Cells["F_RegisterID"].Value) == iSelRegisterID)
                {
                    if (dgv.Rows[i].Cells["F_Active"].Value.ToString() != "1")
                    {
                        return(false);
                    }

                    GVAR.g_ManageDB.UpdatePlayerActive(m_MatchID, iSelRegisterID, 0, "0");
                    UpdatePlayerPlayeTime(iTeampos, iSelRegisterID);
                    ResetPlayerList(iTeampos, ref dgv);
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int iColIdx     = dgvAvailOfficial.Columns["F_RegisterID"].Index;
            int iFuncColIdx = dgvAvailOfficial.Columns["F_FunctionID"].Index;

            for (int i = 0; i < dgvAvailOfficial.SelectedRows.Count; i++)
            {
                int iRowIdx = dgvAvailOfficial.SelectedRows[i].Index;

                string strRegisterID = dgvAvailOfficial.Rows[iRowIdx].Cells[iColIdx].Value.ToString();
                string strFunctionID = dgvAvailOfficial.Rows[iRowIdx].Cells[iFuncColIdx].Value.ToString();

                int iRegisterID = GVAR.Str2Int(strRegisterID);
                int iFunctionID = 0;
                if (strFunctionID.Length == 0)
                {
                    iFunctionID = -1;
                }
                else
                {
                    iFunctionID = GVAR.Str2Int(strFunctionID);
                }
                GVAR.g_ManageDB.AddMatchOfficial(m_iMatchID, iRegisterID, iFunctionID);
            }
            ResetAvailableOfficial();
            ResetMatchOfficial();
        }
コード例 #5
0
        //private void UpdateMemberOrder(int iTeamPos, ref DataGridView dgv, DataGridViewCellEventArgs e)
        //{
        //    int iColumnIndex = e.ColumnIndex;
        //    int iRowIndex = e.RowIndex;

        //    DataGridViewCell CurCell = dgv.Rows[iRowIndex].Cells[iColumnIndex];

        //    int iBatOrder = 0;
        //    if (CurCell.Value != null)
        //    {
        //        iBatOrder = GVAR.Str2Int(CurCell.Value);
        //    }
        //    int iMemberID = GVAR.Str2Int(dgv.Rows[iRowIndex].Cells["F_MemberID"].Value);

        //    GVAR.g_ManageDB.UpdatePlayerOrder(m_iMatchID.ToString(), iMemberID, iBatOrder);

        //}

        private void UpdateMemberStatus(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);
                GVAR.g_ManageDB.UpdateMemberStatus(m_iMatchID, iTeamPos, iMemberID, iIRMID);
            }
        }
コード例 #6
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();
        }
コード例 #7
0
        private void UpdateAddTime(string strTime)
        {
            int iMatchID = GVAR.Str2Int(m_CCurMatch.MatchID);
            int iSplitID = GVAR.g_ManageDB.GetMatchSplitID(iMatchID, m_CCurMatch.Period);

            GVAR.g_ManageDB.UpdateAddTime(iMatchID, iSplitID, strTime);
            GVAR.g_FBPlugin.DataChangedNotify(OVRDataChangedType.emSplitInfo, -1, -1, -1, iMatchID, iMatchID, null);
        }
コード例 #8
0
ファイル: OVRFBMatchInfo.cs プロジェクト: jack-liaojie/EQ_C-
        public int ChangePoint(int iTeamPos, bool bAdd, int iPoint, int iPeriod)
        {
            int iResult = 0;

            if (iPeriod <= 0)
            {
                return(iResult);
            }
            if (m_CHomeTeam.GetScore(iPeriod).Length == 0)
            {
                m_CHomeTeam.SetScore("0", iPeriod);
            }
            if (m_CVisitTeam.GetScore(iPeriod).Length == 0)
            {
                m_CVisitTeam.SetScore("0", iPeriod);
            }
            OVRFBTeamInfo tmpTeam = new OVRFBTeamInfo();
            int           iSetPt;

            if (iTeamPos == 1)
            {
                tmpTeam = m_CHomeTeam;
            }
            else if (iTeamPos == 2)
            {
                tmpTeam = m_CVisitTeam;
            }

            if (bAdd)
            {
                iSetPt = GVAR.Str2Int(tmpTeam.GetScore(iPeriod)) + 1;
            }
            else
            {
                iSetPt = Math.Max(GVAR.Str2Int(tmpTeam.GetScore(iPeriod)) - 1, 0);
            }
            tmpTeam.SetScore(iSetPt.ToString(), iPeriod);

            //计算总分
            int iHomePt  = 0;
            int iVisitPt = 0;

            for (int i = 1; i <= GVAR.MAXSETNUM; i++)
            {
                iHomePt  += GVAR.Str2Int(m_CHomeTeam.GetScore(i));
                iVisitPt += GVAR.Str2Int(m_CVisitTeam.GetScore(i));
            }
            m_CHomeTeam.TeamPoint  = iHomePt;
            m_CVisitTeam.TeamPoint = iVisitPt;
            iResult = 1;
            return(iResult);
        }
コード例 #9
0
        private void AddMember(int iTeamPos, ref DataGridView dgv)
        {
            int iColIdx          = dgv.Columns["F_MemberID"].Index;
            int iFuncColIdx      = dgv.Columns["F_FunctionID"].Index;
            int iShirtNumberIdex = dgv.Columns["ShirtNumber"].Index;
            int iPosColIdx       = dgv.Columns["F_PositionID"].Index;

            for (int i = 0; i < dgv.SelectedRows.Count; i++)
            {
                int iRowIdx = dgv.SelectedRows[i].Index;

                if (dgv.Rows[iRowIdx].ReadOnly == true)
                {
                    continue;
                }
                string strMemberID    = dgv.Rows[iRowIdx].Cells[iColIdx].Value.ToString();
                string strFunctionID  = dgv.Rows[iRowIdx].Cells[iFuncColIdx].Value.ToString();
                string strPositionID  = dgv.Rows[iRowIdx].Cells[iPosColIdx].Value.ToString();
                string strShirtNumber = dgv.Rows[iRowIdx].Cells[iShirtNumberIdex].Value.ToString();

                int iMemberID    = GVAR.Str2Int(strMemberID);
                int iFunctionID  = 0;
                int iPostionID   = 0;
                int iShirtNumber = 0;
                if (strFunctionID.Length == 0)
                {
                    iFunctionID = -1;
                }
                else
                {
                    iFunctionID = GVAR.Str2Int(strFunctionID);
                }

                if (strPositionID.Length == 0)
                {
                    iPostionID = -1;
                }
                else
                {
                    iPostionID = GVAR.Str2Int(strPositionID);
                }
                if (strShirtNumber.Length == 0)
                {
                    iShirtNumber = -1;
                }
                else
                {
                    iShirtNumber = GVAR.Str2Int(strShirtNumber);
                }
                GVAR.g_ManageDB.AddMatchMember(m_iMatchID, iMemberID, iTeamPos, iFunctionID, iPostionID, iShirtNumber);
            }
        }
コード例 #10
0
        private void RemoveMember(int iTeamPos, ref DataGridView dgv)
        {
            int iColIdx = dgv.Columns["F_MemberID"].Index;

            for (int i = 0; i < dgv.SelectedRows.Count; i++)
            {
                int iRowIdx = dgv.SelectedRows[i].Index;

                string strMemberID = dgv.Rows[iRowIdx].Cells[iColIdx].Value.ToString();
                int    iMemberID   = GVAR.Str2Int(strMemberID);

                GVAR.g_ManageDB.RemoveMatchMember(m_iMatchID, iMemberID, iTeamPos);
            }
        }
コード例 #11
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            int iColIdx = dgvMatchOfficial.Columns["F_RegisterID"].Index;

            for (int i = 0; i < dgvMatchOfficial.SelectedRows.Count; i++)
            {
                int iRowIdx = dgvMatchOfficial.SelectedRows[i].Index;

                string strRegisterID = dgvMatchOfficial.Rows[iRowIdx].Cells[iColIdx].Value.ToString();

                int iRegisterID = GVAR.Str2Int(strRegisterID);
                GVAR.g_ManageDB.RemoveMatchOfficial(m_iMatchID, iRegisterID);
            }
            ResetAvailableOfficial();
            ResetMatchOfficial();
        }
コード例 #12
0
        private void UpdateMemberShirtNumber(int iTeamPos, ref DataGridView dgv, DataGridViewCellEventArgs e)
        {
            int iColumnIndex = e.ColumnIndex;
            int iRowIndex    = e.RowIndex;

            DataGridViewCell CurCell = dgv.Rows[iRowIndex].Cells[iColumnIndex];

            string strShirtNumber = "";

            if (CurCell.Value != null)
            {
                strShirtNumber = CurCell.Value.ToString();
            }
            int iMemberID = GVAR.Str2Int(dgv.Rows[iRowIndex].Cells["F_MemberID"].Value);

            GVAR.g_ManageDB.UpdateMatchMemberShirtNumber(m_iMatchID, iMemberID, iTeamPos, strShirtNumber);
        }
コード例 #13
0
        public void ChangePeriod()
        {
            if (m_CCurMatch.Period == GVAR.PERIOD_1stExtraHalf)
            {
                if (lbExa1.Visible == false)
                {
                    lbExa1.Visible     = true;
                    lbExa2.Visible     = true;
                    lbHPt_Exa1.Visible = true;
                    lbHPt_Exa2.Visible = true;
                    lbVPt_Exa1.Visible = true;
                    lbVPt_Exa2.Visible = true;
                }

                if (!GVAR.g_ManageDB.IsExistMatchSplit(ref m_CCurMatch, GVAR.PERIOD_1stExtraHalf))
                {
                    GVAR.g_ManageDB.AddSplitMatch(ref m_CCurMatch, GVAR.PERIOD_1stExtraHalf.ToString());
                    GVAR.g_ManageDB.AddSplitMatch(ref m_CCurMatch, GVAR.PERIOD_2ndExtraHalf.ToString());
                }
            }

            if (m_CCurMatch.Period == GVAR.PERIOD_PenaltyShoot)
            {
                if (lbPSO.Visible == false)
                {
                    lbPSO.Visible     = true;
                    lbHPt_PSO.Visible = true;
                    lbVPt_PSO.Visible = true;
                }
                if (!GVAR.g_ManageDB.IsExistMatchSplit(ref m_CCurMatch, GVAR.PERIOD_PenaltyShoot))
                {
                    GVAR.g_ManageDB.AddSplitMatch(ref m_CCurMatch, GVAR.PERIOD_PenaltyShoot.ToString());
                }
            }

            GVAR.g_ManageDB.UpdateMatchPeriod(ref m_CCurMatch);
            //if (m_CCurMatch.Period != GVAR.PERIOD_PenaltyShoot)
            {
                GVAR.g_ManageDB.UpdateTeamSetPt(ref m_CCurMatch, m_CCurMatch.Period);
            }
            lbPeriod.Text = GVAR.g_ManageDB.GetPeriodName(GVAR.Str2Int(m_CCurMatch.MatchID), m_CCurMatch.Period.ToString());
        }
コード例 #14
0
        public static string FormatTime(string strTime)
        {
            string strFmtTime = "";

            if (strTime.Length == 0)
            {
                return(strFmtTime);
            }

            int iMatchTime = GVAR.Str2Int(strTime);
            int iHour_Min  = iMatchTime / 60;
            int iHour      = iHour_Min / 60;
            int iMin       = iHour_Min % 60;
            int iSec       = iMatchTime % 60;

            //格式为00:00:00
            strFmtTime = iHour.ToString() + ":" + iMin.ToString() + ":" + iSec.ToString();

            return(strFmtTime);
        }
コード例 #15
0
        public static void ConvetTime2String(string strFormatTime, ref string strTime)
        {
            int iIndex = strFormatTime.IndexOf(':');

            if (iIndex < 0)
            {
                return;
            }

            string strMin = strFormatTime.Substring(0, iIndex);
            string strSec = strFormatTime.Substring(iIndex + 1);

            string[] strSplitTime = strFormatTime.Split(':');

            int iHour = 0;
            int iMin  = 0;
            int iSec  = 0;

            iHour   = GVAR.Str2Int(strSplitTime[0]) * 3600;
            iMin    = GVAR.Str2Int(strSplitTime[1]) * 60;
            iSec    = GVAR.Str2Int(strSplitTime[2]);
            strTime = (iHour + iSec + iMin).ToString();
        }
コード例 #16
0
ファイル: OVRFBActionInfo.cs プロジェクト: jack-liaojie/EQ_C-
 public void InitAction(OVRFBMatchInfo tmpMatch, int iMatchSplitID)
 {
     m_iMatchID      = GVAR.Str2Int(tmpMatch.MatchID);
     m_iMatchSplitID = iMatchSplitID;
 }
コード例 #17
0
        private void cmbUniform_Home_SelectionChangeCommitted(object sender, EventArgs e)
        {
            m_iHomeUniformID = GVAR.Str2Int(cmbUniform_Home.SelectedValue);

            GVAR.g_ManageDB.UpdateMatchUniform(m_iMatchID, 1, m_iHomeUniformID);
        }
コード例 #18
0
        private void InitMatchInfo()
        {
            int iPeriod = 0;

            GVAR.g_ManageDB.GetMatchPeriodSetting(m_MatchID, ref iPeriod);
            GVAR.g_MatchPeriodSet = iPeriod;
            lb_EventDes.Text      = m_CCurMatch.SportDes;
            lb_MatchDes.Text      = m_CCurMatch.PhaseDes;
            lb_VenueDes.Text      = m_CCurMatch.VenueDes;
            lb_DateDes.Text       = m_CCurMatch.DateDes;


            lbHomeDes.Text  = m_CCurMatch.m_CHomeTeam.TeamName;
            lbHomeTeam.Text = m_CCurMatch.m_CHomeTeam.TeamName;

            lbVisitDes.Text  = m_CCurMatch.m_CVisitTeam.TeamName;
            lbVisitTeam.Text = m_CCurMatch.m_CVisitTeam.TeamName;

            m_bUIChange = false;
            int imatchTime = m_CCurMatch.MatchTime.Trim().Length == 0 ? 0 : int.Parse(m_CCurMatch.MatchTime.Trim());

            MatchTime.Text = GVAR.TranslateINT32toTime(imatchTime);
            m_bUIChange    = true;

            lbPeriod.Text = GVAR.g_ManageDB.GetPeriodName(m_MatchID, m_CCurMatch.Period.ToString());
            int iValidSplitCode = GVAR.g_ManageDB.GetMaxValidSplitCode(m_MatchID);

            if (GVAR.g_MatchPeriodSet == 0)
            {
                BtnExtraVisible(false);
                BtnPSOVisible(false);
            }
            else if (GVAR.g_MatchPeriodSet == 1)
            {
                BtnExtraVisible(false);

                if (m_CCurMatch.Period == GVAR.PERIOD_PenaltyShoot || iValidSplitCode == GVAR.PERIOD_PenaltyShoot)
                {
                    BtnPSOVisible(true);
                }
                else
                {
                    BtnPSOVisible(false);
                }
            }
            else if (GVAR.g_MatchPeriodSet == 2)
            {
                if (m_CCurMatch.Period >= GVAR.PERIOD_1stExtraHalf || iValidSplitCode >= GVAR.PERIOD_1stExtraHalf)
                {
                    BtnExtraVisible(true);
                }
                else
                {
                    BtnExtraVisible(false);
                }

                if (m_CCurMatch.Period == GVAR.PERIOD_PenaltyShoot || iValidSplitCode >= GVAR.PERIOD_PenaltyShoot)
                {
                    BtnPSOVisible(true);
                }
                else
                {
                    BtnPSOVisible(false);
                }
            }

            lbHomeDes.Text   = m_CCurMatch.m_CHomeTeam.TeamName;
            lbHomeTeam.Text  = m_CCurMatch.m_CHomeTeam.TeamName;
            lbVisitDes.Text  = m_CCurMatch.m_CVisitTeam.TeamName;
            lbVisitTeam.Text = m_CCurMatch.m_CVisitTeam.TeamName;

            InitTeamInfo();
        }
コード例 #19
0
 private void cmbUniform_VisitGK_SelectionChangeCommitted(object sender, EventArgs e)
 {
     m_iVisitGKUniformID = GVAR.Str2Int(cmbUniform_VisitGK.SelectedValue);
     GVAR.g_ManageDB.UpdateMatchGKUniform(m_iMatchID, 2, m_iVisitGKUniformID);
 }