public DF6_1_JOZS_InfoCollection QueryDF6_1_JOZS(int index) { DF6_1_JOZS_InfoCollection Collection = new DF6_1_JOZS_InfoCollection(); var list = this.QueryGameChart <DF6_1_JOZS_Info>(string.Format("QueryDF6_1_JOZS_{0}", index), () => { var infoList = new List <DF6_1_JOZS_Info>(); var entityList = new DF6_1_JOZSManager().QueryDF6_1_JOZS(index); ObjectConvert.ConvertEntityListToInfoList <List <DF6_1_JOZS>, DF6_1_JOZS, List <DF6_1_JOZS_Info>, DF6_1_JOZS_Info>(entityList, ref infoList, () => { return(new DF6_1_JOZS_Info()); }, (entity, info) => { //处理info里面有,页entity里面没有的属性 //info.WinNumber = entity.WinNumber; }); return(infoList); }); Collection.AddRange(list); return(Collection); }
private void AddDF6_1_JOZS(string issuseNumber, string winNumber) { var manager = new DF6_1_JOZSManager(); var issuse = manager.QueryDF6_1_JOZSIssuseNumber(issuseNumber); if (issuse > 0) { return; } var winRed = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); string JO_Proportion = string.Empty; int J = 0; int O = 0; foreach (var item in winRed) { if (Convert.ToInt32(item) % 2 == 0) { O++; } else { J++; } } JO_Proportion = string.Format("{0}:{1}", J, O); var last = manager.QueryLastDF6_1_JOZS(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("CreateTime", DateTime.Now); dic.Add("JO_Proportion", JO_Proportion); var entity = this.CreateNewEntity <DF6_1_JOZS>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("O_JO_")) { var order = p.Name.Replace("O_JO_Proportion", string.Empty); lastValue = JO_Proportion.Replace(":", "") == order ? 0 : lastValue; } if (p.Name == "JO_J") { lastValue = Convert.ToInt32(winRed[0]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO_O") { lastValue = Convert.ToInt32(winRed[0]) % 2 != 0 ? lastValue : 0; } if (p.Name == "JO1_J") { lastValue = Convert.ToInt32(winRed[1]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO1_O") { lastValue = Convert.ToInt32(winRed[1]) % 2 != 0 ? lastValue : 0; } if (p.Name == "JO2_J") { lastValue = Convert.ToInt32(winRed[2]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO2_O") { lastValue = Convert.ToInt32(winRed[2]) % 2 != 0 ? lastValue : 0; } if (p.Name == "JO3_J") { lastValue = Convert.ToInt32(winRed[3]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO3_O") { lastValue = Convert.ToInt32(winRed[3]) % 2 != 0 ? lastValue : 0; } if (p.Name == "JO4_J") { lastValue = Convert.ToInt32(winRed[4]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO4_O") { lastValue = Convert.ToInt32(winRed[4]) % 2 != 0 ? lastValue : 0; } if (p.Name == "JO5_J") { lastValue = Convert.ToInt32(winRed[5]) % 2 != 0 ? 0 : lastValue; } if (p.Name == "JO5_O") { lastValue = Convert.ToInt32(winRed[5]) % 2 != 0 ? lastValue : 0; } return(lastValue); }); manager.AddDF6_1_JOZS(entity); }