public void GetOddFromGlobal(OddNews odd, DateTime timestamp, string fromUser) { if (fromUser != this._currentUserID) { try { SendOrPostCallback callback = new SendOrPostCallback(delegate(object state) { MatchDTO matchDTO = new MatchDTO(); matchDTO.HomeTeamName = odd.HomeTeamName; matchDTO.AwayTeamName = odd.AwayTeamName; matchDTO.League = new LeagueDTO(); matchDTO.League.Name = odd.LeagueName; eOddType EOddType = eOddType.Unknown; if (odd.OddType == "FirstHalfHandicap") EOddType = eOddType.FirstHalfHandicap; else if (odd.OddType == "FirstHalfOverUnder") EOddType = eOddType.FirstHalfOverUnder; else if (odd.OddType == "FulltimeHandicap") EOddType = eOddType.FulltimeHandicap; else EOddType = eOddType.FulltimeOverUnder; this.AddLocalValidOdd(fromUser, matchDTO, matchDTO, EOddType, odd.IbetOdd, odd.SbobetOdd,odd.IbetOddType, odd.SbobetOddType, odd.IbetOddValue, odd.SbobetOddValue, Boolean.Parse(odd.HomeFavor)); textEdit4.Text += "\r\n-- [" + timestamp.ToLongTimeString() + "] Get odd: " + odd.HomeTeamName + " - " + odd.AwayTeamName + " " + odd.LeagueName + " ; " + odd.OddType + " " + odd.IbetOdd + " / " + odd.SbobetOdd + " . " + odd.IbetOddType + " / " + odd.SbobetOddType + " / " + odd.IbetOddValue + " / " + odd.SbobetOddValue + " . " + odd.HomeFavor + ". From: " + fromUser; }); _uiSyncContext.Post(callback, null); //MessageBox.Show("call from Bet broker server", "Bet Broker", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Bet Broker", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
internal void AddOddToClound(string fromIbetAccount, MatchDTO ibetmatch, MatchDTO sbobetmatch, eOddType oddtype, string ibetodd, string sbobetodd, string ibetoddType, string sbobetoddType, string ibetoddValue, string sbobetoddValue, bool homeFavor) { if (chkSCloud.Checked) { OddNews odd = new OddNews(); odd.HomeTeamName = ibetmatch.HomeTeamName; odd.AwayTeamName = ibetmatch.AwayTeamName; odd.LeagueName = ibetmatch.LeagueName; odd.OddType = oddtype.ToString(); odd.IbetOddType = ibetoddType; odd.SbobetOddType = sbobetoddType; odd.IbetOddValue = ibetoddValue; odd.SbobetOddValue = sbobetoddValue; odd.HomeFavor = homeFavor.ToString(); odd.IbetOdd = ibetodd; odd.SbobetOdd = sbobetodd; try { betBrokerSvc.GetOdd(odd, this._currentUserID); } catch (TimeoutException exception) { //Console.WriteLine("Got {0}", exception.GetType()); //.Abort(); } catch (CommunicationException exception) { //InitializeWCFService(); } } }