예제 #1
0
파일: BF.xaml.cs 프로젝트: ichari/ichari
        //处理按钮------------------------------
        private void btnProcess_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            ListResult.Clear();

            var selfcols = DataGrid1.Columns[0];//第1列 是首次末的按钮

            List<Netball> NetBall = DataGrid1.ItemsSource as List<Netball>;

            string GameTypeCount = this.tbGameType1.Text.Substring(1, 1).ToString();//几串几,数字
            if (GameTypeCount[0] > "3"[0]) { GameTypeCount = "3"; }

            List<string[]> List = new List<string[]>();//数组集合           

            foreach (var item in DataGrid1.ItemsSource) //遍历第1列
            {
                string TempStr = string.Empty;
                var cells = selfcols.GetCellContent(item);
                if (cells != null)
                {
                    Grid Grid = cells as Grid;

                    StackPanel Sp = Grid.Children[0] as StackPanel;

                    StackPanel Sp1 = Sp.Children[1] as StackPanel;

                    foreach (Button button1 in (Sp1.Children[0] as StackPanel).Children)
                    {
                        SolidColorBrush b_Brush1 = (SolidColorBrush)(button1.Background);
                        if (b_Brush1.Color.ToString() == "#FFFF0000")
                        {
                            TempStr += button1.Content.ToString() + ",";
                        }
                    }

                    foreach (Button button2 in (Sp1.Children[1] as StackPanel).Children)
                    {
                        SolidColorBrush b_Brush2 = (SolidColorBrush)(button2.Background);
                        if (b_Brush2.Color.ToString() == "#FFFF0000")
                        {
                            TempStr += button2.Content.ToString() + ",";
                        }
                    }

                    foreach (Button button3 in (Sp1.Children[2] as StackPanel).Children)
                    {
                        SolidColorBrush b_Brush3 = (SolidColorBrush)(button3.Background);
                        if (b_Brush3.Color.ToString() == "#FFFF0000")
                        {
                            TempStr += button3.Content.ToString() + ",";
                        }
                    }

                    TempStr += "**";

                    string[] arr = TempStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    List.Add(arr);
                }
            }


            if (this.spCondition.Children.Count == 0)//没有设置筛选条件
            {
                MessageBox.Show("还没有设置筛选条件!");
            }
            else
            {
                GetList(List, "", List.Count - 1);//递归方法,获取未处理前得全部数组               

                if (GameTypeCount == List.Count.ToString()) //默认玩法 n串1,n就等于比赛场次
                {
                    string Reg2 = @"\*\*";
                    ListResult = ListResult.FindAll(t => !Regex.Match(t, Reg2).Success);
                }
                else if (ConvertInt(GameTypeCount) < List.Count)
                {
                    int Difference = List.Count - int.Parse(GameTypeCount);

                    ListResult = ListResult.FindAll(t => t.Split(new string[] { "**" }, StringSplitOptions.None).Length == Difference + 1);
                }
                else
                {
                    MessageBox.Show("玩法选择错误!");
                    return;
                }

                List<string> TempList = new List<string>();

                string ProcessType = string.Empty;//处理类型                
                string TempStr = string.Empty;

                for (int i = 0; i < this.spCondition.Children.Count; i++)
                {
                    StackPanel StackPanel = this.spCondition.Children[i] as StackPanel;

                    ProcessType = (StackPanel.Children[0] as TextBox).Text.ToString();

                    int Min = 0;
                    int Max = 0;

                    double MinOdds = 0.00;
                    double MaxOdds = 0.00;

                    string term = string.Empty;

                    switch (ProcessType)
                    {
                        case "1"://常规过滤和首次末过滤的所有过滤条件
                            Min = int.Parse((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = int.Parse((StackPanel.Children[4] as ComboBox).SelectedItem.ToString());

                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(4, TempStr.Length - 8);
                            break;
                        case "2"://点击指数过滤的(指数和、指数积)                           
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[6] as TextBox).Text, out MaxOdds);

                            TempStr = (StackPanel.Children[5] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, 3);
                            break;
                        case "3"://点击指数过滤的(奖金范围)
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[4] as TextBox).Text, out MaxOdds);
                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(3, TempStr.Length - 7);

                            break;
                        case "4"://点击指数过滤的(最低SP命中,最高SP命中)
                            Min = int.Parse((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = int.Parse((StackPanel.Children[6] as ComboBox).SelectedItem.ToString());
                            TempStr = (StackPanel.Children[5] as TextBlock).Text;

                            TempStr = TempStr.Substring(0, TempStr.Length - 4);
                            break;
                        case "5"://排序截取的(赔率高到低,赔率低到高)
                            Min = int.Parse((StackPanel.Children[4] as TextBox).Text);
                            Max = int.Parse((StackPanel.Children[6] as TextBox).Text);
                            TempStr = (StackPanel.Children[3] as TextBlock).Text;

                            TempStr = TempStr.Substring(0, TempStr.Length - 1);
                            break;
                        case "6"://范围截取的(随机截取,奖金最高,概率最高)
                            Min = int.Parse((StackPanel.Children[3] as TextBox).Text);

                            TempStr = (StackPanel.Children[2] as TextBlock).Text;
                            break;

                        case "7"://集合过滤的(命中场次,冷门过滤,叠加过滤)
                            term = (StackPanel.Children[5] as TextBox).Text;
                            TempStr = (StackPanel.Children[2] as TextBlock).Text;
                            break;
                    }

                    List<string> TempListStr = new List<string>();

                    //筛选的条件不同,筛选不同的方法
                    if (i == 0)
                    {
                        TempList = ListResult;
                    }

                    #region 根据过滤的条件不同,选择不同的过滤方法

                    switch (TempStr)
                    {
                        case "0的个数":
                            TempListStr = GetZeroCounts(Min, Max, "0", TempList);
                            TempList = TempListStr;
                            break;
                        case "1的个数":
                            TempListStr = GetZeroCounts(Min, Max, "1", TempList);
                            TempList = TempListStr;
                            break;
                        case "2的个数":
                            TempListStr = GetZeroCounts(Min, Max, "2", TempList);
                            TempList = TempListStr;
                            break;
                        case "3的个数":
                            TempListStr = GetZeroCounts(Min, Max, "3", TempList);
                            TempList = TempListStr;
                            break;
                        case "4的个数":
                            TempListStr = GetZeroCounts(Min, Max, "4", TempList);
                            TempList = TempListStr;
                            break;
                        case "0的最大连续":
                            TempListStr = GetMaxLian(Min, Max, '0', TempList);
                            TempList = TempListStr;
                            break;
                        case "1的最大连续":
                            TempListStr = GetMaxLian(Min, Max, '1', TempList);
                            TempList = TempListStr;
                            break;
                        case "2的最大连续":
                            TempListStr = GetMaxLian(Min, Max, '2', TempList);
                            TempList = TempListStr;
                            break;
                        case "3的最大连续":
                            TempListStr = GetMaxLian(Min, Max, '3', TempList);
                            TempList = TempListStr;
                            break;
                        case "4的最大连续":
                            TempListStr = GetMaxLian(Min, Max, '4', TempList);
                            TempList = TempListStr;
                            break;
                        case "主胜场数":
                            TempListStr = GetMainWin(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "主平场数":
                            TempListStr = GetMainLevel(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "主负场数":
                            TempListStr = GetMainLose(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "大球个数":
                            TempListStr = GetBigBall(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "小球个数":
                            TempListStr = GetSmallBall(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "和值区间":
                            TempListStr = GetSumValue(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "断点区间":
                            TempListStr = GetBreakPoint(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "指数和":
                            TempListStr = GetIndexSum(MinOdds, MaxOdds, TempList);
                            TempList = TempListStr;
                            break;
                        case "指数积":
                            TempListStr = GetIndexProduct(MinOdds, MaxOdds, TempList);
                            TempList = TempListStr;
                            break;
                        case "奖金范围":
                            TempListStr = GetIndexBonus(MinOdds, MaxOdds, TempList);
                            TempList = TempListStr;
                            break;
                        case "最低SP命中":
                            TempListStr = GetMinSP(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "最高SP命中":
                            TempListStr = GetMaxSP(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "赔率高到低排序取第":
                            TempListStr = GetOrder(Min, Max, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "赔率底到高排序取第":
                            TempListStr = GetOrder(Min, Max, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "随机截取":
                            TempListStr = GetRangeRandom(Min, TempList);
                            TempList = TempListStr;
                            break;
                        case "奖金最高":
                            TempListStr = GetRangeBonus(Min, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "概率最高":
                            TempListStr = GetRangeBonus(Min, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "命中场次":
                        case "冷门过滤":
                        case "叠加过滤":
                            TempListStr = GetGoupHitTarget(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "比分个数":
                            TempListStr = GetScoreNumber(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组主胜":
                        case "分组主平":
                        case "分组主负":
                        case "分组大球":
                        case "分组小球":
                        case "分组断点":
                        case "分组和值":
                        case "分组连号":
                        case "分组最长连号":
                        case "进球差值":
                            TempListStr = GetGoupNumbers(term, TempStr, TempList);
                            TempList = TempListStr;
                            break;
                    }
                    #endregion
                }

                #region 处理后的数据和分页

                Num = new List<LotteryNum>();

                for (int j = 0; j < TempList.Count; j++)
                {
                    LotteryNum LotteryNum = new LotteryNum();
                    LotteryNum.Id = j + 1;
                    LotteryNum.LotteryNums = TempList[j].ToString();
                    Num.Add(LotteryNum);
                }

                //分页控件需要的
                PagedCollectionView view = new PagedCollectionView(Num);

                this.DataGrid2.ItemsSource = view;
                DataPager1.PageSize = 4;
                DataPager1.Source = view;
                #endregion

                this.tbCathectic.Text = TempList.Count.ToString();
                this.tbCathecticSum.Text = (TempList.Count * 2).ToString();
            }
        }
예제 #2
0
파일: BQC.xaml.cs 프로젝트: ichari/ichari
        //过滤处理
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            ListResult.Clear();

            var selfcols = DataGrid1.Columns[3];//第三列 是首次末的按钮

            List<Netball> NetBall = DataGrid1.ItemsSource as List<Netball>;

            string GameTypeCount = "";

            if (!string.IsNullOrEmpty(tbGameType1.Text))
            {
                GameTypeCount = this.tbGameType1.Text.Substring(1, 1).ToString();//几串几,数字
            }

            List<string[]> List = new List<string[]>();//数组集合

            foreach (var item in DataGrid1.ItemsSource) //遍历第三列
            {
                var cells = selfcols.GetCellContent(item);
                if (cells != null)
                {
                    Grid Grid = cells as Grid;

                    Button bt = new Button();

                    string TempStr = "";

                    for (int i = 0; i < 9; i++)
                    {
                        bt = (Button)Grid.Children[i];
                        SolidColorBrush b_Brush = (SolidColorBrush)(bt.Background);
                        if (b_Brush.Color.ToString() == "#FFFF0000")
                        {
                            TempStr += bt.Content.ToString() + ",";
                        }
                    }

                    TempStr += "*";

                    string[] arr = TempStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    List.Add(arr);
                }
            }


            if (this.spCondition.Children.Count == 0)//没有设置筛选条件
            {
                MessageBox.Show("还没有设置筛选条件!");
            }
            else
            {
                GetList(List, "", List.Count - 1);//递归方法,获取未处理前得全部数组

                if (GameTypeCount == List.Count.ToString()) //默认玩法 n串1,n就等于比赛场次
                {
                    string Reg2 = @"\*";
                    ListResult = ListResult.FindAll(t => !Regex.Match(t, Reg2).Success);
                }
                else
                {
                    int Difference = List.Count - int.Parse(GameTypeCount);

                    string Reg3 = @"\*{" + Difference + "}";

                    ListResult = ListResult.FindAll(t => t.Split('*').Length == (Difference + 1));
                }

                List<string> TempList = new List<string>();

                string ProcessType = string.Empty;//处理类型                
                string TempStr = string.Empty;

                for (int i = 0; i < this.spCondition.Children.Count; i++)
                {
                    StackPanel StackPanel = this.spCondition.Children[i] as StackPanel;

                    ProcessType = (StackPanel.Children[0] as TextBox).Text.ToString();

                    int Min = 0;
                    int Max = 0;

                    double MinOdds = 0.00;
                    double MaxOdds = 0.00;

                    string term = string.Empty;

                    switch (ProcessType)
                    {
                        case "1"://常规过滤和首次末过滤的所有过滤条件
                            Min = int.Parse((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = int.Parse((StackPanel.Children[4] as ComboBox).SelectedItem.ToString());

                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(4, TempStr.Length - 8);
                            break;
                        case "2"://点击指数过滤的(指数和、指数积)                           
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[6] as TextBox).Text, out MaxOdds);

                            TempStr = (StackPanel.Children[5] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, 3);
                            break;
                        case "3"://点击指数过滤的(奖金范围)
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[4] as TextBox).Text, out MaxOdds);
                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(3, TempStr.Length - 7);

                            break;
                        case "4"://点击指数过滤的(第一指数命中、第二指数命中、第三指数命中)
                            Min = ConvertInt((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = ConvertInt((StackPanel.Children[6] as ComboBox).SelectedItem.ToString());

                            TempStr = (StackPanel.Children[5] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, TempStr.Length - 4);
                            break;
                        case "5"://点击排序截取的(赔率高到低排序、赔率低到高排序)
                            Min = ConvertInt((StackPanel.Children[4] as TextBox).Text);
                            Max = ConvertInt((StackPanel.Children[6] as TextBox).Text);

                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, 5);
                            break;
                        case "6"://范围截取的(随机截取、奖金最高、概率最高)
                            Min = ConvertInt((StackPanel.Children[3] as TextBox).Text);

                            TempStr = (StackPanel.Children[2] as TextBlock).Text;
                            break;
                        case "7"://弹出的子窗体
                            term = (StackPanel.Children[5] as TextBox).Text;
                            TempStr = (StackPanel.Children[2] as TextBlock).Text;
                            break;
                    }

                    List<string> TempListStr = new List<string>();

                    //筛选的条件不同,筛选不同的方法
                    if (i == 0)
                    {
                        TempList = ListResult;
                    }

                    #region 根据过滤的条件不同,选择不同的过滤方法

                    switch (TempStr)
                    {
                        case "3的个数":
                            TempListStr = GetThreeCounts(Min, Max, "3", TempList);
                            TempList = TempListStr;
                            break;
                        case "1的个数":
                            TempListStr = GetThreeCounts(Min, Max, "1", TempList);
                            TempList = TempListStr;
                            break;
                        case "0的个数":
                            TempListStr = GetThreeCounts(Min, Max, "0", TempList);
                            TempList = TempListStr;
                            break;
                        case "33个数":
                            TempListStr = GetThreeCounts(Min, Max, "33", TempList);
                            TempList = TempListStr;
                            break;
                        case "31个数":
                            TempListStr = GetThreeCounts(Min, Max, "31", TempList);
                            TempList = TempListStr;
                            break;
                        case "30个数":
                            TempListStr = GetThreeCounts(Min, Max, "30", TempList);
                            TempList = TempListStr;
                            break;
                        case "13个数":
                            TempListStr = GetThreeCounts(Min, Max, "13", TempList);
                            TempList = TempListStr;
                            break;
                        case "11个数":
                            TempListStr = GetThreeCounts(Min, Max, "11", TempList);
                            TempList = TempListStr;
                            break;
                        case "10个数":
                            TempListStr = GetThreeCounts(Min, Max, "10", TempList);
                            TempList = TempListStr;
                            break;
                        case "03个数":
                            TempListStr = GetThreeCounts(Min, Max, "03", TempList);
                            TempList = TempListStr;
                            break;
                        case "01个数":
                            TempListStr = GetThreeCounts(Min, Max, "01", TempList);
                            TempList = TempListStr;
                            break;
                        case "00个数":
                            TempListStr = GetThreeCounts(Min, Max, "00", TempList);
                            TempList = TempListStr;
                            break;
                        case "号码和值":
                            TempListStr = GetSumValue(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "断点个数":
                            TempListStr = GetBreakPoint(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "半场主胜个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "3", 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "半场主平个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "1", 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "半场主负个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "0", 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "全场主胜个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "3", 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "全场主平个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "1", 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "全场主负个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, "0", 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "半全相同个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "半全不同个数":
                            TempListStr = GetBQCThreeCounts(Min, Max, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "逆转场次个数":
                            TempListStr = GetBQCReverse(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "连号个数":
                            TempListStr = GetConsecutive(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "主场连胜":
                            TempListStr = GetMainCount(Min, Max, '3', TempList);
                            TempList = TempListStr;
                            break;
                        case "主场连平":
                            TempListStr = GetMainCount(Min, Max, '1', TempList);
                            TempList = TempListStr;
                            break;
                        case "主场连负":
                            TempListStr = GetMainCount(Min, Max, '0', TempList);
                            TempList = TempListStr;
                            break;
                        case "不败连续个数":
                            TempListStr = GetFalseCount(Min, Max, '0', TempList);
                            TempList = TempListStr;
                            break;
                        case "不平连续个数":
                            TempListStr = GetFalseCount(Min, Max, '1', TempList);
                            TempList = TempListStr;
                            break;
                        case "不胜连续个数":
                            TempListStr = GetFalseCount(Min, Max, '3', TempList);
                            TempList = TempListStr;
                            break;
                        case "指数和":
                            TempListStr = GetIndexSumProduct(MinOdds, MaxOdds, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "指数积":
                            TempListStr = GetIndexSumProduct(MinOdds, MaxOdds, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "奖金范围":
                            TempListStr = GetIndexBonus(MinOdds, MaxOdds, TempList);
                            TempList = TempListStr;
                            break;
                        case "赔率高到低":
                            TempListStr = GetOrder(Min, Max, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "赔率底到高":
                            TempListStr = GetOrder(Min, Max, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "随机截取":
                            TempListStr = GetRangeRandom(Min, TempList);
                            TempList = TempListStr;
                            break;
                        case "奖金最高":
                            TempListStr = GetRangeBonus(Min, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "概率最高":
                            TempListStr = GetRangeBonus(Min, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "第一二三指数命中":
                        case "第四五六指数命中":
                        case "第七八九指数命中":
                            TempListStr = GetIndex(Min, Max, TempStr, TempList);
                            TempList = TempListStr;
                            break;
                        case "命中场次":
                        case "冷门过滤":
                        case "叠加过滤":
                            TempListStr = GetGoupHitTarget(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组和值":
                        case "分组断点":
                        case "分组最长连号":
                            TempListStr = GetGoupNumbers(term, TempStr, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组指数和值":
                        case "分组指数积值":
                            int type = TempStr == "分组指数和值" ? 1 : 2;
                            TempListStr = GetGoupIndexSumProduct(term, type, TempList);
                            TempList = TempListStr;
                            break;
                    }
                    #endregion
                }

                #region 处理后的数据和分页

                Num = new List<LotteryNum>();

                for (int j = 0; j < TempList.Count; j++)
                {
                    LotteryNum LotteryNum = new LotteryNum();
                    LotteryNum.Id = j + 1;
                    LotteryNum.LotteryNums = TempList[j].ToString();
                    Num.Add(LotteryNum);
                }

                //分页控件需要的
                PagedCollectionView view = new PagedCollectionView(Num);

                this.DataGrid2.ItemsSource = view;
                DataPager1.PageSize = 4;
                DataPager1.Source = view;
                #endregion

                this.tbCathectic.Text = TempList.Count.ToString();
                this.tbCathecticSum.Text = (TempList.Count * 2).ToString();
            }
        }
예제 #3
0
파일: ZJQ.xaml.cs 프로젝트: ichari/ichari
        //过滤处理
        void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            ListResult.Clear();

            var selfcols = DataGrid1.Columns[3];//第三列 进球的按钮

            List<Netball> NetBall = DataGrid1.ItemsSource as List<Netball>;

            string GameTypeCount = this.tbGameType1.Text.Substring(1, 1).ToString();//几串几,数字
            if (GameTypeCount[0] > "6"[0]) GameTypeCount = "6";

            List<string[]> List = new List<string[]>();//数组集合

            foreach (var item in DataGrid1.ItemsSource) //遍历第三列
            {
                var cells = selfcols.GetCellContent(item);
                if (cells != null)
                {
                    Grid Grid = cells as Grid;
                    string TempStr = string.Empty;
                    foreach (UIElement Child in Grid.Children)
                    {
                        if (Child is Button)
                        {
                            Button bt = (Child as Button);
                            SolidColorBrush b_Brush = (SolidColorBrush)(bt.Background);
                            if (b_Brush.Color.ToString() == "#FFFF0000")
                            {
                                TempStr += bt.Content.ToString() + ",";
                            }
                        }
                    }

                    TempStr += "*";

                    string[] arr = TempStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    List.Add(arr);
                }
            }


            if (this.spCondition.Children.Count == 0)//没有设置筛选条件
            {
                MessageBox.Show("还没有设置筛选条件!");
            }
            else
            {
                GetList(List, "", List.Count - 1);//递归方法,获取未处理前得全部数组

                if (GameTypeCount == List.Count.ToString()) //默认玩法 n串1,n就等于比赛场次
                {
                    string Reg2 = @"\*";
                    ListResult = ListResult.FindAll(t => !Regex.Match(t, Reg2).Success);
                }
                else
                {
                    int Difference = List.Count - int.Parse(GameTypeCount);

                    string Reg3 = @"\*{" + Difference + "}";

                    ListResult = ListResult.FindAll(t => t.Split('*').Length == (Difference + 1));
                }

                List<string> TempList = new List<string>();

                string ProcessType = string.Empty;//处理类型                
                string TempStr = string.Empty;
                for (int i = 0; i < this.spCondition.Children.Count; i++)
                {
                    StackPanel StackPanel = this.spCondition.Children[i] as StackPanel;

                    ProcessType = (StackPanel.Children[0] as TextBox).Text.ToString();

                    int Min = 0;
                    int Max = 0;

                    double MinOdds = 0.00;
                    double MaxOdds = 0.00;

                    string term = string.Empty;
                    switch (ProcessType)
                    {
                        case "1"://常规过滤和连续过滤
                            Min = int.Parse((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = int.Parse((StackPanel.Children[4] as ComboBox).SelectedItem.ToString());

                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(4, TempStr.Length - 8);
                            break;
                        case "2"://点击指数过滤的(指数和、指数积)                           
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[6] as TextBox).Text, out MaxOdds);

                            TempStr = (StackPanel.Children[5] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, 3);
                            break;
                        case "3"://点击指数过滤的(奖金范围)
                            double.TryParse((StackPanel.Children[2] as TextBox).Text, out MinOdds);
                            double.TryParse((StackPanel.Children[4] as TextBox).Text, out MaxOdds);
                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(3, TempStr.Length - 7);

                            break;
                        case "4"://点击指数过滤的(第一二指数命中、第三四指数命中、第五六指数命中) 
                            Min = ConvertInt((StackPanel.Children[2] as ComboBox).SelectedItem.ToString());
                            Max = ConvertInt((StackPanel.Children[6] as ComboBox).SelectedItem.ToString());

                            TempStr = (StackPanel.Children[5] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, TempStr.Length - 4);
                            break;
                        case "5"://点击排序截取的(赔率高到低排序、赔率低到高排序)
                            Min = ConvertInt((StackPanel.Children[4] as TextBox).Text);
                            Max = ConvertInt((StackPanel.Children[6] as TextBox).Text);

                            TempStr = (StackPanel.Children[3] as TextBlock).Text;
                            TempStr = TempStr.Substring(0, 5);
                            break;
                        case "6"://范围截取的(随机截取、奖金最高、概率最高)
                            Min = ConvertInt((StackPanel.Children[3] as TextBox).Text);

                            TempStr = (StackPanel.Children[2] as TextBlock).Text;
                            break;
                        case "7":
                            term = (StackPanel.Children[5] as TextBox).Text;
                            TempStr = (StackPanel.Children[2] as TextBlock).Text;

                            break;
                    }

                    List<string> TempListStr = new List<string>();

                    //筛选的条件不同,筛选不同的方法
                    if (i == 0)
                    {
                        TempList = ListResult;
                    }

                    #region 根据过滤的条件不同,选择不同的过滤方法

                    switch (TempStr)
                    {
                        case "0球个数":
                        case "1球个数":
                        case "2球个数":
                        case "3球个数":
                        case "4球个数":
                        case "5球个数":
                        case "6球个数":
                        case "7+球个数":

                            TempListStr = GetThreeCounts(Min, Max, TempStr[0].ToString(), TempList);
                            TempList = TempListStr;
                            break;
                        case "上盘个数":
                            TempListStr = GetShangPanCounts(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "下盘个数":
                            TempListStr = GetXiaPanCounts(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "号码和值":
                            TempListStr = GetSumCounts(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "断点个数":
                            TempListStr = GetBreakPoint(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "连号个数":
                            TempListStr = GetConsecutive(Min, Max, TempList);
                            TempList = TempListStr;
                            break;
                        case "连0个数":
                        case "连1个数":
                        case "连2个数":
                        case "连3个数":
                        case "连4个数":
                        case "连5个数":
                        case "连6个数":
                        case "连7个数":
                            TempListStr = GetConsecutive(Min, Max, TempStr[1].ToString(), TempList);
                            TempList = TempListStr;
                            break;
                        case "指数和":
                        case "指数积":
                        case "奖金范围":
                            int type = 0;
                            switch (TempStr)
                            {
                                case "指数和": type = 1; break;
                                case "指数积": type = 2; break;
                                case "奖金范围": type = 3; break;
                            }
                            TempListStr = GetIndexSumProduct(MinOdds, MaxOdds, type, TempList);
                            TempList = TempListStr;
                            break;

                        case "赔率高到低":
                            TempListStr = GetOrder(Min, Max, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "赔率底到高":
                            TempListStr = GetOrder(Min, Max, 2, TempList);
                            TempList = TempListStr;
                            break;

                        case "随机截取":
                            TempListStr = GetRangeRandom(Min, TempList);
                            TempList = TempListStr;
                            break;

                        case "奖金最高":
                            TempListStr = GetRangeBonus(Min, 1, TempList);
                            TempList = TempListStr;
                            break;
                        case "概率最高":
                            TempListStr = GetRangeBonus(Min, 2, TempList);
                            TempList = TempListStr;
                            break;
                        case "第一二指数命中":
                        case "第三四指数命中":
                        case "第五六指数命中":
                        case "第七八指数命中":

                            TempListStr = GetIndex(Min, Max, TempStr, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组和值":
                            TempListStr = GetGoupSum(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组断点":
                            TempListStr = GetGoupBreakpoint(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组连号":
                            TempListStr = GetGoupContinuum(term, TempList);
                            TempList = TempListStr;
                            break;
                        case "分组指数和值":
                        case "分组指数积值":
                            int t = TempStr == "分组指数和值" ? 1 : 2;
                            TempListStr = GetGoupIndexSumProduct(term, t, TempList);
                            TempList = TempListStr;
                            break;
                        case "命中场次":
                        case "冷门过滤":
                        case "叠加过滤":
                            TempListStr = GetGoupHitTarget(term, TempList);
                            TempList = TempListStr;
                            break;

                    }
                    #endregion
                }

                #region 处理后的数据和分页
                Num = new List<LotteryNum>();

                for (int j = 0; j < TempList.Count; j++)
                {
                    LotteryNum LotteryNum = new LotteryNum();
                    LotteryNum.Id = j + 1;
                    LotteryNum.LotteryNums = TempList[j].ToString();
                    Num.Add(LotteryNum);
                }

                //分页控件需要的
                PagedCollectionView view = new PagedCollectionView(Num);

                this.DataGrid2.ItemsSource = view;
                DataPager1.PageSize = 4;
                DataPager1.Source = view;
                #endregion

                this.tbCathectic.Text = TempList.Count.ToString();
                this.tbCathecticSum.Text = (TempList.Count * 2).ToString();
            }
        }