/// <summary> /// 开奖趋势分析 /// </summary> public void AnalyzeTendency(Lottery lottery, Tendency <Tendency2Model> tendency, int index1, int index2) { tendency.ClearTendencys();//清空记录 Tendency2Model tm; AnalyzeTendency at = new AnalyzeTendency(); for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--) { tm = new Tendency2Model(); 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);//添加趋势记录 } }
/// <summary> /// 求上次出现奇偶数的 离现在有几次了 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1"></param> /// <param name="number2"></param> /// <param name="num1"></param> /// <param name="num2"></param> /// <returns></returns> public int OddPairNum(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2, int num1, int num2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 % 2 == num1 && value.v2 % 2 == num2 && value.v1 != value.v2) { return(0); } int count = 1; if (preTendency2 != null) { if (num1 == 1 && num2 == 1) { count = preTendency2.Odd + 1; } else if (num1 == 0 && num2 == 0) { count = preTendency2.Pair + 1; } else if (num1 == 1 && num2 == 0) { count = preTendency2.OddPair + 1; } else if (num1 == 0 && num2 == 1) { count = preTendency2.PairOdd + 1; } } return(count); }
private void initDgv1(List <Tendency2Model> lt, Tendency2Model maxTendency) { Tendency2Model tm; DgvController.AddRows(this.dgv1, lt.Count); for (int i = 0; i < lt.Count; i++) { tm = lt[i]; this.dgv1[0, i].Value = i + 1; //局数 this.dgv1[1, i].Value = tm.Dtime; //开奖日期 this.dgv1[2, i].Value = tm.Big; //大 this.dgv1[3, i].Value = tm.Small; //小 this.dgv1[4, i].Value = tm.BigSmall; //大小 this.dgv1[5, i].Value = tm.SmallBig; //小大 this.dgv1[6, i].Value = ""; this.dgv1[7, i].Value = tm.Odd; //奇 this.dgv1[8, i].Value = tm.Pair; //偶 this.dgv1[9, i].Value = tm.OddPair; //奇偶 this.dgv1[10, i].Value = tm.PairOdd; //偶奇 this.dgv1[11, i].Value = tm.Dbl; //重重 this.dgv1[12, i].Value = tm.Sno; } refreshColor(); refreshMaxTendency(maxTendency); }
/// <summary> /// 设置dgv值 /// </summary> /// <param name="dgv"></param> /// <param name="tm"></param> /// <param name="row"></param> public static void SetDgvValue(DataGridView dgv, Tendency2Model tm, int row, List <WinLotteryModel> lt) { dgv[1, row].Value = tm.Big; //大 dgv[2, row].Value = tm.Small; //小 dgv[3, row].Value = tm.BigSmall; //大小 dgv[4, row].Value = tm.SmallBig; //小大 dgv[5, row].Value = ""; dgv[6, row].Value = tm.Odd; //奇 dgv[7, row].Value = tm.Pair; //偶 dgv[8, row].Value = tm.OddPair; //奇偶 dgv[9, row].Value = tm.PairOdd; //偶奇 dgv[10, row].Value = tm.Dbl; //重 dgv[11, row].Value = "趋势"; dgv[12, row].Value = "统计"; if (lt != null) { int index = 0; for (int i = 0; i < lt.Count; i++) { string[] ar = getIndex(lt[i]).Split(','); index = Convert.ToInt32(ar[0]); dgv[index, row].ToolTipText = ar[1] + ": " + lt[i].KjLong.ToString(); } } }
public int RoadNum012(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2, int num012_1, int num012_2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 % 3 == num012_1 && value.v2 % 3 == num012_2) { return(0); } int count = 1; if (preTendency2 != null) { if (num012_1 == 0 && num012_2 == 0) { count = preTendency2.No_00 + 1; } else if (num012_1 == 0 && num012_2 == 1) { count = preTendency2.No_01 + 1; } else if (num012_1 == 0 && num012_2 == 2) { count = preTendency2.No_02 + 1; } else if (num012_1 == 1 && num012_2 == 0) { count = preTendency2.No_10 + 1; } else if (num012_1 == 1 && num012_2 == 1) { count = preTendency2.No_11 + 1; } else if (num012_1 == 1 && num012_2 == 2) { count = preTendency2.No_12 + 1; } else if (num012_1 == 2 && num012_2 == 0) { count = preTendency2.No_20 + 1; } else if (num012_1 == 2 && num012_2 == 1) { count = preTendency2.No_21 + 1; } else if (num012_1 == 2 && num012_2 == 2) { count = preTendency2.No_22 + 1; } } return(count); }
/// <summary> /// 获取属性值 /// </summary> /// <param name="tm"></param> /// <param name="fieldName"></param> /// <returns></returns> private bool isWinLoterry(Tendency2Model tm, string propertyName1, string propertyName2) { int value1 = (int)Reflection.GetPropertyValue(type, tm, propertyName1); int value2 = (int)Reflection.GetPropertyValue(type, tm, propertyName2); if (value1 == 0 || value2 == 0) { return(true); } else { return(false); } }
/// <summary> /// 获取最大走势值 /// </summary> /// <returns></returns> private Tendency2Model GetMaxTendency(List <Tendency2Model> Lt_Tendencys) { Tendency2Model tm = new Tendency2Model(); tm.Big = Lt_Tendencys.Max(l => l.Big); //大 tm.Small = Lt_Tendencys.Max(l => l.Small); //小 tm.BigSmall = Lt_Tendencys.Max(l => l.BigSmall); //大小 tm.SmallBig = Lt_Tendencys.Max(l => l.SmallBig); //小大 tm.Odd = Lt_Tendencys.Max(l => l.Odd); //奇 tm.Pair = Lt_Tendencys.Max(l => l.Pair); //偶 tm.OddPair = Lt_Tendencys.Max(l => l.OddPair); //奇偶 tm.PairOdd = Lt_Tendencys.Max(l => l.PairOdd); //偶奇 tm.Dbl = Lt_Tendencys.Max(l => l.Dbl); //重 return(tm); }
/// <summary> /// 设置前二、后二dgv值 /// </summary> /// <param name="dgv"></param> /// <param name="tm"></param> /// <param name="row"></param> public static void SetDgvValue(DataGridView dgv, Tendency2Model tm, int row) { dgv[1, row].Value = tm.Big; //大 dgv[2, row].Value = tm.Small; //小 dgv[3, row].Value = tm.BigSmall; //大小 dgv[4, row].Value = tm.SmallBig; //小大 dgv[5, row].Value = ""; dgv[6, row].Value = tm.Odd; //奇 dgv[7, row].Value = tm.Pair; //偶 dgv[8, row].Value = tm.OddPair; //奇偶 dgv[9, row].Value = tm.PairOdd; //偶奇 dgv[10, row].Value = tm.Dbl; //重 dgv[11, row].Value = "趋势"; dgv[12, row].Value = "-"; }
/// <summary> /// 合合数 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1"></param> /// <param name="number2"></param> /// <returns></returns> public int CompositeComposite(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2) { Value value = GetValue(curLottery, number1, number2); if (Lt_Composite.Contains(value.v1) && Lt_Composite.Contains(value.v2)) { return(0); } int count = 1; if (preTendency2 != null) { count = preTendency2.CompositeComposite + 1; } return(count); }
/// <summary> ///小小 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1">1 万位、4 十位</param> /// <param name="number2">2 千万、5 个位</param> /// <returns></returns> public int Small1Small1(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 < 3 && value.v2 < 3) { return(0); } int count = 1; if (preTendency2 != null) { count = preTendency2.Small1Small1 + 1; } return(count); }
/// <summary> ///中中 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1">1 万位、4 十位</param> /// <param name="number2">2 千万、5 个位</param> /// <returns></returns> public int Mid1Mid1(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 > 2 && value.v1 < 7 && value.v2 > 2 && value.v2 < 7 && value.v1 != value.v2) { return(0); } int count = 1; if (preTendency2 != null) { count = preTendency2.Mid1Mid1 + 1; } return(count); }
/// <summary> /// 求上次出现小大数的 离现在有几次了 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1"></param> /// <param name="number2"></param> /// <returns></returns> public int SmallBigNum(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 < 5 && value.v2 > 4 && value.v1 != value.v2) { return(0); } int count = 1; if (preTendency2 != null) { count = preTendency2.SmallBig + 1; } return(count); }
/// <summary> /// 求上次出现重数的 离现在有几次了 /// </summary> /// <param name="curLottery"></param> /// <param name="preTendency2"></param> /// <param name="number1"></param> /// <param name="number2"></param> /// <returns></returns> public int DblNum(LotteryModel curLottery, Tendency2Model preTendency2, int number1, int number2) { Value value = GetValue(curLottery, number1, number2); if (value.v1 == value.v2) { return(0); } int count = 1; if (preTendency2 != null) { count = preTendency2.Dbl + 1; } return(count); }
//public JsonResult PostLoadData(int num, string date) //{ // var students = new List<Student> // { // new Student(){ID =1,Name = "张三",Age =20, Birthday = DateTime.Now}, // new Student(){ID =2,Name = "李四",Age =20, Birthday = DateTime.Now} // }; // var result = new JsonResult(); // result.Data = students; // result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; // return result; //} /// <summary> /// 获取最大奖号 /// </summary> /// <param name="type"></param> /// <param name="date"></param> /// <returns></returns> public JsonResult PostLoadMaxData(int type, string date) { date = date.Replace("-", ""); Tendency2Model maxLotery = new Tendency2Model(); if (type == 1) { maxLotery = XscpMysqlBLL.QueryMaxTendency2(Common.Model.Tendency2Enum.Before, date); maxLotery.Sno = "前大"; maxLotery.Dtime = "-"; } else { maxLotery = XscpMysqlBLL.QueryMaxTendency2(Common.Model.Tendency2Enum.After, date); maxLotery.Sno = "后大"; maxLotery.Dtime = "-"; } return(Json(maxLotery, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取最大走势值 /// </summary> /// <returns></returns> private Tendency2Model GetMaxTendency(Tendency <Tendency2Model> tendency) { if (tendency.Lt_Tendencys.Count <= 0) { return(new Tendency2Model()); } Tendency2Model tm = new Tendency2Model(); tm.Big = tendency.Lt_Tendencys.Max(l => l.Big); //大 tm.Small = tendency.Lt_Tendencys.Max(l => l.Small); //小 tm.BigSmall = tendency.Lt_Tendencys.Max(l => l.BigSmall); //大小 tm.SmallBig = tendency.Lt_Tendencys.Max(l => l.SmallBig); //小大 tm.Odd = tendency.Lt_Tendencys.Max(l => l.Odd); //奇 tm.Pair = tendency.Lt_Tendencys.Max(l => l.Pair); //偶 tm.OddPair = tendency.Lt_Tendencys.Max(l => l.OddPair); //奇偶 tm.PairOdd = tendency.Lt_Tendencys.Max(l => l.PairOdd); //偶奇 tm.Dbl = tendency.Lt_Tendencys.Max(l => l.Dbl); //重 return(tm); }
/// <summary> /// 设置值 /// </summary> /// <param name="dgvRow"></param> /// <param name="tm"></param> public static void SetTendency2Value(DataGridViewRow dgvRow, Tendency2Model tm) { if (tm == null) { return; } dgvRow.Cells["Sno"].Value = tm.Sno; dgvRow.Cells["Big"].Value = tm.Big; dgvRow.Cells["Small"].Value = tm.Small; dgvRow.Cells["BigSmall"].Value = tm.BigSmall; dgvRow.Cells["SmallBig"].Value = tm.SmallBig; dgvRow.Cells["Odd"].Value = tm.Odd; dgvRow.Cells["Pair"].Value = tm.Pair; dgvRow.Cells["OddPair"].Value = tm.OddPair; dgvRow.Cells["PairOdd"].Value = tm.PairOdd; dgvRow.Cells["Dbl"].Value = tm.Dbl; dgvRow.Cells["Tendency2"].Value = "走势"; dgvRow.Cells["Statistics"].Value = "统计"; }
private void btnFind_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; TimeSpan d = this.dtpEnd.Value - this.dtpStart.Value; days = d.Days + 1; string fileName = null; Lottery lottery = new LotteryFF(); Tendency <Tendency2Model> tendency = new Tendency <Tendency2Model>(); Tendency2Model maxTendency = null; maxTendencys.Clear(); for (int i = 0; i < days; i++) { fileName = Param.FileBase + @"分分彩\" + "ffcp" + this.dtpStart.Value.AddDays(i).ToString("yyyyMMdd") + ".txt"; if (!File.Exists(fileName)) { continue; } coreMethod.ReadFile(this.dtpStart.Value.AddDays(i), lottery, fileName);//读取文件 coreMethod.AnalyzeTendency(lottery, tendency, num1, num2); maxTendency = GetMaxTendency(tendency); maxTendency.Dtime = this.dtpStart.Value.AddDays(i).ToString("yyyyMMdd"); maxTendency.Sno = this.dtpStart.Value.AddDays(i).DayOfWeek.ToString(); maxTendencys.Add(maxTendency); } maxTendency = GetMaxTendency(maxTendencys); if (maxTendencys.Count > 0) { initDgv1(maxTendencys, maxTendency); } this.Cursor = null; }
/// <summary> /// 给统计表添加数据 /// </summary> /// <param name="curFm"></param> /// <param name="nextFm"></param> private List <WinLotteryModel> addStatisticsValue(Tendency2Model curfm, Tendency2Model nextfm) { List <WinLotteryModel> lt = new List <WinLotteryModel>(); WinLotteryModel wm = new WinLotteryModel(); if (curfm.Dbl == 0) { wm.KjLong = nextfm.Dbl; wm.UnitName = "Dbl"; } else if (curfm.Big == 0) { wm.KjLong = nextfm.Big; wm.UnitName = "Big"; } else if (curfm.BigSmall == 0) { wm.KjLong = nextfm.BigSmall; wm.UnitName = "BigSmall"; } else if (curfm.SmallBig == 0) { wm.KjLong = nextfm.SmallBig; wm.UnitName = "SmallBig"; } else if (curfm.Small == 0) { wm.KjLong = nextfm.Small; wm.UnitName = "Small"; } lt.Add(wm); wm = new WinLotteryModel(); if (curfm.Dbl == 0) { wm.KjLong = nextfm.Dbl; wm.UnitName = "Dbl"; } else if (curfm.Odd == 0) { wm.KjLong = nextfm.Odd; wm.UnitName = "Odd"; } else if (curfm.OddPair == 0) { wm.KjLong = nextfm.OddPair; wm.UnitName = "OddPair"; } else if (curfm.PairOdd == 0) { wm.KjLong = nextfm.PairOdd; wm.UnitName = "PairOdd"; } else if (curfm.Pair == 0) { wm.KjLong = nextfm.Pair; wm.UnitName = "Pair"; } lt.Add(wm); return(lt); }
private void refreshMaxTendency(Tendency2Model tm) { int maxValue = 0; string strValue = ""; for (int i = 0; i < this.dgv1.Rows.Count; i++) { for (int j = 2; j < this.dgv1.Columns.Count - 1; j++) { strValue = this.dgv1[j, i].Value.ToString(); if (!string.IsNullOrEmpty(strValue)) { maxValue = Convert.ToInt32(strValue); switch (j) { case 2: if (maxValue == tm.Big) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 3: if (maxValue == tm.Small) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 4: if (maxValue == tm.BigSmall) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 5: if (maxValue == tm.SmallBig) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 7: if (maxValue == tm.Odd) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 8: if (maxValue == tm.Pair) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 9: if (maxValue == tm.OddPair) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 10: if (maxValue == tm.PairOdd) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; case 11: if (maxValue == tm.Dbl) { DgvController.SetDgvBackColorStyle(this.dgv1, i, j, Color.Yellow, 12); } break; default: break; } } } } }
/// <summary> /// 新增二星走势数据 /// </summary> /// <param name="lotterys"></param> public static void SaveTendency2(Tendency2Enum type, List <Tendency2Model> lotterys) { string tableName = getTendency2Table(type); using (SQLiteConnection conn = CreateConnection()) { conn.Open(); SQLiteTransaction trans = conn.BeginTransaction(); string sqlCount = string.Format("SELECT count(1) FROM {0} where Ymd = @Ymd and Sno=@Sno", tableName); try { string sql = null; for (int i = 0; i < lotterys.Count; i++) { Tendency2Model lm = lotterys[i]; int count = conn.Query <int>(sqlCount, lm).FirstOrDefault(); if (count == 0) { ///新增 sql = string.Format("insert into {0}(Ymd ," + @"Sno ," + @"Lottery ," + @"Big ," + @"Small ," + @"BigSmall ," + @"SmallBig ," + @"Odd ," + @"Pair ," + @"OddPair ," + @"PairOdd ," + @"Dbl ," + @"Dtime )" + @" VALUES (" + @"@Ymd ," + @"@Sno ," + @"@Lottery ," + @"@Big ," + @"@Small ," + @"@BigSmall ," + @"@SmallBig ," + @"@Odd ," + @"@Pair ," + @"@OddPair ," + @"@PairOdd ," + @"@Dbl ," + @"@Dtime " + @")", tableName); } else { ///修改 sql = string.Format("Update {0} set Big =@Big ," + "Small =@Small ," + "BigSmall =@BigSmall ," + "SmallBig =@SmallBig ," + "Odd =@Odd ," + "Pair =@Pair ," + "OddPair =@OddPair ," + "PairOdd =@PairOdd ," + "Dbl =@Dbl " + "where Ymd = @Ymd and Sno=@Sno ", tableName); } conn.Execute(sql, lm, trans); } trans.Commit(); } catch (Exception) { trans.Rollback(); } } }
/// <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); }
/// <summary> /// 刷新数据 /// </summary> private void refreshData() { //最新开奖号码 var lt_lotterys = XscpMysqlBLL.QueryLottery(this.date, 1); if (lt_lotterys == null || lt_lotterys.Count == 0) { return; } ///加载最新开奖号 initLottery(lt_lotterys[0]); return; List <Tendency2Model> lt_tendency2 = new List <Tendency2Model>(); ///前二星最最大走势 Tendency2Model maxBefore = XscpMysqlBLL.QueryMaxTendency2(Tendency2Enum.Before, this.date); maxBefore.Sno = "前大"; lt_tendency2.Add(maxBefore); ///前二星最近走势势 var lt_2Before = XscpMysqlBLL.QueryTendency2(Tendency2Enum.Before, this.date, 1); if (lt_2Before != null && lt_2Before.Count > 0) { lt_2Before[0].Sno = "前二"; lt_tendency2.Add(lt_2Before[0]); } ///后二星最近走势势 var lt_2After = XscpMysqlBLL.QueryTendency2(Tendency2Enum.After, this.date, 1); if (lt_2After != null && lt_2After.Count > 0) { lt_2After[0].Sno = "后二"; lt_tendency2.Add(lt_2After[0]); } ///后二星最最大走势 Tendency2Model maxAfter = XscpMysqlBLL.QueryMaxTendency2(Tendency2Enum.After, this.date); maxAfter.Sno = "后大"; lt_tendency2.Add(maxAfter); List <TendencyModel> lt_Tendency = new List <TendencyModel>(); ///前定二星最近走势势 var lt_TenThousand = XscpMysqlBLL.QueryTendency1(Tendency1Enum.TenThousand, this.date, 1); //万位 var lt_Thousand = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Thousand, this.date, 1); //千位 ///后定最近走势势 var lt_Ten = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Ten, this.date, 1); //十位 var lt_One = XscpMysqlBLL.QueryTendency1(Tendency1Enum.One, this.date, 1); //个位 lt_TenThousand[0].Sno = "前定"; lt_Thousand[0].Sno = "前定"; lt_Ten[0].Sno = "后定"; lt_One[0].Sno = "后定"; ///初始化一星 lt_Tendency.Add(lt_TenThousand[0]); lt_Tendency.Add(lt_Thousand[0]); lt_Tendency.Add(lt_Ten[0]); lt_Tendency.Add(lt_One[0]); ///加载最新开奖号 initLottery(lt_lotterys[0]); //添加6行 this.dgvFF.Rows.Add(6); ///初始化一星 initDgvTendency1(lt_Tendency); ///初始化二星 initDgvTendency2(lt_tendency2); }
/// <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); }