/// <summary> /// 组装华东15选记录 /// </summary> /// <param name="data"></param> /// <param name="type"></param> /// <returns></returns> private string AppendHD15X5Result(DataTable data, SCCLottery type) { List <DFCHD15X5HistoryLotteryViewEntity> res = new List <DFCHD15X5HistoryLotteryViewEntity>(); if (data.Rows.Count > 0) { //总共球个数 int total = type.GetEnumText().TryToInt32(); for (int j = 0; j < data.Rows.Count; j++) { //开奖号集合 List <int> openCodeList = new List <int>(); List <string> openCodeListStr = new List <string>(); StringBuilder builder = new StringBuilder(); for (int i = 1; i <= total; i++) { int openCode = data.Rows[j]["OpenCode" + i].TryToInt32(); openCodeList.Add(openCode); openCodeListStr.Add(openCode.ToString()); } builder.Append(GetOpenCodeTemplate(type, openCodeList)); string ac; try { ac = LotteryUtils.GetAC(openCodeListStr.ToArray()).ToString(); } catch (Exception) { ac = ""; } res.Add(new DFCHD15X5HistoryLotteryViewEntity { Term = data.Rows[j]["Term"].ToStringEx(), OpenTime = data.Rows[j]["OpenTime"].TryToDateTimeToString("yyyy-MM-dd"), NormalOpenCode = builder.ToString(), Parity = LotteryUtils.GetJOString(openCodeList, "双", "单"), TheSum = LotteryUtils.GetTheSum(openCodeList, GetSizeRatioSplitNumber(type), GetSumNumberCount(type)), Size = LotteryUtils.GetDXString(openCodeList, 5), ThreeZoneRatio = LotteryUtils.Hd15x5SanQu(openCodeList), SizeRatio = LotteryUtils.GetProportionOfDX(openCodeList, 6), ParityRatio = LotteryUtils.GetProportionOfJO(openCodeList), RatioOf012 = LotteryUtils.GetProportionOf012(openCodeList), Span = LotteryUtils.GetSpan(openCodeList).ToString(), AC = ac }); } } return(res.ToJson()); }
/// <summary> /// 组装公共记录 /// </summary> /// <param name="data"></param> /// <param name="type"></param> /// <returns></returns> private string AppendCommonResult(DataTable data, SCCLottery type) { List <GPC11X5HistoryLotteryViewEntity> res = new List <GPC11X5HistoryLotteryViewEntity>(); if (data.Rows.Count > 0) { //总共球个数 int total = type.GetEnumText().TryToInt32(); for (int j = 0; j < data.Rows.Count; j++) { //开奖号集合 List <int> openCodeList = new List <int>(); StringBuilder builder = new StringBuilder(); for (int i = 1; i <= total; i++) { int openCode = data.Rows[j]["OpenCode" + i].TryToInt32(); openCodeList.Add(openCode); } builder.Append(GetOpenCodeTemplate(type, openCodeList)); res.Add(new GPC11X5HistoryLotteryViewEntity { Term = data.Rows[j]["Term"].ToStringEx(), OpenTime = data.Rows[j]["OpenTime"].TryToDateTimeToString("yyyy-MM-dd HH:mm:ss"), NormalOpenCode = builder.ToString(), Parity = LotteryUtils.GetJOString(openCodeList, "双", "单"), TheSum = LotteryUtils.GetTheSum(openCodeList, 30, GetSumNumberCount(type)), Size = LotteryUtils.GetDXString(openCodeList, 5), SizeRatio = LotteryUtils.GetProportionOfDX(openCodeList, 6), ParityRatio = LotteryUtils.GetProportionOfJO(openCodeList), RatioOf012 = LotteryUtils.GetProportionOf012(openCodeList), Span = LotteryUtils.GetSpan(openCodeList).ToString(), }); } } return(res.ToJson()); }
/// <summary> /// 组装FC3D记录 /// </summary> /// <param name="data"></param> /// <param name="type"></param> /// <returns></returns> private string AppendFC3DResult(DataTable data, SCCLottery type) { List <FC3DHistoryLotteryViewEntity> res = new List <FC3DHistoryLotteryViewEntity>(); if (data.Rows.Count > 0) { //总共球个数 int total = type.GetEnumText().TryToInt32(); for (int j = 0; j < data.Rows.Count; j++) { //开奖号集合 List <int> openCodeList = new List <int>(); StringBuilder builder = new StringBuilder(); for (int i = 1; i <= total; i++) { int openCode = data.Rows[j]["OpenCode" + i].TryToInt32(); openCodeList.Add(openCode); } builder.Append(GetOpenCodeTemplate(type, openCodeList)); res.Add(new FC3DHistoryLotteryViewEntity { Term = data.Rows[j]["Term"].ToStringEx(), OpenTime = data.Rows[j]["OpenTime"].TryToDateTimeToString("yyyy-MM-dd"), NormalOpenCode = builder.ToString(), ShiJiHao = data.Rows[j]["ShiJiHao"].ToStringEx(), KaiJiHao = data.Rows[j]["KaiJiHao"].ToStringEx(), ParityRatio = LotteryUtils.GetProportionOfJO(openCodeList), SizeRatio = LotteryUtils.GetProportionOfDX(openCodeList, 4), Parity = LotteryUtils.GetJOString(openCodeList), TheSum = LotteryUtils.GetTheSum(openCodeList, 14, GetSumNumberCount(type)) }); } } return(res.ToJson()); }