Esempio n. 1
0
        /// <summary>
        /// 开奖趋势分析
        /// </summary>
        private void analyzeTendency(Lottery lottery, Tendency tendency, int index1, int index2)
        {
            tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.ID       = i + 1;
                tm.Lottery  = lottery.Lt_Lotterys[i].Lottery;
                tm.Big      = at.BigNum(lottery.Lt_Lotterys, i, index1, index2);          //大大
                tm.BigSmall = at.BigSmallNum(lottery.Lt_Lotterys, i, index1, index2);     //大小
                tm.SmallBig = at.SmallBigNum(lottery.Lt_Lotterys, i, index1, index2);     //小大
                tm.Small    = at.SmallNum(lottery.Lt_Lotterys, i, index1, index2);        //小小

                tm.Odd     = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 1, 1); //奇奇
                tm.OddPair = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 1, 0); //奇偶
                tm.PairOdd = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 0, 1); //偶奇
                tm.Pair    = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 0, 0); //偶偶
                tm.Dbl     = at.DblNum(lottery.Lt_Lotterys, i, index1, index2);           //重数

                tm.SNO   = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime = lottery.Lt_Lotterys[i].Dtime;

                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 前二、后二开奖趋势分析
        /// </summary>
        private void analyzeTendency()
        {
            Tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = Lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.ID       = i + 1;
                tm.Big      = at.BigNum(i, xscpStyle.num1, xscpStyle.num2);          //大大
                tm.BigSmall = at.BigSmallNum(i, xscpStyle.num1, xscpStyle.num2);     //大小
                tm.SmallBig = at.SmallBigNum(i, xscpStyle.num1, xscpStyle.num2);     //小大
                tm.Small    = at.SmallNum(i, xscpStyle.num1, xscpStyle.num2);        //小小

                tm.Odd     = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 1, 1); //奇奇
                tm.OddPair = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 1, 0); //奇偶
                tm.PairOdd = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 0, 1); //偶奇
                tm.Pair    = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 0, 0); //偶偶
                tm.Dbl     = at.DblNum(i, xscpStyle.num1, xscpStyle.num2);           //重数

                tm.SNO = (Lottery.Lt_Lotterys[i].sno.ToString() + "期").PadLeft(5, '0');
                tm.Dt  = getDate(Lottery.Lt_Lotterys[i].sno);

                Tendency.AddTendency(tm);//添加趋势记录
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 前二、后二开奖趋势分析
        /// </summary>
        private void analyzeTendency()
        {
            Tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = Lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.Big      = at.BigNum(i, EnumStyle);          //大大
                tm.BigSmall = at.BigSmallNum(i, EnumStyle);     //大小
                tm.SmallBig = at.SmallBigNum(i, EnumStyle);     //小大
                tm.Small    = at.SmallNum(i, EnumStyle);        //小小

                tm.Odd     = at.OddPairNum(i, 1, 1, EnumStyle); //奇奇
                tm.OddPair = at.OddPairNum(i, 1, 0, EnumStyle); //奇偶
                tm.PairOdd = at.OddPairNum(i, 0, 1, EnumStyle); //偶奇
                tm.Pair    = at.OddPairNum(i, 0, 0, EnumStyle); //偶偶
                tm.Dbl     = at.DblNum(i, EnumStyle);           //重数
                Tendency.AddTendency(tm);                       //添加趋势记录
            }

            for (int i = 0, j = Lottery.Lt_Lotterys.Count - 1; i < Lottery.Lt_Lotterys.Count; i++)
            {
                Lottery.Lt_Lotterys[i].sno = j;
                j--;
            }
        }
Esempio n. 4
0
        public static void SaveTendencyAllDigit(List <LotteryModel> ltData)
        {
            LotteryModel minData = ltData[ltData.Count - 1];

            //上一期趋势
            Tendency1Model preTendency1 = null;

            //本次上一次开奖趋势,除非最后一期
            int prePperiod = int.Parse(minData.Sno) - 1;

            if (prePperiod > 0)
            {
                preTendency1 = MysqlHelper.QueryAllTendencyDigit1(minData.Ymd, prePperiod.ToString().PadLeft(4, '0'));
            }

            if (preTendency1 == null)
            {
                preTendency1 = new Tendency1Model();
            }
            AnalyzeTendency       At         = new AnalyzeTendency();
            List <Tendency1Model> ltTendency = new List <Tendency1Model>();

            for (int i = ltData.Count - 1; i >= 0; i--)
            {
                LotteryModel   lm = ltData[i];
                Tendency1Model tm = new Tendency1Model();
                tm.Ymd     = lm.Ymd;
                tm.Lottery = lm.Lottery;
                tm.Sno     = lm.Sno;

                tm.Num0 = At.ExistDigit(lm, 0) ? 0 : preTendency1.Num0 + 1;
                tm.Num1 = At.ExistDigit(lm, 1) ? 0 : preTendency1.Num1 + 1;
                tm.Num2 = At.ExistDigit(lm, 2) ? 0 : preTendency1.Num2 + 1;
                tm.Num3 = At.ExistDigit(lm, 3) ? 0 : preTendency1.Num3 + 1;
                tm.Num4 = At.ExistDigit(lm, 4) ? 0 : preTendency1.Num4 + 1;
                tm.Num5 = At.ExistDigit(lm, 5) ? 0 : preTendency1.Num5 + 1;
                tm.Num6 = At.ExistDigit(lm, 6) ? 0 : preTendency1.Num6 + 1;
                tm.Num7 = At.ExistDigit(lm, 7) ? 0 : preTendency1.Num7 + 1;
                tm.Num8 = At.ExistDigit(lm, 8) ? 0 : preTendency1.Num8 + 1;
                tm.Num9 = At.ExistDigit(lm, 9) ? 0 : preTendency1.Num9 + 1;

                tm.Dtime = lm.Dtime;
                ltTendency.Add(tm);

                prePperiod = int.Parse(lm.Sno);
                if (prePperiod == 1380)
                {
                    preTendency1 = new Tendency1Model();
                }
                else
                {
                    preTendency1 = tm;
                }
            }

            MysqlHelper.SaveAllTendencyDigit1(ltTendency);
        }
Esempio n. 5
0
        /// <summary>
        /// 新增一星走势数据
        /// </summary>
        /// <param name="type"></param>
        /// <param name="tendencys"></param>
        public static void SaveTendency1(Tendency1Enum type, List <LotteryModel> ltData)
        {
            int index = (int)type;

            LotteryModel minData = ltData[ltData.Count - 1];

            //上一期趋势
            TendencyModel preTendency1 = null;

            //本次上一次开奖趋势,除非最后一期
            int prePperiod = int.Parse(minData.Sno) - 1;

            if (prePperiod > 0)
            {
                preTendency1 = SQLiteHelper.QueryTendency1(type, minData.Ymd, prePperiod.ToString().PadLeft(4, '0'));
            }

            AnalyzeTendency      At         = new AnalyzeTendency();
            List <TendencyModel> ltTendency = new List <TendencyModel>();

            for (int i = ltData.Count - 1; i >= 0; i--)
            {
                LotteryModel  lm = ltData[i];
                TendencyModel tm = new TendencyModel();
                tm.Ymd     = lm.Ymd;
                tm.Lottery = lm.Lottery;
                tm.Sno     = lm.Sno;

                tm.Big   = At.BigNum(lm, preTendency1, index);       //大大
                tm.Small = At.SmallNum(lm, preTendency1, index);     //小小

                tm.Odd  = At.OddPairNum(lm, preTendency1, index, 1); //奇奇
                tm.Pair = At.OddPairNum(lm, preTendency1, index, 0); //偶偶

                tm.Dtime = lm.Dtime;

                ltTendency.Add(tm);

                prePperiod = int.Parse(lm.Sno);
                if (prePperiod == 1380)
                {
                    preTendency1 = null;
                }
                else
                {
                    preTendency1 = tm;
                }
            }

            SQLiteHelper.SaveTendency1(type, ltTendency);
        }
Esempio n. 6
0
        private void Compare(Lottery lottery)
        {
            lt_CompareTwos.Clear();
            AnalyzeTendency at = new AnalyzeTendency();
            CompareTwoModel tm;

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm              = new CompareTwoModel();
                tm.Sno          = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Lottery      = lottery.Lt_Lotterys[i].Lottery;
                tm.CompareValue = at.CompareLottery(lottery.Lt_Lotterys, i, index1, index2);
                tm.Dtime        = lottery.Lt_Lotterys[i].Dtime;

                lt_CompareTwos.Add(tm);//添加趋势记录
            }

            int pre = lt_CompareTwos.Count - 1;

            for (int i = lt_CompareTwos.Count - 1; i >= 1; i--)
            {
                tm = lt_CompareTwos[i];

                if (tm.CompareValue == 0)
                {
                    tm.TendencyValue = 0;
                }
                else
                {
                    for (int j = i - 1; j >= 0; j--)
                    {
                        if (lt_CompareTwos[j].CompareValue == 0)
                        {
                            tm.TendencyValue = i - j;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 添加二星趋势
        /// </summary>
        /// <param name="type"></param>
        /// <param name="dt"></param>
        /// <param name="ltData"></param>
        public static void SaveTendency2(Tendency2Enum type, List <LotteryModel> ltData)
        {
            int index1, index2 = 0;

            if (type == Tendency2Enum.Before)
            {
                index1 = 1;
                index2 = 2;
            }
            else
            {
                index1 = 4;
                index2 = 5;
            }

            LotteryModel minData = ltData[ltData.Count - 1];

            //上一期趋势
            Tendency2Model preTendency2 = null;

            //本次上一次开奖趋势,除非最后一期
            int prePperiod = int.Parse(minData.Sno) - 1;

            if (prePperiod > 0)
            {
                preTendency2 = SQLiteHelper.QueryTendency2(type, minData.Ymd, prePperiod.ToString().PadLeft(4, '0'));
            }

            AnalyzeTendency       At          = new AnalyzeTendency();
            List <Tendency2Model> ltTendency2 = new List <Tendency2Model>();

            for (int i = ltData.Count - 1; i >= 0; i--)
            {
                LotteryModel   lm = ltData[i];
                Tendency2Model tm = new Tendency2Model();
                tm.Ymd     = lm.Ymd;
                tm.Lottery = lm.Lottery;
                tm.Sno     = lm.Sno;

                tm.Big      = At.BigNum(lm, preTendency2, index1, index2);          //大大
                tm.Small    = At.SmallNum(lm, preTendency2, index1, index2);        //小小
                tm.BigSmall = At.BigSmallNum(lm, preTendency2, index1, index2);     //大小
                tm.SmallBig = At.SmallBigNum(lm, preTendency2, index1, index2);     //小大

                tm.Odd     = At.OddPairNum(lm, preTendency2, index1, index2, 1, 1); //奇奇
                tm.Pair    = At.OddPairNum(lm, preTendency2, index1, index2, 0, 0); //偶偶
                tm.OddPair = At.OddPairNum(lm, preTendency2, index1, index2, 1, 0); //奇偶
                tm.PairOdd = At.OddPairNum(lm, preTendency2, index1, index2, 0, 1); //偶奇

                tm.Dbl   = At.DblNum(lm, preTendency2, index1, index2);             //重数
                tm.Dtime = lm.Dtime;

                ltTendency2.Add(tm);

                prePperiod = int.Parse(lm.Sno);
                if (prePperiod == 1380)
                {
                    preTendency2 = null;
                }
                else
                {
                    preTendency2 = tm;
                }
            }


            SQLiteHelper.SaveTendency2(type, ltTendency2);
        }
Esempio n. 8
0
        /// <summary>
        /// 添加二星趋势
        /// </summary>
        /// <param name="type"></param>
        /// <param name="dt"></param>
        /// <param name="ltData"></param>
        public static void SaveTendency2(Tendency2Enum type, List <LotteryModel> ltData)
        {
            int index1, index2 = 0;

            if (type == Tendency2Enum.Before)
            {
                index1 = 1;
                index2 = 2;
            }
            else
            {
                index1 = 4;
                index2 = 5;
            }

            LotteryModel minData = ltData[ltData.Count - 1];

            //上一期趋势
            Tendency2Model preTendency2 = null;

            //本次上一次开奖趋势,除非最后一期
            int prePperiod = int.Parse(minData.Sno) - 1;

            if (prePperiod > 0)
            {
                preTendency2 = MysqlHelper.QueryTendency2(type, minData.Ymd, prePperiod.ToString().PadLeft(4, '0'));
            }

            AnalyzeTendency       At          = new AnalyzeTendency();
            List <Tendency2Model> ltTendency2 = new List <Tendency2Model>();

            for (int i = ltData.Count - 1; i >= 0; i--)
            {
                LotteryModel   lm = ltData[i];
                Tendency2Model tm = new Tendency2Model();
                tm.Ymd     = lm.Ymd;
                tm.Lottery = lm.Lottery;
                tm.Sno     = lm.Sno;

                //大、小
                tm.Big      = At.BigNum(lm, preTendency2, index1, index2);      //大大
                tm.Small    = At.SmallNum(lm, preTendency2, index1, index2);    //小小
                tm.BigSmall = At.BigSmallNum(lm, preTendency2, index1, index2); //大小
                tm.SmallBig = At.SmallBigNum(lm, preTendency2, index1, index2); //小大

                //奇偶
                tm.Odd     = At.OddPairNum(lm, preTendency2, index1, index2, 1, 1); //奇奇
                tm.Pair    = At.OddPairNum(lm, preTendency2, index1, index2, 0, 0); //偶偶
                tm.OddPair = At.OddPairNum(lm, preTendency2, index1, index2, 1, 0); //奇偶
                tm.PairOdd = At.OddPairNum(lm, preTendency2, index1, index2, 0, 1); //偶奇

                //质、合
                tm.PrimePrime         = At.PrimePrime(lm, preTendency2, index1, index2);         //质质数
                tm.PrimeComposite     = At.PrimeComposite(lm, preTendency2, index1, index2);     //质合数
                tm.CompositePrime     = At.CompositePrime(lm, preTendency2, index1, index2);     //合质数
                tm.CompositeComposite = At.CompositeComposite(lm, preTendency2, index1, index2); //合合数

                //0、1、2路
                tm.No_00 = At.RoadNum012(lm, preTendency2, index1, index2, 0, 0); //00路
                tm.No_01 = At.RoadNum012(lm, preTendency2, index1, index2, 0, 1); //01路
                tm.No_02 = At.RoadNum012(lm, preTendency2, index1, index2, 0, 2); //02路
                tm.No_10 = At.RoadNum012(lm, preTendency2, index1, index2, 1, 0); //10路
                tm.No_11 = At.RoadNum012(lm, preTendency2, index1, index2, 1, 1); //11路
                tm.No_12 = At.RoadNum012(lm, preTendency2, index1, index2, 1, 2); //12路
                tm.No_20 = At.RoadNum012(lm, preTendency2, index1, index2, 2, 0); //20路
                tm.No_21 = At.RoadNum012(lm, preTendency2, index1, index2, 2, 1); //21路
                tm.No_22 = At.RoadNum012(lm, preTendency2, index1, index2, 2, 2); //22路

                //大、中、小
                tm.Big1Big1     = At.Big1Big1(lm, preTendency2, index1, index2);     //大大
                tm.Big1Mid1     = At.Big1Mid1(lm, preTendency2, index1, index2);     //大中
                tm.Big1Small1   = At.Big1Small1(lm, preTendency2, index1, index2);   //大小
                tm.Mid1Big1     = At.Mid1Big1(lm, preTendency2, index1, index2);     //中大
                tm.Mid1Mid1     = At.Mid1Mid1(lm, preTendency2, index1, index2);     //中中
                tm.Mid1Small1   = At.Mid1Small1(lm, preTendency2, index1, index2);   //中小
                tm.Small1Big1   = At.Small1Big1(lm, preTendency2, index1, index2);   //小大
                tm.Small1Mid1   = At.Small1Mid1(lm, preTendency2, index1, index2);   //小中
                tm.Small1Small1 = At.Small1Small1(lm, preTendency2, index1, index2); //小小

                tm.Dbl   = At.DblNum(lm, preTendency2, index1, index2);              //重数
                tm.Dtime = lm.Dtime;

                ltTendency2.Add(tm);

                prePperiod = int.Parse(lm.Sno);
                if (prePperiod == 1380)
                {
                    preTendency2 = null;
                }
                else
                {
                    preTendency2 = tm;
                }
            }

            MysqlHelper.SaveTendency2(type, ltTendency2);
        }