예제 #1
0
        private void InterfaceUpdateDataGridView(DataGridView dgv)
        {
            AR_Archer player = (AR_Archer)dgv.Tag;

            if (player.Ends.Count > 0)
            {
                for (int nRow = 1; nRow <= dgv.Rows.Count; nRow++)
                {
                    DataGridViewRow row      = dgv.Rows[nRow - 1];
                    AR_End          theEnd   = player.Ends.Find(p => p.EndIndex == nRow.ToString());
                    int             ColIndex = 1;
                    for (int nCol = 0; nCol < CurMatchInfo.ArrowCount; nCol++)
                    {
                        row.Cells[nCol + 1].Value = theEnd.Arrows[nCol].Ring;
                        row.Cells[nCol + 1].Tag   = theEnd.Arrows[nCol];
                        ColIndex++;
                    }
                    row.Cells[ColIndex].Value = theEnd.R10Num;
                    ColIndex++;
                    row.Cells[ColIndex].Value = theEnd.Xnum;
                    ColIndex++;
                    row.Cells[ColIndex].Value = theEnd.Total;
                    ColIndex++;
                    row.Tag = theEnd;
                }
            }
            dgv.Tag = player;
        }
예제 #2
0
        private void UpdateDataGridView(DataGridView dgv)
        {
            dgv.Rows.Clear();
            AR_Archer player = (AR_Archer)dgv.Tag;

            if (player.Ends.Count > 0)
            {
                for (int nRow = 0; nRow < CurMatchInfo.EndCount; nRow++)
                {
                    DataGridViewRow row = new DataGridViewRow();
                    row.CreateCells(dgv);
                    row.Selected = false;

                    AR_End theEnd = player.Ends[nRow];
                    row.Cells[0].Value = "End " + (nRow + 1).ToString();
                    int ColIndex = 1;
                    for (int nCol = 0; nCol < CurMatchInfo.ArrowCount; nCol++)
                    {
                        row.Cells[nCol + 1].Value = theEnd.Arrows[nCol].Ring;
                        row.Cells[nCol + 1].Tag   = theEnd.Arrows[nCol];
                        ColIndex++;
                    }
                    row.Cells[ColIndex].Value = theEnd.R10Num;
                    ColIndex++;
                    row.Cells[ColIndex].Value = theEnd.Xnum;
                    ColIndex++;
                    row.Cells[ColIndex].Value = theEnd.Total;
                    ColIndex++;
                    dgv.Rows.Add(row);
                    row.Tag = theEnd;
                }
            }
            dgv.Tag = player;
        }
예제 #3
0
        private void dgv_PlayerA_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex > 0)
            {
                AR_End rowEnd  = new AR_End();
                bool   bReturn = false;
                if (dgv_PlayerA.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.Name.Contains("Arrow"))
                {
                    EditArrowsInfo(dgv_PlayerA[e.ColumnIndex, e.RowIndex]);
                }

                rowEnd        = (AR_End)dgv_PlayerA.Rows[e.RowIndex].Tag;
                rowEnd.R10Num = ARFunctions.ConvertToStringFromObject(dgv_PlayerA.Rows[e.RowIndex].Cells["10s"].Value);
                rowEnd.Xnum   = ARFunctions.ConvertToStringFromObject(dgv_PlayerA.Rows[e.RowIndex].Cells["Xs"].Value);
                rowEnd.Total  = ARFunctions.ConvertToStringFromObject(dgv_PlayerA.Rows[e.RowIndex].Cells["Total"].Value);

                labX_TotalA.Text = this.GetPlayerTotalScore(dgv_PlayerA);
                bReturn          = GVAR.g_ManageDB.UpdatePlayerEnd(m_nCurMatchID, rowEnd.CompetitionPosition, rowEnd.SplitID, rowEnd.EndIndex, rowEnd.Total,
                                                                   rowEnd.Point, rowEnd.R10Num, rowEnd.Xnum, 0);
                if (bReturn)
                {
                    dgv_PlayerA.Rows[e.RowIndex].Tag = rowEnd;
                    GVAR.g_ARPlugin.DataChangedNotify(OVRDataChangedType.emMatchResult, -1, -1, -1, m_nCurMatchID, m_nCurMatchID, null);
                }
            }
        }
예제 #4
0
        public static AR_End GetPlayerOneEndByDistince(int nMatchID, int nDistince, int nCompetitionPosition, string nEndIndex)
        {
            List <AR_End> myEnds = new List <AR_End>();
            DataTable     dt     = GVAR.g_ManageDB.GetPlayerEnds(nMatchID, nDistince, nCompetitionPosition, nEndIndex);

            for (int nRow = 0; nRow < dt.Rows.Count; nRow++)
            {
                string strFieldName = "";
                object obj          = null;
                AR_End oneEnd       = new AR_End();

                strFieldName = "F_CompetitionPosition";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.CompetitionPosition = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName = "F_Points";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Total = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName    = "EndIndex";
                obj             = dt.Rows[nRow][strFieldName];
                oneEnd.EndIndex = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName    = "EndCode";
                obj             = dt.Rows[nRow][strFieldName];
                oneEnd.EndIndex = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName   = "F_MatchID";
                obj            = dt.Rows[nRow][strFieldName];
                oneEnd.MatchID = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName   = "F_MatchSplitID";
                obj            = dt.Rows[nRow][strFieldName];
                oneEnd.SplitID = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName = "SetPoints";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Point = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName  = "Num10s";
                obj           = dt.Rows[nRow][strFieldName];
                oneEnd.R10Num = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName = "NumXs";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Xnum  = ARFunctions.ConvertToStringFromObject(obj);

                myEnds.Add(oneEnd);
            }
            AR_End ar = new AR_End();

            if (myEnds.Count > 0)
            {
                ar = myEnds[0];
            }
            return(ar);
        }
예제 #5
0
        public static List <AR_End> GetPlayerShootEnds(int nMatchID, int nCompetitionPosition)
        {
            List <AR_End> myEnds = new List <AR_End>();
            DataTable     dt     = GVAR.g_ManageDB.GetPlayerShootEnds(nMatchID, 1, nCompetitionPosition, "-1");

            for (int nRow = 0; nRow < dt.Rows.Count; nRow++)
            {
                string strFieldName = "";
                object obj          = null;
                AR_End oneEnd       = new AR_End();

                strFieldName = "F_CompetitionPosition";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.CompetitionPosition = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName = "Total";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Total = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName    = "EndIndex";
                obj             = dt.Rows[nRow][strFieldName];
                oneEnd.EndIndex = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName    = "EndCode";
                obj             = dt.Rows[nRow][strFieldName];
                oneEnd.EndIndex = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName   = "F_MatchID";
                obj            = dt.Rows[nRow][strFieldName];
                oneEnd.MatchID = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName   = "F_MatchSplitID";
                obj            = dt.Rows[nRow][strFieldName];
                oneEnd.SplitID = ARFunctions.ConvertToIntFromObject(obj);

                strFieldName = "SetPoints";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Point = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName  = "Num10s";
                obj           = dt.Rows[nRow][strFieldName];
                oneEnd.R10Num = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName = "NumXs";
                obj          = dt.Rows[nRow][strFieldName];
                oneEnd.Xnum  = ARFunctions.ConvertToStringFromObject(obj);

                strFieldName      = "EndComment";
                obj               = dt.Rows[nRow][strFieldName];
                oneEnd.EndComment = ARFunctions.ConvertToStringFromObject(obj);

                myEnds.Add(oneEnd);
            }
            return(myEnds);
        }
예제 #6
0
        private void EditArrowsInfo(DataGridViewCell cell)
        {
            bool     bReturn = false;
            AR_Arrow arrow   = (AR_Arrow)cell.Tag;

            arrow.Ring = ARFunctions.ConvertToStringFromObject(cell.Value);
            bReturn    = GVAR.g_ManageDB.UpdatePlayerArrow(m_nCurMatchID, arrow.CompetitionPosition, arrow.FatherSplitID, arrow.ArrowIndex, arrow.Ring, 1);
            if (bReturn)
            {
                cell.Tag = arrow;
                AR_End rowEnd        = (AR_End)cell.OwningRow.Tag;
                int    curArrowIndex = rowEnd.Arrows.FindIndex(delegate(AR_Arrow aa) { return(aa.ArrowIndex == arrow.ArrowIndex); });
                rowEnd.Arrows[curArrowIndex] = arrow;
                SetEnd10AndXNumbers(cell.OwningRow);
                if (IsAutoUpTotal) //自动更新每局总环数开关
                {
                    SetPlayerEndTotal(cell.OwningRow);
                }
                GVAR.g_ARPlugin.DataChangedNotify(OVRDataChangedType.emMatchResult, -1, -1, -1, m_nCurMatchID, m_nCurMatchID, null);
            }
        }