Beispiel #1
0
 public void ReadFromFile(string text1)
 {
     XmlReader reader = null;
     this._objDefaultWebsiteBetStyleList.get_SourceList().Clear();
     this._objMemberList.Clear();
     reader = new XmlTextReader(text1);
     while (reader.Read())
     {
         WebsiteBetStyle style;
         if (reader.NodeType != XmlNodeType.Element)
         {
             continue;
         }
         string str2 = reader.Name.ToUpper();
         if (str2 == "WebsiteBetStyle".ToUpper())
         {
             if (reader.AttributeCount <= 0)
             {
                 continue;
             }
             style = new WebsiteBetStyle();
             while (reader.MoveToNextAttribute())
             {
                 string str3 = reader.Name.ToUpper();
                 if (str3 == "Website".ToUpper())
                 {
                     style.set_Website(reader.Value);
                 }
                 else
                 {
                     if (str3 == "BetStyle".ToUpper())
                     {
                         style.set_BetStyle((EnumCollection.eBetAmountStyle) ((int) Math.Round(Conversion.Val(reader.Value))));
                         continue;
                     }
                     if (str3 == "BetValue".ToUpper())
                     {
                         style.set_BetValue((int) Math.Round(Conversion.Val(reader.Value)));
                     }
                 }
             }
             this._objDefaultWebsiteBetStyleList.get_SourceList().Add(style);
             continue;
         }
         if (str2 == "Range".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "MemberRange".ToUpper())
                     {
                         this._objMemberRange = (EnumCollection.eMemberRange) ((int) Math.Round(Conversion.Val(reader.Value)));
                     }
                 }
             }
             continue;
         }
         if (str2 == "GlobalFollowOddsOption".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     string str5 = reader.Name.ToUpper();
                     if (str5 == "FollowOddsOption".ToUpper())
                     {
                         this._objGlobalFollowOddsOption.set_FollowOddsOption((EnumCollection.eFollowOddsOption) ((int) Math.Round(Conversion.Val(reader.Value))));
                     }
                     else if (str5 == "FollowOddsOptionValue".ToUpper())
                     {
                         this._objGlobalFollowOddsOption.set_OddsValue(Conversion.Val(reader.Value));
                     }
                 }
             }
             continue;
         }
         if (str2 == "GlobalBetFollowMethod".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "BetFollowMethod".ToUpper())
                     {
                         this._objGlobalBetFollowMethod = (EnumCollection.eBetFollowMethod) ((int) Math.Round(Conversion.Val(reader.Value)));
                     }
                 }
             }
             continue;
         }
         if (str2 == "GlobalMinFollowLimit".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "MinFollowLimit".ToUpper())
                     {
                         this._decGlobalMinFollowLimit = new decimal(Conversion.Val(reader.Value));
                     }
                 }
             }
             continue;
         }
         if (str2 == "GlobalMaxFollowLimit".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "MaxFollowLimit".ToUpper())
                     {
                         this._decGlobalMaxFollowLimit = new decimal(Conversion.Val(reader.Value));
                     }
                 }
             }
             continue;
         }
         if (str2 == "IsGlobalFollowToSameSportBook".ToUpper())
         {
             if (reader.AttributeCount > 0)
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "IsFollowToSameSportBook".ToUpper())
                     {
                         this._isGlobalFollowToSameSportBook = Conversion.Val(reader.Value) != 0.0;
                     }
                 }
             }
             continue;
         }
         if (str2 == "GlobalBetTargetCollection".ToUpper())
         {
             if (reader.AttributeCount <= 0)
             {
                 continue;
             }
             while (reader.MoveToNextAttribute())
             {
                 string str10 = reader.Name.ToUpper();
                 if (str10 == "IsToBetAll".ToUpper())
                 {
                     this._objGlobalBetTargetCol.IsToBetAll = Conversion.Val(reader.Value) != 0.0;
                 }
                 else
                 {
                     if (str10 == "IsToBetFTPut".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetFTPut = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetFTEat".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetFTEat = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetFTOver".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetFTOver = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetFTUnder".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetFTUnder = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetHalfPut".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetHalfPut = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetHalfEat".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetHalfEat = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetHalfOver".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetHalfOver = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str10 == "IsToBetHalfUnder".ToUpper())
                     {
                         this._objGlobalBetTargetCol.IsToBetHalfUnder = Conversion.Val(reader.Value) != 0.0;
                     }
                 }
             }
             continue;
         }
         if (str2 == "Member".ToUpper())
         {
             if (reader.AttributeCount <= 0)
             {
                 continue;
             }
             Member item = new Member();
             while (reader.MoveToNextAttribute())
             {
                 string str11 = reader.Name.ToUpper();
                 if (str11 == "FollowTarget".ToUpper())
                 {
                     item.set_FollowTarget((EnumCollection.eFollowTarget) ((int) Math.Round(Conversion.Val(reader.Value))));
                 }
                 else
                 {
                     if (str11 == "Name".ToUpper())
                     {
                         item.set_Name(reader.Value);
                         continue;
                     }
                     if (str11 == "BetFollowMethod".ToUpper())
                     {
                         item.set_BetFollowMethod((EnumCollection.eBetFollowMethod) ((int) Math.Round(Conversion.Val(reader.Value))));
                         continue;
                     }
                     if (str11 == "MinFollowLimit".ToUpper())
                     {
                         item.set_MinFollowLimit(new decimal(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str11 == "MaxFollowLimit".ToUpper())
                     {
                         item.set_MaxFollowLimit(new decimal(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str11 == "IsFollowToSameSportBook".ToUpper())
                     {
                         item.set_IsFollowToSameSportBook(Conversion.Val(reader.Value) != 0.0);
                         continue;
                     }
                     if (str11 == "AgentFollowOddsOptionType".ToUpper())
                     {
                         item.get_AgentFollowOddsOpt().set_FollowOddsOption((EnumCollection.eFollowOddsOption) ((int) Math.Round(Conversion.Val(reader.Value))));
                         if (!this._isToShowFollowToSameSportBook)
                         {
                             item.get_AgentFollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.None);
                         }
                         continue;
                     }
                     if (str11 == "AgentFollowOddsOptionValue".ToUpper())
                     {
                         item.get_AgentFollowOddsOpt().set_OddsValue(Conversions.ToDouble(reader.Value));
                         continue;
                     }
                     if (str11 == "FollowOddsOptionType".ToUpper())
                     {
                         item.get_FollowOddsOpt().set_FollowOddsOption((EnumCollection.eFollowOddsOption) ((int) Math.Round(Conversion.Val(reader.Value))));
                         continue;
                     }
                     if (str11 == "FollowOddsOptionValue".ToUpper())
                     {
                         item.get_FollowOddsOpt().set_OddsValue(Conversions.ToDouble(reader.Value));
                         continue;
                     }
                     if (str11 == "IsToBetAll".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetAll = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetFTPut".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetFTPut = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetFTEat".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetFTEat = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetFTOver".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetFTOver = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetFTUnder".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetFTUnder = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetHalfPut".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetHalfPut = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetHalfEat".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetHalfEat = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetHalfOver".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetHalfOver = Conversion.Val(reader.Value) != 0.0;
                         continue;
                     }
                     if (str11 == "IsToBetHalfUnder".ToUpper())
                     {
                         item.get_BetTargetCol().IsToBetHalfUnder = Conversion.Val(reader.Value) != 0.0;
                     }
                 }
             }
             this._objMemberList.Add(item);
             continue;
         }
         if ((str2 == "MemberWebsiteBetStyle".ToUpper()) && (reader.AttributeCount > 0))
         {
             style = new WebsiteBetStyle();
             while (reader.MoveToNextAttribute())
             {
                 string str12 = reader.Name.ToUpper();
                 if (str12 == "Website".ToUpper())
                 {
                     style.set_Website(reader.Value);
                 }
                 else
                 {
                     if (str12 == "BetStyle".ToUpper())
                     {
                         style.set_BetStyle((EnumCollection.eBetAmountStyle) ((int) Math.Round(Conversion.Val(reader.Value))));
                         continue;
                     }
                     if (str12 == "BetValue".ToUpper())
                     {
                         style.set_BetValue((int) Math.Round(Conversion.Val(reader.Value)));
                     }
                 }
             }
             this._objMemberList[this._objMemberList.Count - 1].get_WebsiteBetStyleList().get_SourceList().Add(style);
         }
     }
     this.AddRemoveAllMemberWebsiteList();
     reader.Close();
     this.ForceWebsiteBetStyleToFixed();
 }
Beispiel #2
0
        public void ImportFromDataGridView(ref DataGridView viewRef1)
        {
            List<Member> list = new List<Member>();
            EnumCollection.eBetAmountStyle @fixed = EnumCollection.eBetAmountStyle.Fixed;
            int num2 = 0;
            int num4 = 0;
            int num5 = 0;
            int num6 = 0;
            int num7 = 0;
            int num3 = 0;
            if (this._isToShowFollowTarget)
            {
                num4 = 1;
            }
            if (this._isToShowBetTargetCollection)
            {
                num5 = 1;
            }
            if (this._isToShowFollowToSameSportBook)
            {
                num6 = 1;
                num3 = 2;
            }
            if (this._isToShowMaxFollowLimit)
            {
                num7 = 1;
            }
            int num9 = viewRef1.Rows.Count - 1;
            for (int i = 0; i <= num9; i++)
            {
                Member item = new Member();
                if (viewRef1.Rows[i].Cells[0 + num4].Value != null)
                {
                    item.set_Name(viewRef1.Rows[i].Cells[0 + num4].Value.ToString().Trim());
                    if (this._isToShowFollowTarget)
                    {
                        if (viewRef1.Rows[i].Cells[0].Value != null)
                        {
                            switch (viewRef1.Rows[i].Cells[0].Value.ToString())
                            {
                                case "Member Name":
                                    item.set_FollowTarget(EnumCollection.eFollowTarget.MemberName);
                                    break;

                                case "Client Name":
                                    item.set_FollowTarget(EnumCollection.eFollowTarget.ClientName);
                                    break;

                                case "IP Address":
                                    item.set_FollowTarget(EnumCollection.eFollowTarget.IPAddress);
                                    break;
                            }
                        }
                        else
                        {
                            item.set_FollowTarget(EnumCollection.eFollowTarget.MemberName);
                        }
                    }
                    else
                    {
                        item.set_FollowTarget(EnumCollection.eFollowTarget.MemberName);
                    }
                    if (viewRef1.Rows[i].Cells[1 + num4].Value != null)
                    {
                        item.set_MinFollowLimit(new decimal(Conversion.Val(RuntimeHelpers.GetObjectValue(viewRef1.Rows[i].Cells[1 + num4].Value))));
                    }
                    if (this._isToShowMaxFollowLimit && (viewRef1.Rows[i].Cells[2 + num4].Value != null))
                    {
                        item.set_MaxFollowLimit(new decimal(Conversion.Val(RuntimeHelpers.GetObjectValue(viewRef1.Rows[i].Cells[2 + num4].Value))));
                    }
                    if (viewRef1.Rows[i].Cells[(2 + num4) + num7].Value != null)
                    {
                        if (viewRef1.Rows[i].Cells[(2 + num4) + num7].Value.ToString() == "Normal")
                        {
                            item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                        }
                        else
                        {
                            item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Opposite);
                        }
                    }
                    else
                    {
                        item.set_BetFollowMethod(EnumCollection.eBetFollowMethod.Normal);
                    }
                    if (this._isToShowBetTargetCollection)
                    {
                        if (viewRef1.Rows[i].Cells[(3 + num4) + num7].Value != null)
                        {
                            item.get_BetTargetCol().FromString(Conversions.ToString(viewRef1.Rows[i].Cells[(3 + num4) + num7].Value));
                        }
                        else
                        {
                            item.get_BetTargetCol().FromString("ALL");
                        }
                    }
                    if (viewRef1.Rows[i].Cells[((3 + num4) + num5) + num7].Value != null)
                    {
                        object left = viewRef1.Rows[i].Cells[((3 + num4) + num5) + num7].Value;
                        if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(left, "Stop Bet If Odds <", false))
                        {
                            item.get_FollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.HaltIfOddsLessThan);
                        }
                        else if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(left, "Stop Bet If Odds Different >", false))
                        {
                            item.get_FollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.HaltIfOddsDifferentMoreThan);
                        }
                        else if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(left, "None", false))
                        {
                            item.get_FollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.None);
                        }
                    }
                    else
                    {
                        item.get_FollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.None);
                    }
                    if (viewRef1.Rows[i].Cells[((4 + num4) + num5) + num7].Value != null)
                    {
                        item.get_FollowOddsOpt().set_OddsValue(Conversion.Val(RuntimeHelpers.GetObjectValue(viewRef1.Rows[i].Cells[((4 + num4) + num5) + num7].Value)));
                    }
                    if (this._isToShowFollowToSameSportBook)
                    {
                        if (viewRef1.Rows[i].Cells[((5 + num4) + num5) + num7].Value != null)
                        {
                            object obj3 = viewRef1.Rows[i].Cells[((5 + num4) + num5) + num7].Value;
                            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(obj3, "Stop Bet If Agent Odds <", false))
                            {
                                item.get_AgentFollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.HaltIfAgentOddsLessThan);
                            }
                            else if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(obj3, "None", false))
                            {
                                item.get_AgentFollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.None);
                            }
                        }
                        else
                        {
                            item.get_AgentFollowOddsOpt().set_FollowOddsOption(EnumCollection.eFollowOddsOption.None);
                        }
                        if (viewRef1.Rows[i].Cells[((6 + num4) + num5) + num7].Value != null)
                        {
                            item.get_AgentFollowOddsOpt().set_OddsValue(Conversion.Val(RuntimeHelpers.GetObjectValue(viewRef1.Rows[i].Cells[((6 + num4) + num5) + num7].Value)));
                        }
                        if (viewRef1.Rows[i].Cells[((7 + num4) + num5) + num7].Value != null)
                        {
                            item.set_IsFollowToSameSportBook(Conversion.Val(RuntimeHelpers.GetObjectValue(viewRef1.Rows[i].Cells[((7 + num4) + num5) + num7].Value)) != 0.0);
                        }
                        else
                        {
                            item.set_IsFollowToSameSportBook(false);
                        }
                    }
                    int num10 = viewRef1.Columns.Count - 1;
                    for (int j = ((((5 + num4) + num5) + num6) + num3) + num7; j <= num10; j += 2)
                    {
                        if (viewRef1.Rows[i].Cells[j].Value != null)
                        {
                            switch (viewRef1.Rows[i].Cells[j].Value.ToString())
                            {
                                case "Fixed $":
                                    @fixed = EnumCollection.eBetAmountStyle.Fixed;
                                    break;

                                case "Max Bet":
                                    @fixed = EnumCollection.eBetAmountStyle.MaxBet;
                                    break;

                                case "Percent %":
                                    @fixed = EnumCollection.eBetAmountStyle.Percent;
                                    break;

                                case "Indo Special":
                                    @fixed = EnumCollection.eBetAmountStyle.IndoSpecial;
                                    break;

                                case "None":
                                    @fixed = EnumCollection.eBetAmountStyle.None;
                                    break;
                            }
                        }
                        else
                        {
                            @fixed = EnumCollection.eBetAmountStyle.None;
                        }
                        if (viewRef1.Rows[i].Cells[j + 1].Value != null)
                        {
                            num2 = (int) Math.Round(Conversion.Val(viewRef1.Rows[i].Cells[j + 1].Value.ToString().Replace("$", "").Replace("-", "").Replace("%", "")));
                        }
                        else
                        {
                            num2 = 0;
                        }
                        item.get_WebsiteBetStyleList().get_SourceList().Add(new WebsiteBetStyle(viewRef1.Columns[j].Name.Substring(0, viewRef1.Columns[j].Name.Length - 1), @fixed, num2));
                    }
                    list.Add(item);
                }
            }
            this._objMemberList = list;
            this.ForceWebsiteBetStyleToFixed();
        }