public int GetTotal() { int _total = 0; if (_arrows.Count > 0) { foreach (AR_Arrow ar in _arrows) { int curArrow = 0; if (ar.Ring.ToUpper() == "X") { curArrow = 10; } if (ar.Ring.ToUpper() == "M") { curArrow = 0; } else { curArrow = ARFunctions.ConvertToIntFromString(ar.Ring); } _total += curArrow; } } return(_total); }
private static int ArchersComparePoint(AR_Archer objEx1, AR_Archer objEx2) { if (objEx1 == objEx2) { return(0); } if (objEx1.Result != objEx2.Result) { int total1 = ARFunctions.ConvertToIntFromString(objEx1.Result); int total2 = ARFunctions.ConvertToIntFromString(objEx2.Result); if (total1 < total2) { return(1); } else { return(-1); } } else { if (objEx1.Num10S != objEx2.Num10S) { int num10s_1 = ARFunctions.ConvertToIntFromString(objEx1.Num10S); int num10s_2 = ARFunctions.ConvertToIntFromString(objEx2.Num10S); if (num10s_1 < num10s_2) { return(1); } else { return(-1); } } else { if (objEx1.NumXS != objEx2.NumXS) { int numXs_1 = ARFunctions.ConvertToIntFromString(objEx1.NumXS); int numXs_2 = ARFunctions.ConvertToIntFromString(objEx2.NumXS); if (numXs_1 < numXs_2) { return(1); } else { return(-1); } } else { objEx1.IRM = "T"; objEx2.IRM = "T"; return(0); } } } }
private void btxX_Add_Click(object sender, EventArgs e) { int nEndCount = ARFunctions.ConvertToIntFromString(this.txtX_SEnds.Text); int nArrowCount = ARFunctions.ConvertToIntFromString(this.txtX_SArrows.Text); if (nEndCount > 0 && nArrowCount > 0) { int nReturn = GVAR.g_ManageDB.AddMatchSplits(CurMatchInfo.MatchID, nEndCount, nArrowCount, 1, 2); if (nReturn == 1) { this.DialogResult = DialogResult.Yes; } else { this.DialogResult = DialogResult.No; } this.Close(); } }
private void btnX_OK_Click(object sender, EventArgs e) { CurMatchInfo.EndCount = ARFunctions.ConvertToIntFromString(this.txtX_EndCount.Text); CurMatchInfo.ArrowCount = ARFunctions.ConvertToIntFromString(this.txtX_ArrowCount.Text); CurMatchInfo.IsSetPoints = cbX_IsSetPoints.Checked ? 0 : 1; CurMatchInfo.WinPoints = ARFunctions.ConvertToIntFromString(this.txtX_WinPoints.Text); CurMatchInfo.Distince = ARFunctions.ConvertToIntFromObject(((ComboBoxItem)cbX_Distince.SelectedItem).ToString()); CurMatchInfo.CurMatchRuleID = ARFunctions.ConvertToIntFromObject(cbbX_ComRule.SelectedValue); bool bReturn = GVAR.g_ManageDB.UpdateMatchSettings(CurMatchInfo.MatchID, CurMatchInfo.EndCount, CurMatchInfo.ArrowCount, CurMatchInfo.IsSetPoints, CurMatchInfo.WinPoints, CurMatchInfo.Distince, CurMatchInfo.CurMatchRuleID, -1); if (bReturn) { this.DialogResult = DialogResult.OK; } else { this.DialogResult = DialogResult.No; } this.Close(); }
public static int CompareTotalString(string tatalA, string totalB) { int compareResult = 0; int nTotalA = ARFunctions.ConvertToIntFromString(tatalA); int nTotalB = ARFunctions.ConvertToIntFromString(totalB); if (nTotalA > nTotalB) { compareResult = 1; } else if (nTotalA < nTotalB) { compareResult = -1; } else if (nTotalA == nTotalB) { compareResult = 0; } return(compareResult); }