protected void AddBetListSuccess(MatchBetNew new1) { try { this._objBetListAll.Add(new1); this._objBetListLive.Add(new1); MatchBetNew item = new1.Clone(); item.set_MemberName(this._strAccountID); this._objProgramBetListPermanent.Add(item); this.WriteBetlistLogger(new1.GetInfo(this.get_AccountID() + " Bet Success")); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; this._objErrorLogger.write(this._strName + ": EXCEPTION IN AddBetListSuccess: " + exception.Message); this.WriteProgramLogger(this._strName + ": EXCEPTION IN AddBetListSuccess: " + exception.Message); ProjectData.ClearProjectError(); } }
public void Add(MatchBetNew new1) { MatchBetNew new3; int indexByMatch = -1; MatchBetNew item = new1.Clone(); indexByMatch = this.GetIndexByMatch(item); if (indexByMatch != -1) { if (Conversion.Val(this._objList[indexByMatch].get_BetAmount()) >= this._intAmountLimit) { goto Label_02E0; } switch (item.get_OddsType()) { case EnumCollection.eOddsType.HK: item.set_Odds(this.ConvertHKToMalayOdds(item.get_Odds())); goto Label_0197; case EnumCollection.eOddsType.Euro: item.set_Odds(this.ConvertEuroToMalayOdds(item.get_Odds())); goto Label_0197; case EnumCollection.eOddsType.Indo: item.set_Odds(this.ConvertIndoToMalayOdds(item.get_Odds())); goto Label_0197; } } else { switch (item.get_OddsType()) { case EnumCollection.eOddsType.HK: item.set_Odds(this.ConvertHKToMalayOdds(item.get_Odds())); break; case EnumCollection.eOddsType.Euro: item.set_Odds(this.ConvertEuroToMalayOdds(item.get_Odds())); break; case EnumCollection.eOddsType.Indo: item.set_Odds(this.ConvertIndoToMalayOdds(item.get_Odds())); break; } item.set_OddsType(EnumCollection.eOddsType.Malay); if (item.get_Odds() < 0.0) { item.set_Odds(2.0 + item.get_Odds()); } item.set_LeagueMatchingID(1); item.set_EstimatePayout(new decimal(Conversion.Val(Conversions.ToDouble(item.get_BetAmount()) * item.get_Odds()))); item.set_Odds(Convert.ToDouble(item.get_EstimatePayout()) / Conversion.Val(item.get_BetAmount())); if (item.get_Odds() > 1.0) { new3 = item; new3.set_Odds(new3.get_Odds() - 2.0); } this._objList.Add(item); goto Label_02E0; } Label_0197: item.set_OddsType(EnumCollection.eOddsType.Malay); if (item.get_Odds() < 0.0) { item.set_Odds(2.0 + item.get_Odds()); } item.set_EstimatePayout(new decimal(Conversion.Val(Conversions.ToDouble(item.get_BetAmount()) * item.get_Odds()))); new3 = this._objList[indexByMatch]; new3.set_LeagueMatchingID(new3.get_LeagueMatchingID() + 1); this._objList[indexByMatch].set_BetAmount(Conversions.ToString((double) (Conversion.Val(this._objList[indexByMatch].get_BetAmount()) + Conversion.Val(item.get_BetAmount())))); new3 = this._objList[indexByMatch]; new3.set_EstimatePayout(decimal.Add(new3.get_EstimatePayout(), item.get_EstimatePayout())); this._objList[indexByMatch].set_Odds(Convert.ToDouble(this._objList[indexByMatch].get_EstimatePayout()) / Conversion.Val(this._objList[indexByMatch].get_BetAmount())); if (this._objList[indexByMatch].get_Odds() > 1.0) { new3 = this._objList[indexByMatch]; new3.set_Odds(new3.get_Odds() - 2.0); } Label_02E0: this.UpdateInfo(); }