/// <summary> /// 添加基本走势 /// </summary> private void AddHC1_JBZS(string issuseNumber, string winNumber) { var manager = new HC1_JBZSManager(); var issuse = manager.QueryHC1_JBZSIssuseNumber(issuseNumber); if (issuse > 0) { return; } var last = manager.QueryLastHC1_JBZS(); var dic = new Dictionary <string, object>(); dic.Add("IssuseNumber", issuseNumber); dic.Add("WinNumber", winNumber); dic.Add("CreateTime", DateTime.Now); var entity = this.CreateNewEntity <HC1_JBZS>(dic, (p) => { //取上一期的数据+1 var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1); //判断有没有开出此号 if (p.Name.StartsWith("Red_")) { var order = p.Name.Replace("Red_", string.Empty); lastValue = winNumber == order ? 0 : lastValue; } return(lastValue); }); manager.AddHC1_JBZS(entity); }
public HC1_JBZS_InfoCollection QueryHC1_JBZS(int index) { HC1_JBZS_InfoCollection Collection = new HC1_JBZS_InfoCollection(); var list = this.QueryGameChart <HC1_JBZS_Info>(string.Format("QueryHC1_JBZS_{0}", index), () => { var infoList = new List <HC1_JBZS_Info>(); var entityList = new HC1_JBZSManager().QueryHC1_JBZS(index); ObjectConvert.ConvertEntityListToInfoList <List <HC1_JBZS>, HC1_JBZS, List <HC1_JBZS_Info>, HC1_JBZS_Info>(entityList, ref infoList, () => { return(new HC1_JBZS_Info()); }, (entity, info) => { //处理info里面有,页entity里面没有的属性 //info.WinNumber = entity.WinNumber; }); return(infoList); }); Collection.AddRange(list); return(Collection); }