public static bool removeBank(OddSr curOdd) { try { int count = 0; TipItem modifyItem = null; foreach (TipItem curItem in TipItems) { if (curItem.Odd.BetDomain.ORMID == curOdd.BetDomain.ORMID) { count++; modifyItem = curItem; } } if (count < 2 && modifyItem != null) { modifyItem.IsBank = false; modifyItem.IsMultiWay = false; } return(count < 2); } catch (Exception ex) { //_logger.Error("in removeBank: " + ex); return(false); } }
public TipItem(int id, string opponents, string tiptext, OddSr odd, MatchSr match, string headline, int headlineSize) { //set class variables ID = id; Opponents = opponents; //==match.DisplayShortName FormattedTipText = tiptext; //==odd.DisplayName ==matchbo.DisplayOddName ==betdomain+odd this.Odd = odd; this.Match = match; if (odd != null && odd.BetDomain != null && odd.BetDomain.MinCombination > 0) { FormattedMincombination = odd.BetDomain.MinCombination.ToString(); } else { FormattedMincombination = String.Empty; } //für Ticket: if (match != null) { //this.opponentsLongSingleLine = match.DisplayName.Replace("\n ", String.Empty); OpponentsLongSingleLine = opponents; FormattedDate = DateTimeUtils.DisplayDateTime(match.StartDate, new CultureInfo("En")); } if (OpponentsLongSingleLine == null) { OpponentsLongSingleLine = String.Empty; } if (FormattedDate == null) { FormattedDate = String.Empty; } if (odd != null && odd.BetDomain != null) { FormattedBetDomain = odd.BetDomain.DisplayName; FormattedOdd = odd.TextLangStr; } if (FormattedBetDomain == null) { FormattedBetDomain = String.Empty; } if (FormattedOdd == null) { FormattedOdd = String.Empty; } Headline = headline; HeadlineSize = headlineSize; Spacer = 0; }
public static TipItem AddTipData(string opponents, string tiptext, OddSr odd, MatchSr match, bool isBank) { // To be ensure that duplicated Ticket Tip will not be added if (DataBinding.FindTipDataBySvrOddId((int)odd.SvrOddID) != null) { return(null); } //new instance of tip item TipItem tip = new TipItem(_tipItems.Count, opponents, tiptext, odd, match, String.Empty, 0); tip.IsBank = addBank(odd); int index = 0; _tipItems.Insert(index, tip); //AfterTipItemsChanged();//Removed by GMU 11.07.2008 because of possibly being redundant //handle the animation for showing/hiding of menu and tiplist return(tip); }
public static bool addBank(OddSr curOdd) { try { int count = 0; foreach (TipItem curItem in TipItems) { if (curItem.Odd.BetDomain.ORMID == curOdd.BetDomain.ORMID) { count++; curItem.IsBank = true; curItem.IsMultiWay = true; } } return(count > 0); } catch (Exception ex) { //_logger.Debug("Error adding Bank: " + ex); return(false); } }
public static TipItem AddTipData(string opponents, string tiptext, OddSr odd, MatchSr match) { return(AddTipData(opponents, tiptext, odd, match, false)); }