コード例 #1
0
ファイル: XscpMysqlBLL.cs プロジェクト: xh330786390/XSCP
        /// <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);
        }