private ActionResult lhcHtml(List <LotteryResult> lotteryResult) { StringBuilder numberHtml = new StringBuilder(); numberHtml.Append("<thead><tr><th>期号</th><th>特码</th><th>大小</th><th>单双</th></thead>"); numberHtml.Append("<tbody>"); StringBuilder bigOrSmallHtml = new StringBuilder(); bigOrSmallHtml.Append("<thead><tr><th>期号</th><th>特码</th><th>大小</th><th>单双</th></thead>"); bigOrSmallHtml.Append("<tbody>"); StringBuilder evenOrOddHtml = new StringBuilder(); evenOrOddHtml.Append("<thead><tr><th>期号</th><th>特码</th><th>大小</th><th>单双</th></thead>"); evenOrOddHtml.Append("<tbody>"); //StringBuilder totalHtml = new StringBuilder(); //totalHtml.Append("<thead><tr><th>期号</th><th>总和</th><th>大小</th><th>单双</th><th>龙虎</th></tr></thead>"); //totalHtml.Append("<tbody>"); foreach (var item in lotteryResult) { string expect = item.Expect.Substring(4, 3); string[] code = item.Opencode.Split(','); //if (code[0].Equals("**")) code[0] = "01"; //int sum = int.Parse(code[0]) + int.Parse(code[1]) + int.Parse(code[2]) + int.Parse(code[3]) + int.Parse(code[4]); numberHtml.AppendFormat("<tr><th>{0}</th><th>{1}</th><th>{2}</th><th>{3}</th></tr>", expect, Resp.ConvertlhcNoBoseForOne(code[code.Length - 1]), int.Parse(code[code.Length - 1]) >= 25 ? "大" : "小", int.Parse(code[code.Length - 1]) % 2 == 0 ? "双" : "单"); bigOrSmallHtml.AppendFormat("<tr><th>{0}</th><th>{1}</th><th>{2}</th><th>{3}</th></tr>", expect, Resp.ConvertlhcNoBoseForOne(code[code.Length - 1]), int.Parse(code[code.Length - 1]) >= 25 ? "大" : "小", int.Parse(code[code.Length - 1]) % 2 == 0 ? "双" : "单"); evenOrOddHtml.AppendFormat("<tr><th>{0}</th><th>{1}</th><th>{2}</th><th>{3}</th></tr>", expect, Resp.ConvertlhcNoBoseForOne(code[code.Length - 1]), int.Parse(code[code.Length - 1]) >= 25 ? "大" : "小", int.Parse(code[code.Length - 1]) % 2 == 0 ? "双" : "单"); //string totalMark = "和"; //if (int.Parse(code[0]) > int.Parse(code[4])) //{ // totalMark = "龙"; //} //if (int.Parse(code[0]) < int.Parse(code[4])) //{ // totalMark = "虎"; //} //totalHtml.AppendFormat("<tr><th>{0}</th><th>{1}</th><th>{2}</th><th>{3}</th><th>{4}</th></tr>", expect, sum, sum >= 80 ? "大" : "小", sum % 2 == 0 ? "双" : "单", totalMark); } numberHtml.Append("</tbody>"); bigOrSmallHtml.Append("</tbody>"); evenOrOddHtml.Append("</tbody>"); //totalHtml.Append("</tbody>"); return(Json(new { number = numberHtml.ToString(), bigorSmall = bigOrSmallHtml.ToString(), evenOrOdd = evenOrOddHtml.ToString(), total = "" })); }