/// <summary> /// 和值走势 /// </summary> private void Import_HZ(string issuseNumber, string winNumber) { var manager = new PL5_Manager(); var issuse = manager.QueryPL5_HZIssuseNumber(issuseNumber); if (issuse > 0) { return; } var winRed = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var hz = int.Parse(winRed[0]) + int.Parse(winRed[1]) + int.Parse(winRed[2]) + int.Parse(winRed[3]) + int.Parse(winRed[4]); var last = manager.QueryPL5_HZ(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("CreateTime", DateTime.Now); var entity = this.CreateNewEntity <PL5_HZ>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("HZ_")) { var order = p.Name.Replace("HZ_", string.Empty); lastValue = hz == int.Parse(order) ? 0 : lastValue; } return(lastValue); }); manager.AddPL5_HZ(entity); }
/// <summary> ///查询大小走势列表按时间倒叙 /// </summary> public PL5_DX_InfoCollection QueryPL5_DX(int length) { PL5_DX_InfoCollection Collection = new PL5_DX_InfoCollection(); var list = this.QueryGameChart <PL5_DX_Info>(string.Format("QueryPL5_DX_{0}", length), () => { var infoList = new List <PL5_DX_Info>(); var entityList = new PL5_Manager().QueryPL5_DX(length); ObjectConvert.ConvertEntityListToInfoList <List <PL5_DX>, PL5_DX, List <PL5_DX_Info>, PL5_DX_Info>(entityList, ref infoList, () => { return(new PL5_DX_Info()); }); return(infoList); }); Collection.AddRange(list); return(Collection); }
/// <summary> /// 任选质和走势 /// </summary> private void Import_ZH(string issuseNumber, string winNumber) { var manager = new PL5_Manager(); var issuse = manager.QueryPL5_ZHIssuseNumber(issuseNumber); if (issuse > 0) { return; } var winRed = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var array = new int[] { int.Parse(winRed[0]), int.Parse(winRed[1]), int.Parse(winRed[2]), int.Parse(winRed[3]), int.Parse(winRed[4]) }; #region 质和个数 var zhilist = new int[] { 1, 2, 3, 5, 7 }; var winzhi1 = string.Empty; var winzhi2 = string.Empty; var winzhi3 = string.Empty; var winzhi4 = string.Empty; var winzhi5 = string.Empty; if (zhilist.Contains(array[0])) { winzhi1 = "Z"; } else { winzhi1 = "H"; } if (zhilist.Contains(array[1])) { winzhi2 = "Z"; } else { winzhi2 = "H"; } if (zhilist.Contains(array[2])) { winzhi3 = "Z"; } else { winzhi3 = "H"; } if (zhilist.Contains(array[3])) { winzhi4 = "Z"; } else { winzhi4 = "H"; } if (zhilist.Contains(array[4])) { winzhi5 = "Z"; } else { winzhi5 = "H"; } var arraywinzhi = new string[] { winzhi1, winzhi2, winzhi3, winzhi4, winzhi5 }; var zhiType = string.Join("", arraywinzhi); int ZhiCount = zhiType.Count(p => p == 'Z'); #endregion var last = manager.QueryPL5_ZH(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("ZHqualifying", string.Join("", arraywinzhi)); dic.Add("ZhiHeBi", string.Format("{0}:{1}", ZhiCount, 5 - ZhiCount)); dic.Add("CreateTime", DateTime.Now); var entity = this.CreateNewEntity <PL5_ZH>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("NO1_")) { var order = p.Name.Replace("NO1_", string.Empty); lastValue = arraywinzhi[0] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO2_")) { var order = p.Name.Replace("NO2_", string.Empty); lastValue = arraywinzhi[1] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO3_")) { var order = p.Name.Replace("NO3_", string.Empty); lastValue = arraywinzhi[2] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO4_")) { var order = p.Name.Replace("NO4_", string.Empty); lastValue = arraywinzhi[3] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO5_")) { var order = p.Name.Replace("NO5_", string.Empty); lastValue = arraywinzhi[4] == order ? 0 : lastValue; } if (p.Name.StartsWith("Bi")) { var order = p.Name.Replace("Bi", string.Empty); var bi = order.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries); lastValue = ZhiCount == int.Parse(bi[0]) && 5 - ZhiCount == int.Parse(bi[1]) ? 0 : lastValue; } return(lastValue); }); manager.AddPL5_ZH(entity); }
/// <summary> /// 除3走势 /// </summary> private void Import_Chu3(string issuseNumber, string winNumber) { var manager = new PL5_Manager(); var issuse = manager.QueryPL5_Chu3IssuseNumber(issuseNumber); if (issuse > 0) { return; } var winRed = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var chu3Arrary = new int[] { int.Parse(winRed[0]) % 3, int.Parse(winRed[1]) % 3, int.Parse(winRed[2]) % 3, int.Parse(winRed[3]) % 3, int.Parse(winRed[4]) % 3 }; var count_0 = chu3Arrary.Count(p => p == 0); var count_1 = chu3Arrary.Count(p => p == 1); var count_2 = chu3Arrary.Count(p => p == 2); var last = manager.QueryPL5_Chu3(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("CreateTime", DateTime.Now); dic.Add("Chu3Bi", string.Format("{0}:{1}:{2}", count_0, count_1, count_2)); var entity = this.CreateNewEntity <PL5_Chu3>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("NO1_")) { var order = p.Name.Replace("NO1_", string.Empty); lastValue = chu3Arrary[0] == int.Parse(order) ? 0 : lastValue; } if (p.Name.StartsWith("NO2_")) { var order = p.Name.Replace("NO2_", string.Empty); lastValue = chu3Arrary[1] == int.Parse(order) ? 0 : lastValue; } if (p.Name.StartsWith("NO3_")) { var order = p.Name.Replace("NO3_", string.Empty); lastValue = chu3Arrary[2] == int.Parse(order) ? 0 : lastValue; } if (p.Name.StartsWith("NO4_")) { var order = p.Name.Replace("NO4_", string.Empty); lastValue = chu3Arrary[3] == int.Parse(order) ? 0 : lastValue; } if (p.Name.StartsWith("NO5_")) { var order = p.Name.Replace("NO5_", string.Empty); lastValue = chu3Arrary[4] == int.Parse(order) ? 0 : lastValue; } if (p.Name.StartsWith("Yu0_")) { var order = p.Name.Replace("Yu0_", string.Empty); lastValue = int.Parse(order) == count_0 ? 0 : lastValue; } if (p.Name.StartsWith("Yu1_")) { var order = p.Name.Replace("Yu1_", string.Empty); lastValue = int.Parse(order) == count_1 ? 0 : lastValue; } if (p.Name.StartsWith("Yu2_")) { var order = p.Name.Replace("Yu2_", string.Empty); lastValue = int.Parse(order) == count_2 ? 0 : lastValue; } return(lastValue); }); manager.AddPL5_Chu3(entity); }
/// <summary> /// 任选大小走势 /// </summary> private void Import_DX(string issuseNumber, string winNumber) { var manager = new PL5_Manager(); var issuse = manager.QueryPL5_DXIssuseNumber(issuseNumber); if (issuse > 0) { return; } var winRed = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var array = new int[] { int.Parse(winRed[0]), int.Parse(winRed[1]), int.Parse(winRed[2]), int.Parse(winRed[3]), int.Parse(winRed[4]) }; #region 大小个数 var winxiao1 = string.Empty; var winxiao2 = string.Empty; var winxiao3 = string.Empty; var winxiao4 = string.Empty; var winxiao5 = string.Empty; if (array[0] <= 4) { winxiao1 = "X"; } else { winxiao1 = "D"; } if (array[1] <= 4) { winxiao2 = "X"; } else { winxiao2 = "D"; } if (array[2] <= 4) { winxiao3 = "X"; } else { winxiao3 = "D"; } if (array[3] <= 4) { winxiao4 = "X"; } else { winxiao4 = "D"; } if (array[4] <= 4) { winxiao5 = "X"; } else { winxiao5 = "D"; } var arrayWinXiao = new string[] { winxiao1, winxiao2, winxiao3, winxiao4, winxiao5 }; var XiaoType = string.Join("", arrayWinXiao); int DaCount = XiaoType.Count(p => p == 'D'); #endregion var last = manager.QueryPL5_DX(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("DXqualifying", string.Join("", arrayWinXiao)); dic.Add("DaoXiaoBi", string.Format("{0}:{1}", DaCount, 5 - DaCount)); dic.Add("CreateTime", DateTime.Now); var entity = this.CreateNewEntity <PL5_DX>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("NO1_")) { var order = p.Name.Replace("NO1_", string.Empty); lastValue = arrayWinXiao[0] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO2_")) { var order = p.Name.Replace("NO2_", string.Empty); lastValue = arrayWinXiao[1] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO3_")) { var order = p.Name.Replace("NO3_", string.Empty); lastValue = arrayWinXiao[2] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO4_")) { var order = p.Name.Replace("NO4_", string.Empty); lastValue = arrayWinXiao[3] == order ? 0 : lastValue; } if (p.Name.StartsWith("NO5_")) { var order = p.Name.Replace("NO5_", string.Empty); lastValue = arrayWinXiao[4] == order ? 0 : lastValue; } if (p.Name.StartsWith("Bi")) { var order = p.Name.Replace("Bi", string.Empty); var bi = order.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries); lastValue = DaCount == int.Parse(bi[0]) && 5 - DaCount == int.Parse(bi[1]) ? 0 : lastValue; } return(lastValue); }); manager.AddPL5_DX(entity); }