Пример #1
0
        // add 1x2
        public List<MatchBetNew> GenerateMemberBetlistFromText(string text1)
        {
            List<MatchBetNew> list3 = new List<MatchBetNew>();
            ArrayList list2 = new ArrayList();
            ArrayList list4 = new ArrayList();
            int num = 0;
            string str = "";
            string str2 = "";
            string str3 = "";
            try
            {
                IEnumerator enumerator = null;
                int num2 = 0;
                str3 = CommonFunction.substring(text1, 0, "Bet List ", "- ", "<", ref num2).Trim();
                if (str3 == string.Empty)
                {
                    return list3;
                }
                while (num > -1)
                {
                    str2 = CommonFunction.substring(text1, num, "w-order", "</tr>", ref num);
                    if (str2 != string.Empty)
                    {
                        list2.Add(str2);
                    }
                }
                try
                {
                    enumerator = list2.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        str = Conversions.ToString(enumerator.Current);
                        bool flag = false;
                        MatchBetNew item = new MatchBetNew();
                        num = 0;
                        item.set_MemberName(str3);
                        if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                        {
                            item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                        }
                        else
                        {
                            Member member = base._objMemberList.get_Item(item.get_MemberName());
                            if (member != null)
                            {
                                item.set_BetFollowMethod(member.get_BetFollowMethod());
                            }
                            else
                            {
                                item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "Ref No:", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_ID(str2);
                        str2 = CommonFunction.substring(str, num, "bl_time mt10\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetDate(str2);
                        str2 = CommonFunction.substring(str, num, "<span", ">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_SelectedMatch(str2);
                        // 1x2不包含HDP eg <font color='#606060'>-1.5</font>
                        if (str.Contains("<font color='#606060'>"))
                        {
                            str2 = CommonFunction.substring(str, num, ">", "</", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                            item.set_HDP(str2);
                            item.HDPValue = str2;
                            str2 = CommonFunction.substring(str, num, ">", "<", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                        }
                        num2 = 0;
                        str2 = CommonFunction.substring(str2, 0, "[", "]", ref num2).Trim();
                        if (str2 != string.Empty)
                        {
                            list4 = CommonFunction.SeperateStringBySymbol(str2, "-");
                            if (list4.Count == 2)
                            {
                                item.set_HomeScore((int) Math.Round(Conversion.Val(list4[0].ToString().Trim())));
                                item.set_AwayScore((int) Math.Round(Conversion.Val(list4[1].ToString().Trim())));
                                item.set_GameType(EnumCollection.eGameType.Running);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "bl_btype b\">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_MatchType(str2);
                        switch (str2.ToLower())
                        {
                            case "handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "1st handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;

                            case "1st over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;
                            // Add 1x2
                            case "ft.1x2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                if (item.get_SelectedMatch().ToLower() == "ft.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_2);
                                }
                                break;
                            case "1st 1x2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                if (item.get_SelectedMatch().ToLower() == "ht.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_2);
                                }
                                break;
                        }
                        str2 = CommonFunction.substring(str, num, "bl_match\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        list4 = CommonFunction.SeperateStringBySymbol(str2, "- vs -");
                        if (list4.Count != 2)
                        {
                            continue;
                        }
                        item.set_HomeName(Conversions.ToString(NewLateBinding.LateGet(list4[0], null, "trim", new object[0], null, null, null)).Replace("&nbsp;", ""));
                        item.set_AwayName(Conversions.ToString(NewLateBinding.LateGet(list4[1], null, "trim", new object[0], null, null, null)).Replace("&nbsp;", ""));

                        string sportType = CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim();
                        if (Enum.IsDefined(typeof(EnumCollection.eSportType), sportType))
                        {
                            item.set_SportType((EnumCollection.eSportType)Enum.Parse(typeof(EnumCollection.eSportType), sportType));
                        }

                        // 只扫描足球赛事
                        /***if (CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim() != "Soccer")
                        {
                            continue;
                        }***/
                        str2 = CommonFunction.substring(str, num, "span>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_League(str2);
                        str2 = CommonFunction.substring(str, num, "span class=\"bl_underdog\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_OddsString(str2);
                        str2 = CommonFunction.substring(str, num, "<span class=\"bl_oddtype\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        string str5 = str2.ToUpper();
                        if (str5 == "MY")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                        }
                        else if (str5 == "INDO")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Indo);
                            item.set_Odds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Odds()));
                        }
                        else
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                            if (item.get_BetType() != EnumCollection.eBetType.lX2)
                            item.set_Odds(SportBookFunction.ConvertHKToMalayOdds(item.get_Odds()));
                        }
                        str2 = CommonFunction.substring(str, num, "span class=\"stake\">", "</span>", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetAmount(str2.Replace(",", ""));
                        if (item.get_HDP().Length > 0)
                        {
                            if (item.get_HDP().Substring(0, 1) == "-")
                            {
                                if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    item.set_AwayColor(Color.Red);
                                    item.set_HomeColor(Color.Blue);
                                }
                                else
                                {
                                    item.set_AwayColor(Color.Blue);
                                    item.set_HomeColor(Color.Red);
                                }
                            }
                            else if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                item.set_AwayColor(Color.Blue);
                                item.set_HomeColor(Color.Red);
                            }
                            else
                            {
                                item.set_AwayColor(Color.Red);
                                item.set_HomeColor(Color.Blue);
                            }
                        }
                        if ("null" != item.get_HDP())
                        {

                            item.set_HDP(SportBookFunction.ConvertHDPType(item.get_HDP()));
                        }
                        if (item.get_HDP() == "0.0")
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                        }
                        if (item.get_BetCoverage() != EnumCollection.eBetCoverage.FT)
                        {
                            goto Label_0757;
                        }
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                                goto Label_0841;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_072B;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                                goto Label_0841;

                            default:
                                goto Label_0841;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_072B:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_0757:
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                                goto Label_0841;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_081A;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                                goto Label_0841;

                            default:
                                goto Label_0841;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_0841;
                    Label_081A:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                    Label_0841:
                        num2 = 0;
                        item.set_IPAddress(CommonFunction.substring(str, 0, "\"iplink\">", "<", ref num2).Trim());
                        item.set_CreateDate(DateTime.Now);
                        item.set_Company(base._strAgentSiteName);
                        if (!flag)
                        {
                            list3.Add(item);
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateMemberBetlistFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list3;
        }
Пример #2
0
 public static string GenerateDetailedMatchInfo(MatchBetNew new1, string text1)
 {
     return ("\r\n============================================================\r\n" + text1 + "\r\n============================================================\r\nCompany: " + new1.get_Company() + "\r\nRef ID: " + new1.get_ID() + "\r\nMember: " + new1.get_MemberName() + "\r\nBetType: " + new1.get_BetType().ToString() + "\r\nGameType: " + new1.get_GameType().ToString() + "\r\nMatchTime: " + new1.get_MatchDate() + "\r\nScore: " + new1.get_HomeScore().ToString() + "-" + Conversions.ToString(new1.get_AwayScore()) + "\r\nLeague: " + new1.get_League() + "\r\nHome: " + new1.get_HomeName() + "\r\nAway: " + new1.get_AwayName() + "\r\nBet: " + new1.get_SelectedMatch() + "\r\nHDP: " + new1.get_HDP() + "\r\nOdds: " + Conversions.ToString(new1.get_Odds()) + "\r\nAmount: " + new1.get_BetAmount() + "\r\n============================================================");
 }
Пример #3
0
        protected List<MatchBetNew> ProcessMatchDetails(string text1)
        {
            List<MatchBetNew> list2 = new List<MatchBetNew>();
            ArrayList list = new ArrayList();
            ArrayList list3 = new ArrayList();
            int num = 0;
            string str = "";
            string str2 = "";
            try
            {
                IEnumerator enumerator = null;
                while (num > -1)
                {
                    str2 = CommonFunction.substring(text1, num, "w-order", "</tr>", ref num);
                    if (str2 != string.Empty)
                    {
                        list.Add(str2);
                    }
                }
                try
                {
                    enumerator = list.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        str = Conversions.ToString(enumerator.Current);
                        bool flag = false;
                        MatchBetNew item = new MatchBetNew();
                        num = 0;
                        str2 = CommonFunction.substring(str, num, "<td class=\"c\" valign=\"top\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_MemberName(str2);
                        if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                        {
                            item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                        }
                        else
                        {
                            Member member = base._objMemberList.get_Item(item.get_MemberName());
                            if (member != null)
                            {
                                item.set_BetFollowMethod(member.get_BetFollowMethod());
                            }
                            else
                            {
                                item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "Ref No:", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_ID(str2);
                        str2 = CommonFunction.substring(str, num, "bl_time\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetDate(str2);
                        str2 = CommonFunction.substring(str, num, "{class}\">", ">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_SelectedMatch(str2);
                        // 1x2不包含HDP eg <font color='#606060'>-1.5</font>
                        if (str.Contains("<font color='#606060'>"))
                        {
                            str2 = CommonFunction.substring(str, num, ">", "</", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                            item.set_HDP(str2);
                            str2 = CommonFunction.substring(str, num, ">", "<", ref num).Trim();
                            if (num <= -1)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            item.set_HDP("null");
                        }
                        int num2 = 0;
                        str2 = CommonFunction.substring(str2, 0, "[", "]", ref num2).Trim();
                        if (str2 != string.Empty)
                        {
                            list3 = CommonFunction.SeperateStringBySymbol(str2, "-");
                            if (list3.Count == 2)
                            {
                                item.set_HomeScore((int) Math.Round(Conversion.Val(list3[0].ToString().Trim())));
                                item.set_AwayScore((int) Math.Round(Conversion.Val(list3[1].ToString().Trim())));
                                item.set_GameType(EnumCollection.eGameType.Running);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                        }
                        str2 = CommonFunction.substring(str, num, "bl_btype b\">", "<", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        switch (str2.ToLower())
                        {
                            case "handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                break;

                            case "1st handicap":
                                item.set_BetType(EnumCollection.eBetType.HDP);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;

                            case "1st over/under":
                                item.set_BetType(EnumCollection.eBetType.OU);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                break;
                            // Add 1x2
                            case "ft.1 x 2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                if (item.get_SelectedMatch().ToLower() == "ft.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ft.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.FT_2);
                                }
                                break;
                            case "ht.1 x 2":
                                item.set_BetType(EnumCollection.eBetType.lX2);
                                item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                if (item.get_SelectedMatch().ToLower() == "ht.1")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_1);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.x")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_X);
                                }
                                else if (item.get_SelectedMatch().ToLower() == "ht.2")
                                {
                                    item.set_BetTarget(EnumCollection.eBetTarget.Half_2);
                                }
                                break;
                        }
                        str2 = CommonFunction.substring(str, num, "bl_match\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        list3 = CommonFunction.SeperateStringBySymbol(str2, "-vs-");
                        if (list3.Count != 2)
                        {
                            continue;
                        }
                        item.set_HomeName(Conversions.ToString(NewLateBinding.LateGet(list3[0], null, "trim", new object[0], null, null, null)));
                        item.set_AwayName(Conversions.ToString(NewLateBinding.LateGet(list3[1], null, "trim", new object[0], null, null, null)));
                        if (CommonFunction.substring(str, num, "bl_stype", ">", "<", ref num).Trim() != "Soccer")
                        {
                            continue;
                        }
                        str2 = CommonFunction.substring(str, num, "span>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_League(str2);
                        str2 = CommonFunction.substring(str, num, "'>", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_OddsString(str2);
                        str2 = CommonFunction.substring(str, num, "\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        string str4 = str2.ToUpper();
                        if (str4 == "MY")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Malay);
                        }
                        else if (str4 == "INDO")
                        {
                            item.set_OddsType(EnumCollection.eOddsType.Indo);
                            item.set_Odds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Odds()));
                        }
                        else
                        {
                            item.set_OddsType(EnumCollection.eOddsType.HK);
                            item.set_Odds(SportBookFunction.ConvertHKToMalayOdds(item.get_Odds()));
                        }
                        str2 = CommonFunction.substring(str, num, "\">", "</", ref num).Trim();
                        if (num <= -1)
                        {
                            continue;
                        }
                        item.set_BetAmount(str2.Replace(",", ""));
                        if (item.get_HDP().Length > 0)
                        {
                            if (item.get_HDP().Substring(0, 1) == "-")
                            {
                                if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    item.set_AwayColor(Color.Red);
                                    item.set_HomeColor(Color.Blue);
                                }
                                else
                                {
                                    item.set_AwayColor(Color.Blue);
                                    item.set_HomeColor(Color.Red);
                                }
                            }
                            else if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                item.set_AwayColor(Color.Blue);
                                item.set_HomeColor(Color.Red);
                            }
                            else
                            {
                                item.set_AwayColor(Color.Red);
                                item.set_HomeColor(Color.Blue);
                            }
                        }
                        if ("null" != item.get_HDP())
                        {
                            item.set_HDP(SportBookFunction.ConvertHDPType(item.get_HDP()));
                        }
                        if (item.get_HDP() == "0.0")
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                        }
                        if (item.get_BetCoverage() != EnumCollection.eBetCoverage.FT)
                        {
                            goto Label_0734;
                        }
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                                goto Label_081E;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_0708;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                                goto Label_081E;

                            default:
                                goto Label_081E;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_0708:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_0734:
                        switch (item.get_BetType())
                        {
                            case EnumCollection.eBetType.HDP:
                                if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                                {
                                    break;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                                goto Label_081E;

                            case EnumCollection.eBetType.OU:
                                if (item.get_SelectedMatch().ToLower() != "over")
                                {
                                    goto Label_07F7;
                                }
                                item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                                goto Label_081E;

                            default:
                                goto Label_081E;
                        }
                        if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                        }
                        else
                        {
                            flag = true;
                        }
                        goto Label_081E;
                    Label_07F7:
                        if (item.get_SelectedMatch().ToLower() == "under")
                        {
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                        }
                        else
                        {
                            flag = true;
                        }
                    Label_081E:
                        num2 = 0;
                        item.set_IPAddress(CommonFunction.substring(str, 0, "\"iplink\">", "<", ref num2).Trim());
                        item.set_CreateDate(DateTime.Now);
                        item.set_Company(base._strAgentSiteName);
                        if (!flag)
                        {
                            list2.Add(item);
                        }
                    }
                    return list2;
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN ProcessMatchDetails: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN ProcessMatchDetails: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list2;
        }
Пример #4
0
        public static MatchNew FindMatchByMatchBetSingleName(MatchBetNew new1, List<MatchNew> list1)
        {
            MatchNew neww3 = new MatchNew();
            MatchNew new4 = new MatchNew();
            new1.GenerateUpperCaseInfo();
            if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT)
            {
                if (new1.get_BetType() == EnumCollection.eBetType.HDP)
                {
                    foreach (MatchNew new3 in list1)
                    {
                        if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_FTHDP())) & (new1.get_HomeColor() == new3.get_FTHomeColor())) & (new1.get_AwayColor() == new3.get_FTAwayColor())))
                        {
                            return new3;
                        }
                    }
                    return new4;
                }
                foreach (MatchNew new3 in list1)
                {
                    if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_FTOU())))
                    {
                        return new3;
                    }
                }
                return new4;
            }
            if (new1.get_BetType() == EnumCollection.eBetType.HDP)
            {
                foreach (MatchNew new3 in list1)
                {
                    if ((new3.get_Type() == EnumCollection.eMatchType.Match) && ((((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_HalfHDP())) & ((((new1.get_HomeColor() == new3.get_HalfHomeColor()) & (new1.get_AwayColor() == new3.get_HalfAwayColor())) & (new1.get_HDP() != "0.0")) | (new1.get_HDP() == "0.0"))))
                    {
                        return new3;
                    }
                }
                return new4;
            }

            foreach (MatchNew new3 in list1)
            {
                if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_HalfOU())))
                {
                    return new3;
                }
            }
            return new4;
        }
Пример #5
0
 public static MatchNew FindMatchByMatchBetViaMatchingIDIgnoreColor(MatchBetNew new1, List<MatchNew> list1)
 {
     MatchNew newww3 = new MatchNew();
     MatchNew new4 = new MatchNew();
     if ((new1.get_HomeMatchingID() > 0) & (new1.get_AwayMatchingID() > 0))
     {
         new1.GenerateUpperCaseInfo();
         if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT)
         {
             if (new1.get_BetType() == EnumCollection.eBetType.HDP)
             {
                 foreach (MatchNew new3 in list1)
                 {
                     if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_FTHDP())))
                     {
                         return new3;
                     }
                 }
                 return new4;
             }
             foreach (MatchNew new3 in list1)
             {
                 if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_FTOU())))
                 {
                     return new3;
                 }
             }
             return new4;
         }
         if (new1.get_BetType() == EnumCollection.eBetType.HDP)
         {
             foreach (MatchNew new3 in list1)
             {
                 if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_HalfHDP())))
                 {
                     return new3;
                 }
             }
             return new4;
         }
         foreach (MatchNew new3 in list1)
         {
             if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_HalfOU())))
             {
                 return new3;
             }
         }
     }
     return new4;
 }
Пример #6
0
        public List<MatchBetNew> GenerateMemberBetlistFromText(string text1)
        {
            List<MatchBetNew> list4 = new List<MatchBetNew>();
            List<string> list3 = new List<string>();
            ArrayList list2 = new ArrayList();
            ArrayList list5 = new ArrayList();
            int num = 0;
            string current = "";
            try
            {
                while (num > -1)
                {
                    list3.Add(CommonFunction.substring(text1, num, ",['", "])", ref num).Trim());
                }
                List<string>.Enumerator enumerator = list3.GetEnumerator();
                try
                {
                    //enumerator;
                    while (enumerator.MoveNext())
                    {
                        current = enumerator.Current;
                        list2 = CommonFunction.SeperateStringBySymbol(current, "','");
                        if (list2.Count >= 14)
                        {
                            bool flag = false;
                            MatchBetNew item = new MatchBetNew();
                            item.set_ID(list2[8].ToString().Trim());
                            int num2 = 0;
                            item.set_MemberName(CommonFunction.substring(list2[7].ToString() + "#", 0, "],'", "#", ref num2));
                            if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                            {
                                item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                            }
                            else
                            {
                                Member member = base._objMemberList.get_Item(item.get_MemberName());
                                if (member != null)
                                {
                                    item.set_BetFollowMethod(member.get_BetFollowMethod());
                                }
                                else
                                {
                                    item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                                }
                            }
                            string sportType = list2[9].ToString().Trim();
                            if (Enum.IsDefined(typeof(EnumCollection.eSportType), sportType))
                            {
                                item.set_SportType((EnumCollection.eSportType)Enum.Parse(typeof(EnumCollection.eSportType), sportType));
                            }
                            item.set_BetDate(list2[10].ToString() + " " + list2[11].ToString());
                            item.set_Company(base._strAgentSiteName);
                            item.set_League(list2[6].ToString().Trim().Replace("&nbsp;", ""));
                            item.set_HomeName(list2[4].ToString().Trim().Replace("&nbsp;", ""));
                            item.set_AwayName(list2[5].ToString().Trim().Replace("&nbsp;", ""));
                            item.set_SelectedMatch(list2[0].ToString().Trim().Replace("&nbsp;", ""));
                            item.set_HDP(list2[1].ToString().Trim().Replace("&nbsp;", ""));
                            item.HDPValue = list2[1].ToString().Trim().Replace("&nbsp;", "");

                            string matchType = list2[2].ToString().ToLower();
                            item.set_MatchType(matchType);
                            switch (matchType)
                            {
                                case "handicap":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    item.set_BetType(EnumCollection.eBetType.HDP);
                                    if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower())
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower())
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;

                                case "first half o/u":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    item.set_BetType(EnumCollection.eBetType.OU);
                                    if (item.get_SelectedMatch().ToLower() == "over")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "under")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;

                                case "over/under":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    item.set_BetType(EnumCollection.eBetType.OU);
                                    if (item.get_SelectedMatch().ToLower() == "over")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "under")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;

                                case "first half hdp":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    item.set_BetType(EnumCollection.eBetType.HDP);
                                    if (item.get_SelectedMatch().ToLower() == item.get_AwayName().ToLower())
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower())
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;
                                case "first half 1x2":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                    item.set_BetType(EnumCollection.eBetType.lX2);
                                    if (item.get_SelectedMatch().ToLower() == "1")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_1);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "x")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_X);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "2")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.Half_2);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;
                                    break;
                                case "1x2":
                                    item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                    item.set_BetType(EnumCollection.eBetType.lX2);
                                    if (item.get_SelectedMatch().ToLower() == "1")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_1);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "x")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_X);
                                    }
                                    else if (item.get_SelectedMatch().ToLower() == "2")
                                    {
                                        item.set_BetTarget(EnumCollection.eBetTarget.FT_2);
                                    }
                                    else
                                    {
                                        flag = true;
                                    }
                                    break;
                                default:
                                    item.set_MemberName(string.Empty);
                                    break;
                            }
                            if (list2[3].ToString().Contains("Live"))
                            {
                                item.set_GameType(EnumCollection.eGameType.Running);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                                num2 = 0;
                                list5 = CommonFunction.SeperateStringBySymbol(CommonFunction.substring(Conversions.ToString(Operators.ConcatenateObject(list2[3], "#")), 0, "!", "#", ref num2).Trim(), ":");
                                if (list5.Count == 2)
                                {
                                    item.set_HomeScore((int)Math.Round(Conversion.Val(list5[0].ToString().Trim())));
                                    item.set_AwayScore((int)Math.Round(Conversion.Val(list5[1].ToString().Trim())));
                                }
                            }
                            else
                            {
                                item.set_GameType(EnumCollection.eGameType.Today);
                                string runningStatus = list2[16].ToString().Trim();
                                if (Enum.IsDefined(typeof(EnumCollection.eRunningStatus), runningStatus))
                                {
                                    item.set_RunningStatus(
                                        (EnumCollection.eRunningStatus)
                                        Enum.Parse(typeof(EnumCollection.eRunningStatus), runningStatus));
                                }
                            }
                            if (item.get_BetType() == EnumCollection.eBetType.HDP)
                            {
                                if (item.get_HDP().Length > 0)
                                {
                                    if (item.get_HDP().Substring(0, 1) == "-")
                                    {
                                        if ((item.get_BetTarget() == EnumCollection.eBetTarget.FT_Home) | (item.get_BetTarget() == EnumCollection.eBetTarget.Half_Home))
                                        {
                                            item.set_HomeColor(Color.Red);
                                            item.set_AwayColor(Color.Blue);
                                        }
                                        else
                                        {
                                            item.set_HomeColor(Color.Blue);
                                            item.set_AwayColor(Color.Red);
                                        }
                                    }
                                    else if ((item.get_BetTarget() == EnumCollection.eBetTarget.FT_Home) | (item.get_BetTarget() == EnumCollection.eBetTarget.Half_Home))
                                    {
                                        item.set_HomeColor(Color.Blue);
                                        item.set_AwayColor(Color.Red);
                                    }
                                    else
                                    {
                                        item.set_HomeColor(Color.Red);
                                        item.set_AwayColor(Color.Blue);
                                    }
                                }
                            }
                            else
                            {
                                item.set_HomeColor(Color.Blue);
                                item.set_AwayColor(Color.Blue);
                            }

                            if (string.IsNullOrEmpty(item.get_HDP()))
                            {
                                item.set_HDP("0.0");
                            }

                            item.set_HDP(SportBookFunction.ConvertHDPType(CommonFunction.TrimSymbol(item.get_HDP(), "-")));
                            if (item.get_HDP() == "0.0")
                            {
                                item.set_HomeColor(Color.Blue);
                                item.set_AwayColor(Color.Blue);
                            }
                            item.set_CreateDate(DateTime.Now);
                            item.set_MatchDate(list2[11].ToString().Trim());
                            item.set_OddsString(list2[12].ToString().Trim());
                            item.set_BetAmount(Conversions.ToString(Conversion.Val(list2[14].ToString().Trim().Replace(",", ""))));
                            /***switch (list2[13].ToString().Trim().ToLower())
                            {
                                case "h":
                                    item.set_Odds(SportBookFunction.ConvertHKToMalayOdds(item.get_Odds()));
                                    item.set_OddsType(EnumCollection.eOddsType.HK);
                                    break;

                                case "i":
                                    item.set_Odds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Odds()));
                                    item.set_OddsType(EnumCollection.eOddsType.Indo);
                                    break;

                                case "e":
                                    item.set_Odds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Odds()));
                                    item.set_OddsType(EnumCollection.eOddsType.Euro);
                                    break;
                            }***/
                            item.set_IPAddress(CommonFunction.TrimSymbol(list2[list2.Count - 1].ToString().Trim(), "'"));
                            if ((item.get_MemberName() != string.Empty) & !flag)
                            {
                                list4.Add(item);
                            }
                        }
                    }
                    return list4;
                }
                finally
                {
                    enumerator.Dispose();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateMemberBetlistFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list4;
        }
Пример #7
0
 public static MatchNew FindMatchByMatchBetFuzzyIgnoreColor(MatchBetNew new1, List<MatchNew> list1)
 {
     MatchNew new3 = new MatchNew();
     MatchNew new4 = new MatchNew();
     new1.GenerateUpperCaseInfo();
     if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT)
     {
         if (new1.get_BetType() == EnumCollection.eBetType.HDP)
         {
             foreach (MatchNew neww3 in list1)
             {
                 if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_FTHDP())))
                 {
                     return neww3;
                 }
             }
             return new4;
         }
         foreach (MatchNew neww3 in list1)
         {
             if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_FTOU())))
             {
                 return neww3;
             }
         }
         return new4;
     }
     if (new1.get_BetType() == EnumCollection.eBetType.HDP)
     {
         foreach (MatchNew neww3 in list1)
         {
             if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_HalfHDP())))
             {
                 return neww3;
             }
         }
         return new4;
     }
     foreach (MatchNew neww3 in list1)
     {
         if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_HalfOU())))
         {
             return neww3;
         }
     }
     return new4;
 }
Пример #8
0
        private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        requestUriString = new1.get_FT_HomeBetLink();
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        requestUriString = new1.get_FT_AwayBetLink();
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        requestUriString = new1.get_FT_OverBetLink();
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        requestUriString = new1.get_FT_UnderBetLink();
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        requestUriString = new1.get_Half_HomeBetLink();
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        requestUriString = new1.get_Half_AwayBetLink();
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        requestUriString = new1.get_Half_OverBetLink();
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        requestUriString = new1.get_Half_UnderBetLink();
                        break;
                }
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
                request.Timeout = 0x2710;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.KeepAlive = true;
                request.Referer = base._strRootURL + "/app/member/FT_browse/body_browse.php?uid=" + this._strUID + "&rtype=re&langx=en-us&mtype=3&delay=";
                request.AllowAutoRedirect = true;
                request.Headers["Cookie"] = base._objCookieList.ToString();
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                ProjectData.ClearProjectError();
            }
        }
Пример #9
0
        public List<MatchBetNew> GenerateMemberBetlistFromText(string text1)
        {
            IEnumerator enumerator = null;
            List<MatchBetNew> list3 = new List<MatchBetNew>();
            ArrayList list2 = new ArrayList();
            ArrayList list4 = new ArrayList();
            int num3 = 0;
            string str = "";
            string str2 = "";
            string str3 = "";
            string str4 = "";
            string str5 = "";
            int num = 0;
            int num2 = 0;
            while (num3 > -1)
            {
                str2 = CommonFunction.substring(text1, num3, "<tr bgcolor", "</tr", ref num3).Trim();
                if (str2 != string.Empty)
                {
                    list2.Add(str2);
                }
            }
            try
            {
                enumerator = list2.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    str = Conversions.ToString(enumerator.Current);
                    bool flag = false;
                    MatchBetNew item = new MatchBetNew();
                    num3 = 0;
                    str2 = CommonFunction.substring(str, num3, "<td", "<td>", "</td>", ref num3).Replace("<br>", " ").Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_BetDate(str2);
                    item.set_MemberName(CommonFunction.substring(str, num3, "nowrap\">", "</", ref num3).Trim());
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    if (base._objMemberList.get_MemberRange() == EnumCollection.eMemberRange.AllMember)
                    {
                        item.set_BetFollowMethod(base._objMemberList.get_GlobalBetFollowMethod());
                    }
                    else
                    {
                        Member member = base._objMemberList.get_Item(item.get_MemberName());
                        if (member != null)
                        {
                            item.set_BetFollowMethod(member.get_BetFollowMethod());
                        }
                        else
                        {
                            item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                        }
                    }
                    str2 = CommonFunction.substring(str, num3, "<td>", "<", ref num3).Trim().ToLower();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    switch (str2)
                    {
                        case "1st half over/under":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.OU);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "over/under":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.OU);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;

                        case "1st half asian handicap":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.HDP);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "asian handicap":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.HDP);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;

                        case "1st half 1x2":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.lX2);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "1x2":
                            item.set_GameType(EnumCollection.eGameType.Today);
                            item.set_BetType(EnumCollection.eBetType.lX2);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;

                        case "1st half in-play over/under":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.OU);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "in-play over/under":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.OU);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;

                        case "1st half in-play handicap":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.HDP);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "in-play handicap":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.HDP);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;

                        case "1st half in-play 1x2":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.lX2);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                            break;

                        case "in-play 1x2":
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            item.set_BetType(EnumCollection.eBetType.lX2);
                            item.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                            break;
                    }
                    str2 = CommonFunction.substring(str, num3, "<br>", "<", ref num3).Replace("&nbsp;", "").Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_ID(str2);
                    str2 = CommonFunction.substring(str, num3, "fontBlueSteel", ">", "<", ref num3).Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_League(str2);
                    num = 0;
                    num2 = 0;
                    if ((item.get_GameType() == EnumCollection.eGameType.Running) && (item.get_BetType() != EnumCollection.eBetType.lX2))
                    {
                        str2 = CommonFunction.substring(str, num3, "Red'>", "<", ref num3).Trim();
                        if (num3 > -1)
                        {
                            List<string> list5 = new List<string>();
                            list5 = CommonFunction.SeperateStringBySymbol2(str2, "-");
                            if (list5.Count == 2)
                            {
                                num = (int) Math.Round(Conversion.Val(list5[0].Trim()));
                                num2 = (int) Math.Round(Conversion.Val(list5[1].Trim()));
                            }
                        }
                    }
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    if ((item.get_GameType() == EnumCollection.eGameType.Running) & (item.get_BetType() != EnumCollection.eBetType.lX2))
                    {
                        str2 = CommonFunction.substring(str, num3, "span>", "<", ref num3).Replace("&nbsp;", "").Trim();
                    }
                    else
                    {
                        str2 = CommonFunction.substring(str, num3, "span>", ">", "<", ref num3).Replace("&nbsp;", "").Trim();
                    }
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    str4 = str2;
                    if (item.get_BetType() != EnumCollection.eBetType.lX2)
                    {
                        str2 = CommonFunction.substring(str, num3, ">", "<", ref num3).Trim();
                        if (str2 != "vs")
                        {
                            item.set_HDP(str2.Replace("/", "-"));
                        }
                    }
                    else
                    {
                        item.set_HDP("0.0");
                        str2 = CommonFunction.substring(str, num3, ">", "<", ref num3).Trim();
                    }
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    str2 = CommonFunction.substring(str, num3, ">", "<", ref num3).Replace("&nbsp;", "").Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    str5 = str2;
                    MatchNew new3 = null;
                    new3 = SpiderFunction.FindMatchNewByTeamName(str4, str5, this._objMatchNameList);
                    if (new3 != null)
                    {
                        item.set_HomeName(new3.get_HomeName());
                        item.set_AwayName(new3.get_AwayName());
                    }
                    else
                    {
                        item.set_HomeName(str4);
                        item.set_AwayName(str5);
                    }
                    str2 = CommonFunction.substring(str, num3, "fontRedDark'>", "</span>", ref num3).Trim();
                    if (item.get_BetType() == EnumCollection.eBetType.lX2)
                    {
                        str2 = str2.Replace("(A)", "(H)");
                        int num4 = 0;
                        str3 = CommonFunction.substring("*" + str2, 0, "*", "(H)", ref num4);
                        if (str3 != string.Empty)
                        {
                            str2 = str3;
                        }
                    }
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    if (item.get_BetType() == EnumCollection.eBetType.OU)
                    {
                        List<string> list6 = CommonFunction.SeperateStringBySymbol2(str2, "&nbsp;");
                        if (list6.Count == 2)
                        {
                            item.set_SelectedMatch(list6[0].Trim());
                            item.set_HDP(list6[1].Replace("/", "-"));
                        }
                    }
                    else
                    {
                        item.set_SelectedMatch(str2);
                    }
                    str2 = CommonFunction.substring(str, num3, "'>", "<", ref num3).Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_OddsString(str2);
                    str2 = CommonFunction.substring(str, num3, "nowrap\">", "<", ref num3).Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_BetAmount(str2.Replace(",", ""));
                    str2 = CommonFunction.substring(str, num3, "<td nowrap=\"nowrap\">", "<", ref num3).Trim();
                    if (num3 <= -1)
                    {
                        continue;
                    }
                    item.set_IPAddress(str2);
                    item.set_OddsType(EnumCollection.eOddsType.Malay);
                    item.set_HDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HDP()));
                    if (item.get_BetType() == EnumCollection.eBetType.HDP)
                    {
                        if (item.get_HDP() == "0.0")
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Blue);
                        }
                        else if (str4 == item.get_HomeName())
                        {
                            item.set_HomeColor(Color.Red);
                            item.set_AwayColor(Color.Blue);
                        }
                        else
                        {
                            item.set_HomeColor(Color.Blue);
                            item.set_AwayColor(Color.Red);
                        }
                    }
                    else
                    {
                        item.set_HomeColor(Color.Blue);
                        item.set_AwayColor(Color.Blue);
                    }
                    if (item.get_GameType() == EnumCollection.eGameType.Running)
                    {
                        if (str4 == item.get_HomeName())
                        {
                            item.set_HomeScore(num);
                            item.set_AwayScore(num2);
                        }
                        else
                        {
                            item.set_HomeScore(num2);
                            item.set_AwayScore(num);
                        }
                    }
                    if (item.get_BetCoverage() != EnumCollection.eBetCoverage.FT)
                    {
                        goto Label_098E;
                    }
                    switch (item.get_BetType())
                    {
                        case EnumCollection.eBetType.HDP:
                            if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                break;
                            }
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Away);
                            goto Label_0A78;

                        case EnumCollection.eBetType.OU:
                            if (item.get_SelectedMatch().ToLower() != "over")
                            {
                                goto Label_0962;
                            }
                            item.set_BetTarget(EnumCollection.eBetTarget.FT_Over);
                            goto Label_0A78;

                        default:
                            goto Label_0A78;
                    }
                    if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                    {
                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Home);
                    }
                    else
                    {
                        flag = true;
                    }
                    goto Label_0A78;
                Label_0962:
                    if (item.get_SelectedMatch().ToLower() == "under")
                    {
                        item.set_BetTarget(EnumCollection.eBetTarget.FT_Under);
                    }
                    else
                    {
                        flag = true;
                    }
                    goto Label_0A78;
                Label_098E:
                    switch (item.get_BetType())
                    {
                        case EnumCollection.eBetType.HDP:
                            if (item.get_SelectedMatch().ToLower() != item.get_AwayName().ToLower().Replace("(n)", "").Trim())
                            {
                                break;
                            }
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Away);
                            goto Label_0A78;

                        case EnumCollection.eBetType.OU:
                            if (item.get_SelectedMatch().ToLower() != "over")
                            {
                                goto Label_0A51;
                            }
                            item.set_BetTarget(EnumCollection.eBetTarget.Half_Over);
                            goto Label_0A78;

                        default:
                            goto Label_0A78;
                    }
                    if (item.get_SelectedMatch().ToLower() == item.get_HomeName().ToLower().Replace("(n)", "").Trim())
                    {
                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Home);
                    }
                    else
                    {
                        flag = true;
                    }
                    goto Label_0A78;
                Label_0A51:
                    if (item.get_SelectedMatch().ToLower() == "under")
                    {
                        item.set_BetTarget(EnumCollection.eBetTarget.Half_Under);
                    }
                    else
                    {
                        flag = true;
                    }
                Label_0A78:
                    item.set_CreateDate(DateTime.Now);
                    item.set_Company(base._strAgentSiteName);
                    if (!flag && ((this._isToGrab1X2Odds & (item.get_BetType() == EnumCollection.eBetType.lX2)) | (!this._isToGrab1X2Odds & (item.get_BetType() != EnumCollection.eBetType.lX2))))
                    {
                        list3.Add(item);
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            return list3;
        }
Пример #10
0
        private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str7 = "";
                string str5 = "1";
                string str6 = "1";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/MenuBet/BetSlipProc.aspx";
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                    case EnumCollection.eBetTarget.FT_Away:
                    case EnumCollection.eBetTarget.FT_Over:
                    case EnumCollection.eBetTarget.FT_Under:
                        if ((new1.get_FTHomeColor() == Color.Blue) & (new1.get_FTAwayColor() == Color.Red))
                        {
                            str5 = "0";
                        }
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                    case EnumCollection.eBetTarget.Half_Away:
                    case EnumCollection.eBetTarget.Half_Over:
                    case EnumCollection.eBetTarget.Half_Under:
                        if ((new1.get_HalfHomeColor() == Color.Blue) & (new1.get_HalfAwayColor() == Color.Red))
                        {
                            str5 = "0";
                        }
                        break;
                }
                if (new1.get_GameType() == EnumCollection.eGameType.Early)
                {
                    str6 = "2";
                }
                if (new1.get_GameType() == EnumCollection.eGameType.Running)
                {
                    switch (target1)
                    {
                        case EnumCollection.eBetTarget.FT_Home:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Away:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Over:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Under:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Home:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Away:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Over:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Under:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;
                    }
                }
                else
                {
                    switch (target1)
                    {
                        case EnumCollection.eBetTarget.FT_Home:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Away:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Over:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.FT_Under:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Home:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Away:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Over:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;

                        case EnumCollection.eBetTarget.Half_Under:
                            str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() });
                            goto Label_0B3C;
                    }
                }
            Label_0B3C:
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
                request.Timeout = 0x2710;
                request.Method = "POST";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/MenuBet/LeftMenu.aspx";
                request.ContentType = "application/x-www-form-urlencoded";
                request.ContentLength = str7.Length;
                request.KeepAlive = true;
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str7, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.ReadCallBackTicket), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true);
                base.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                ProjectData.ClearProjectError();
            }
        }
Пример #11
0
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string format = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName;
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_1:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_X:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_2:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_X:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_2:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                }
                string url = string.Format(format, str5);
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Timeout = 0x7530;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.ContentType = "application/x-www-form-urlencoded";
                //request.KeepAlive = true;

                this.WriteProgramLogger("POST: " + url);
                base._objBetListLogger.write("POST: " + str5);
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                this.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                ProjectData.ClearProjectError();
            }
        }
Пример #12
0
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                string str = "";
                string str3 = "";
                string str4 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/BetProcess_Data.aspx";
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_UnderOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_UnderOddsString();
                        str4 = "a";
                        break;
                    // add 1x2
                    case EnumCollection.eBetTarget.FT_1:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.FT_X:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2AwayOddsString().ToString();
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.FT_2:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2DrawOddsString().ToString();
                        str4 = "2";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.Half_X:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2AwayOddsString().ToString(); ;
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.Half_2:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2DrawOddsString().ToString(); ;
                        str4 = "2";
                        break;
                }
                str5 = "bp_Match=" + str + "_" + str4 + "_" + str3 + "&bp_ssport=&chk_BettingChange=4";
                // Add Andy 添加新值 2011.08.08
                StringBuilder sb = new StringBuilder(str5);
                sb.Append("&").Append(this.key);
                sb.Append("=").Append(this.value);
                str5 = sb.ToString();
                // End Andy

                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString);
                request.Timeout = 0x7530;
                request.Method = "POST";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/LeftAllInOne.aspx";
                request.ContentType = "application/x-www-form-urlencoded";
                request.ContentLength = str5.Length;

                base._objBetListLogger.write("POST: " + str5);
                this.WriteProgramLogger("TWESTESST2.0: " + request.Address.ToString());
                Stream stream = request.GetRequestStream();
                byte[] bytes = Encoding.UTF8.GetBytes(str5);
                stream.Write(bytes, 0, str5.Length);
                stream.Close();
                this.WriteProgramLogger("TWESTESST2.1: " + request.Address.ToString());

                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                base.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                ProjectData.ClearProjectError();
            }
        }
Пример #13
0
 private int GetIndexByMatch(MatchBetNew new1)
 {
     int num2;
     int num3 = -1;
     if (this._intType != 1)
     {
         int num6 = this._objList.Count - 1;
         for (num2 = 0; num2 <= num6; num2++)
         {
             if ((this._objList[num2].get_HomeName() == new1.get_HomeName()) & (this._objList[num2].get_AwayName() == new1.get_AwayName()))
             {
                 num3 = num2;
                 break;
             }
         }
     }
     else
     {
         int num4 = this._objList.Count - 1;
         for (num2 = 0; num2 <= num4; num2++)
         {
             if (((((((this._objList[num2].get_HomeName() == new1.get_HomeName()) & (this._objList[num2].get_AwayName() == new1.get_AwayName())) & (this._objList[num2].get_BetCoverage() == new1.get_BetCoverage())) & (this._objList[num2].get_BetType() == new1.get_BetType())) & (this._objList[num2].get_HomeColor() == new1.get_HomeColor())) & (this._objList[num2].get_AwayColor() == new1.get_AwayColor())) & (this._objList[num2].get_HDP() == new1.get_HDP()))
             {
                 num3 = num2;
                 break;
             }
         }
         if (((num3 == -1) & (new1.get_HomeMatchingID() > 0)) & (new1.get_AwayMatchingID() > 0))
         {
             int num5 = this._objList.Count - 1;
             for (num2 = 0; num2 <= num5; num2++)
             {
                 if (((((((this._objList[num2].get_HomeMatchingID() == new1.get_HomeMatchingID()) & (this._objList[num2].get_AwayMatchingID() == new1.get_AwayMatchingID())) & (this._objList[num2].get_BetCoverage() == new1.get_BetCoverage())) & (this._objList[num2].get_BetType() == new1.get_BetType())) & (this._objList[num2].get_HomeColor() == new1.get_HomeColor())) & (this._objList[num2].get_AwayColor() == new1.get_AwayColor())) & (this._objList[num2].get_HDP() == new1.get_HDP()))
                 {
                     return num2;
                 }
             }
         }
         return num3;
     }
     if (((num3 == -1) & (new1.get_HomeMatchingID() > 0)) & (new1.get_AwayMatchingID() > 0))
     {
         int num7 = this._objList.Count - 1;
         for (num2 = 0; num2 <= num7; num2++)
         {
             if ((this._objList[num2].get_HomeMatchingID() == new1.get_HomeMatchingID()) & (this._objList[num2].get_AwayMatchingID() == new1.get_AwayMatchingID()))
             {
                 return num2;
             }
         }
     }
     return num3;
 }
Пример #14
0
        private void GetTicketAndBetFromAgent(MatchBetNew new1, MatchNew new4, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/english/index.php?p=bettingback&b=soccer|";
                if (new1.get_GameType() == EnumCollection.eGameType.Running)
                {
                    str5 = "r";
                }
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|a||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|b||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|over||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|under||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|a||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|b||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|over||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|under||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;
                }
                new3 = new1;
                new2 = new4.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
                request.Timeout = 0x2710;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/english/index.php?p=user_main";
                request.ContentLength = 0L;
                request.KeepAlive = true;
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, "", num1, new3.get_BetType(), target1, new MatchNew(), new3, new4, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new4, new2, null);
                ProjectData.ClearProjectError();
            }
        }
Пример #15
0
        /// <summary>
        /// 保存Player下注信息
        /// </summary>
        /// <param name="matchBetNew">新的下注</param>
        /// <returns>保存是否成功</returns>
        public static bool SavePlayerBetInfo(PlayerBet playerBet, MatchBetNew matchBetNew)
        {
            bool isSuccess = false;
            try
            {
                playerBet.Ghost = GetGhostByGhostName(matchBetNew.get_MemberName(), matchBetNew.get_Company());
                playerBet.Player = GetPlayerByPlayerName(playerBet.Player.LoginName);
                playerBet.MatchId = matchBetNew.getMatchID();
                playerBet.LeagueName = matchBetNew.get_League();
                playerBet.SelectedMatch = matchBetNew.get_SelectedMatch();
                playerBet.MatchType = matchBetNew.get_MatchType();
                playerBet.HomeName = matchBetNew.get_HomeName();
                playerBet.AwayName = matchBetNew.get_AwayName();
                playerBet.MatchDate = matchBetNew.get_MatchDate();
                playerBet.betTime = matchBetNew.get_BetDate();
                playerBet.BetCoverage = System.Convert.ToString(matchBetNew.get_BetCoverage());
                playerBet.BetType = System.Convert.ToString(matchBetNew.get_BetType());
                playerBet.Status = System.Convert.ToString(matchBetNew.get_RunningStatus()) + "<br/>" + matchBetNew.get_IPAddress();
                playerBet.SportType = System.Convert.ToString(matchBetNew.get_SportType());
                if (string.IsNullOrEmpty(matchBetNew.HDPValue))
                {
                    matchBetNew.HDPValue = "0.0";
                }
                playerBet.HDP = Double.Parse(matchBetNew.HDPValue);
                playerBet.Odds = matchBetNew.get_Odds();
                playerBet.OddsType = System.Convert.ToString(matchBetNew.get_OddsType());
                playerBet.Amount = int.Parse(matchBetNew.get_BetAmount());
                playerBet.WinValue = 0;
                playerBet.IsOutstanding = true;

                // 创建下注数据访问对象
                BetService ghostBetService = new BetService();
                isSuccess = ghostBetService.AddPlayerBetInfo(playerBet);
            }
            catch (Exception e)
            {

                throw;
            }

            return isSuccess;
        }
Пример #16
0
        /// <summary>
        /// 保存Ghost下注信息
        /// </summary>
        /// <param name="matchBetNew">新的下注</param>
        /// <returns>保存是否成功</returns>
        public static bool SaveGhostBetInfo(MatchBetNew matchBetNew)
        {
            bool isSuccess = false;
            try
            {
                // 创建gosht下注对象
                GhostBet ghostBet = new GhostBet();
                Ghost ghost = GetGhostByGhostName(matchBetNew.get_MemberName(), matchBetNew.get_Company());
                ghostBet.Ghost = ghost;
                ghostBet.MatchId = matchBetNew.getMatchID();
                ghostBet.LeagueName = matchBetNew.get_League();
                ghostBet.SelectedMatch = matchBetNew.get_SelectedMatch();
                ghostBet.MatchType = matchBetNew.get_MatchType();
                ghostBet.HomeName = matchBetNew.get_HomeName();
                ghostBet.AwayName = matchBetNew.get_AwayName();
                ghostBet.betTime = matchBetNew.get_BetDate();
                ghostBet.BetCoverage = System.Convert.ToString(matchBetNew.get_BetCoverage());
                ghostBet.BetType = System.Convert.ToString(matchBetNew.get_BetType());
                ghostBet.Status = System.Convert.ToString(matchBetNew.get_RunningStatus()) + "<br/>" + matchBetNew.get_IPAddress();
                ghostBet.SportType = System.Convert.ToString(matchBetNew.get_SportType());
                if (string.IsNullOrEmpty(matchBetNew.HDPValue))
                {
                    matchBetNew.HDPValue = "0.0";
                }
                ghostBet.HDP = float.Parse(matchBetNew.HDPValue);
                ghostBet.Odds = (float)matchBetNew.get_Odds();
                ghostBet.Amount = int.Parse(matchBetNew.get_BetAmount());
                ghostBet.WinValue = 0;
                ghostBet.IsOutstanding = true;

                // 创建下注数据访问对象
                BetService ghostBetService = new BetService();
                isSuccess = ghostBetService.AddGhostBetInfo(ghostBet);
            }
            catch (Exception e)
            {

            }

            return isSuccess;
        }