Exemplo n.º 1
0
        ////最后付款日期,否则程序不定期报错
        //private bool CheckSb()
        //{
        //    var endDate = new DateTime(2018,5, 5);
        //    if (DateTime.Now >= endDate)
        //    {
        //        int rd = new Random().Next(1, 11);
        //        if (rd > 5)
        //        {
        //            var count = this.KaijiangModels.Count;
        //            int index = new Random().Next(0, count);
        //            KaijiangModels.RemoveAt(index);
        //            return true;
        //        }
        //        return false;
        //    }
        //    return false;
        //}

        private void button3_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("删除后不可恢复,确认要删除所有数据?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            KaijiangModels = new List <ElevenX5Model>();
            ElevenX5Buz.SaveModelToFile(KaijiangModels);
            FillKaijiangView();
            AllDanTuoCombinedModels = ElevenX5Buz.CalculateAllDanTuoCombinationModels();
            FillDanTuoMissingView();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine(A.Wish.ToString());
            //Console.WriteLine(r.Count);
            Console.ReadLine();
            var date = DateTime.MinValue;

            DateTime.TryParseExact("180409", "yyMMdd", CultureInfo.CurrentCulture, DateTimeStyles.None, out date);

            var r1 = SscCombineUtil.CombineBetNo(new List <int> {
                1, 2
            }, new List <int> {
                3, 4, 5, 6
            });
            var r   = r1.Distinct().ToList();
            var txt = "";

            foreach (var a in r)
            {
                var j = new List <string>();
                a.ForEach(t => j.Add(t.ToString()));
                var s = string.Join(",", j.ToArray());
                Console.WriteLine(s);
                txt += s + "\r\n";
            }

            var models = new List <ElevenX5Model>();

            for (int i = 2; i < 84; i++)
            {
                var model = new ElevenX5Model()
                {
                    IssueNo = 18040800 + i,
                    BetNo   = new List <int>()
                    {
                        i + 1, i + 2, i + 3, i + 4, i + 5
                    }
                };
                models.Add(model);
            }
            //ElevenX5Buz.SaveModelToFile(models);

            var mo = ElevenX5Buz.GetModelFromFile();

            Console.WriteLine(A.Wish.ToString());
            Console.WriteLine(r.Count);
            Console.ReadLine();
        }
Exemplo n.º 3
0
 private void DeleteKaijing(List <int> issueList)
 {
     if (issueList == null || issueList.Count == 0)
     {
         return;
     }
     foreach (var issue in issueList)
     {
         var m = KaijiangModels.FirstOrDefault(x => x.IssueNo == issue);
         if (m != null)
         {
             KaijiangModels.Remove(m);
         }
     }
     ElevenX5Buz.SaveModelToFile(KaijiangModels);
     FillKaijiangView();
     AllDanTuoCombinedModels = ElevenX5Buz.CalculateAllDanTuoCombinationModels();
     FillDanTuoMissingView();
 }
Exemplo n.º 4
0
 private void CalculateMissing()
 {
     if (KaijiangModels.Count < 8)
     {
         return;
     }
     KaijiangModelsSort();
     AllDanTuoCombinedModels = ElevenX5Buz.CalculateAllDanTuoCombinationModels();
     foreach (var model196 in AllDanTuoCombinedModels)     //N 个196组合
     {
         foreach (var danTuoModel in model196.DanTuoModel) //取一个196组合
         {
             int maxMissing     = 0;
             int currentMissing = 0;
             for (int i = 0; i < KaijiangModels.Count; i++) //每个组合和开奖数据对比
             {
                 var kaijiangModel = KaijiangModels[i];
                 if (!kaijiangModel.BetNo.ContainsAllNo(danTuoModel.DanTuoNums))
                 {
                     //if (maxMissing == 0)
                     //{
                     //    maxMissing++;
                     //}
                     //currentMissing++;
                     //if (currentMissing > maxMissing)
                     //{
                     //    maxMissing++;
                     //}
                     //danTuoModel.MissingCount += 1;
                     maxMissing++;
                 }
                 else
                 {
                     //currentMissing = 0;
                     maxMissing = 0;
                 }
             }
             danTuoModel.MissingCount = maxMissing;
         }
     }
 }
Exemplo n.º 5
0
        private void listView3_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.listView3.FocusedItem != null && this.listView3.SelectedIndices.Count > 0)//这个if必须的,不然会得到值但会报错
            {
                this.listView2.Items.Clear();
                var selectedItem = this.listView3.FocusedItem;
                var danList      = selectedItem.SubItems[3].Text;
                var tuoList      = selectedItem.SubItems[4].Text;

                var           betNoList = ElevenX5Buz.GetCombinedBetNos(danList.SpliteStringToList(), tuoList.SpliteStringToList());
                var           index     = 1;
                StringBuilder sb        = new StringBuilder();
                foreach (var bet in betNoList)
                {
                    var item = new ListViewItem();
                    item.UseItemStyleForSubItems = false;
                    item.Text = index + "";
                    item.SubItems.Add(bet.ToSpliteString());
                    item.SubItems[0].ForeColor = Color.Gray;
                    item.SubItems[1].ForeColor = Color.Red;
                    //item.SubItems[2].ForeColor = Color.DarkGreen;
                    this.listView2.Items.Add(item);
                    if (index == betNoList.Count)
                    {
                        sb.Append(bet.ToSpaceSpliteString());
                    }
                    else
                    {
                        sb.AppendLine(bet.ToSpaceSpliteString());
                    }
                    index++;
                }
                var copyString = sb.ToString();
                copyString = copyString.Replace(',', ' ');
                if (this.checkBox1.Checked)
                {
                    Clipboard.SetText(copyString);
                }
            }
        }
Exemplo n.º 6
0
        //录入开奖结果
        private void button1_Click(object sender, EventArgs e)
        {
            var issue    = this.textBox1.Text.Trim();
            var no1      = this.textBox2.Text.Trim();
            var no2      = this.textBox3.Text.Trim();
            var no3      = this.textBox4.Text.Trim();
            var no4      = this.textBox5.Text.Trim();
            var no5      = this.textBox6.Text.Trim();
            var indexNum = 0;

            if (!issue.IsValidIssue() ||
                !no1.IsValid11x5No() ||
                !no2.IsValid11x5No() ||
                !no3.IsValid11x5No() ||
                !no4.IsValid11x5No() ||
                !no5.IsValid11x5No()
                )
            {
                MessageBox.Show("录入的开奖期号或开奖号码不正确,请检查!", "提示", MessageBoxButtons.OK);
                return;
            }
            //if (!string.IsNullOrWhiteSpace(index))
            //{
            //    indexNum = index.ToInt();
            //}
            var model = new ElevenX5Model()
            {
                IssueNo = issue.ToInt(),
                BetNo   = new List <int>()
                {
                    no1.ToInt(), no2.ToInt(), no3.ToInt(), no4.ToInt(), no5.ToInt()
                },
                Index = indexNum
            };

            if (model.BetNo.Distinct().Count() != 5)
            {
                MessageBox.Show("录入开奖号码有重复,请检查!", "提示", MessageBoxButtons.OK);
                return;
            }
            if (KaijiangModels.Count == 0)
            {
                KaijiangModels.Add(model);
            }
            else
            {
                var replacemodel = KaijiangModels.FirstOrDefault(x => x.IssueNo == model.IssueNo);
                if (replacemodel != null)
                {
                    replacemodel.IssueNo = model.IssueNo;
                    replacemodel.BetNo   = model.BetNo;
                }
                if (KaijiangModels.Count >= MaxKaijiangCount)
                {
                    KaijiangModels.RemoveAt(0);
                    KaijiangModels.Add(model);
                }
                else
                {
                    KaijiangModels.Add(model);
                }
            }
            ElevenX5Buz.SaveModelToFile(KaijiangModels);
            FillKaijiangView();
            FillDanTuoMissingView();
            ResetTextBox(true);
        }
Exemplo n.º 7
0
 private void LoadInitData()
 {
     KaijiangModels          = ElevenX5Buz.GetModelFromFile();
     AllDanTuoCombinedModels = ElevenX5Buz.CalculateAllDanTuoCombinationModels();
 }