public void CalculatorUnitWinLottery(List <TendencyUnitModel> lt, string fieldName, string unitName) { TendencyUnitModel curfm; TendencyUnitModel nextfm; Type type = typeof(TendencyUnitModel); int value = -1; WinLotteryModel sm = null; for (int i = 0; i < lt.Count; i++) { curfm = lt[i]; PropertyInfo propertyInfo = Reflection.GetPropertyInfo(type, fieldName); value = Convert.ToInt16(propertyInfo.GetValue(curfm, null)); if (value == 0) { if (i + 1 < lt.Count) { nextfm = lt[i + 1]; sm = new WinLotteryModel(); sm.KjLong = Convert.ToInt16(propertyInfo.GetValue(nextfm, null)); sm.UnitName = unitName; Lt_UnitWinLotterys.Add(sm); } } } }
public void CalculatorCompareWinLottery(List <CompareTwoModel> lt) { Lt_WinLotterys.Clear(); CompareTwoModel curfm; CompareTwoModel nextfm; int value = -1; WinLotteryModel sm = null; for (int i = lt.Count - 1; i >= 1; i--) { curfm = lt[i]; value = curfm.TendencyValue; if (value == 0) { if (i - 1 >= 0) { nextfm = lt[i - 1]; sm = new WinLotteryModel(); sm.KjLong = nextfm.TendencyValue; Lt_WinLotterys.Add(sm); } } } }
private static string getIndex(WinLotteryModel wm) { StringBuilder sb = new StringBuilder(); for (int i = 1; i < Lt_Names.Count; i++) { if (wm.UnitName == Lt_Names[i].EnName) { sb.Append(i + "," + Lt_Names[i].ChName); break; } } return(sb.ToString()); }
public void CalculatorWinLottery(List <Tendency2Model> lt, List <TendencyType> lt_type, string enName) { Lt_WinLotterys.Clear(); Tendency2Model curfm; Tendency2Model nextfm; Type type = typeof(Tendency2Model); int value = -1; WinLotteryModel sm = null; int start = 0; int end = 0; if (enName == "AllOddPair") { start = 1; end = 5; } else if (enName == "AllBigSmall") { start = 5; end = 9; } for (int k = start; k < end; k++) { for (int i = lt.Count - 1; i >= 1; i--) { curfm = lt[i]; PropertyInfo propertyInfo = Reflection.GetPropertyInfo(type, lt_type[k].EnName); value = Convert.ToInt16(propertyInfo.GetValue(curfm, null)); if (value == 0) { if (i - 1 >= 0) { nextfm = lt[i - 1]; sm = new WinLotteryModel(); sm.KjLong = Convert.ToInt16(propertyInfo.GetValue(nextfm, null)); sm.UnitName = lt_type[k].ChName; Lt_WinLotterys.Add(sm); } } } } }
/// <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); }
/// <summary> /// 给统计表添加数据 /// </summary> /// <param name="curFm"></param> /// <param name="nextFm"></param> private static void addStatisticsValue(TendencyModel curfm, TendencyModel nextfm) { WinLotteryModel sm = new WinLotteryModel(); if (nextfm.Dbl == 0) { sm.BigSmallValue = curfm.Dbl; sm.UnitName = "重重"; } else if (nextfm.Big == 0) { sm.BigSmallValue = curfm.Big; sm.UnitName = "大大"; } else if (nextfm.BigSmall == 0) { sm.BigSmallValue = curfm.BigSmall; sm.UnitName = "大小"; } else if (nextfm.SmallBig == 0) { sm.BigSmallValue = curfm.SmallBig; sm.UnitName = "小大"; } else if (nextfm.Small == 0) { sm.BigSmallValue = curfm.Small; sm.UnitName = "小小"; } if (nextfm.Dbl == 0) { sm.BigSmallValue = curfm.Dbl; sm.UnitName += "重重"; } else if (nextfm.Odd == 0) { sm.OddPairValue = curfm.Odd; sm.UnitName += "奇奇"; } else if (nextfm.OddPair == 0) { sm.OddPairValue = curfm.OddPair; sm.UnitName += "奇偶"; } else if (nextfm.PairOdd == 0) { sm.OddPairValue = curfm.PairOdd; sm.UnitName += "偶奇"; } else if (nextfm.Pair == 0) { sm.OddPairValue = curfm.Pair; sm.UnitName += "偶偶"; } //var vs = Lt_WinLotterys.Where(lt => lt.UnitName == sm.UnitName && lt.BigSmallValue == sm.BigSmallValue && lt.OddPairValue == sm.OddPairValue).ToList(); Lt_WinLotterys.Add(sm); //if (vs.Count == 0) //{ // sm.Sum = 1; // Lt_WinLotterys.Add(sm); //} //else //{ // vs.ForEach(l => l.Sum += 1); //} }