article.aspx.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using CB.Framework;
  8. using CB.Data;
  9. using CB.Entity;
  10. using CB.Common;
  11. namespace CB.Web.Kjh.zjgz
  12. {
  13. public partial class article : WebPage
  14. {
  15. /// <summary>
  16. /// 彩种菜单列表
  17. /// </summary>
  18. protected string MenuHtml = "";
  19. /// <summary>
  20. /// 高频菜单
  21. /// </summary>
  22. protected string lotHtml = "";
  23. /// <summary>
  24. /// 地方彩菜单
  25. /// </summary>
  26. protected string hoverHtml = "";
  27. /// <summary>
  28. /// 数字彩菜单
  29. /// </summary>
  30. protected string SzHtml = "";
  31. /// <summary>
  32. /// 规则内容
  33. /// </summary>
  34. protected string ContentHtml = "";
  35. /// <summary>
  36. /// 玩法规则/和中奖规则切换
  37. /// </summary>
  38. protected string SwitchHtml = "";
  39. /// <summary>
  40. /// 页面标题切换
  41. /// </summary>
  42. protected string PageTitle = "";
  43. protected string LotteryName = "";
  44. protected void Page_Load(object sender, EventArgs e)
  45. {
  46. InitData();
  47. }
  48. protected override void InitData()
  49. {
  50. string szclass = "", szl = "lotTitle hover";
  51. string gpclass = "", gpl = "lotTitle";
  52. string dfclass = "", dfl = "lotTitle";
  53. IList<TopicClassInfo> types = Caches.GetTopicClassList(211);
  54. if (types == null || types.Count < 1) return;
  55. foreach (var list in types)//type .OrderByDescending(p=>p.Name.Reverse().ToString())
  56. {
  57. //IList<TopicClassInfo> lists = Caches.GetTopicClassList(type.Cid);
  58. //foreach (var list in lists)
  59. //{
  60. string style = "style='display:none'", ZjgzHtml = "", WfgzHtml = "";
  61. string lclass = "";
  62. if (list.Cid == GetTopicTypeId()) { style = ""; lclass = "class='brline'"; PageTitle = list.Name + "玩法规则"; }
  63. switch (list.Cid)
  64. {
  65. case 225:
  66. SzHtml += "<li><a href='/" + GetUrlPrifix(list.Cid) + "-zjgz/' " + lclass + " onclick='switchL(" + list.Cid + ",this);'>" + list.Name + "</a></li>";
  67. if (lclass != "")
  68. {
  69. szclass = "active";
  70. szl = "lotTitle hover";
  71. }
  72. break;
  73. case 221:
  74. case 230:
  75. case 236:
  76. case 238:
  77. case 240:
  78. case 243:
  79. case 249:
  80. case 254:
  81. case 258:
  82. case 259:
  83. case 262:
  84. hoverHtml += "<li ><a href='/" + GetUrlPrifix(list.Cid) + "-zjgz/' " + lclass + " onclick='switchL(" + list.Cid + ",this);'>" + list.Name + "</a></li>";
  85. if (lclass != "")
  86. {
  87. dfclass = "active";
  88. dfl = "lotTitle hover";
  89. }
  90. break;
  91. case 217:
  92. case 219:
  93. case 220:
  94. case 234:
  95. case 235:
  96. case 239:
  97. case 241:
  98. case 242:
  99. case 244:
  100. case 245:
  101. case 246:
  102. case 247:
  103. case 248:
  104. case 250:
  105. case 251:
  106. case 252:
  107. case 253:
  108. case 255:
  109. case 256:
  110. case 257:
  111. case 260:
  112. case 261:
  113. case 263:
  114. case 264:
  115. case 265:
  116. lotHtml += "<li ><a href='/" + GetUrlPrifix(list.Cid) + "-zjgz/' " + lclass + " onclick='switchL(" + list.Cid + ",this);'>" + list.Name + "</a></li>";
  117. if (lclass != "")
  118. {
  119. gpclass = "active";
  120. gpl = "lotTitle hover";
  121. }
  122. break;
  123. default:
  124. if (list.Cid < 229)
  125. {
  126. SzHtml += "<li><a href='/" + GetUrlPrifix(list.Cid) + "-zjgz/' " + lclass + " onclick='switchL(" + list.Cid + ",this);'>" + list.Name + "</a></li>";
  127. if (lclass != "")
  128. {
  129. szclass = "active";
  130. }
  131. }
  132. break;
  133. }
  134. var items = Caches.GetHelpList(list.Cid);
  135. if (items == null || items.Count < 1) continue;
  136. foreach (var item in items)
  137. {
  138. if (item.Title.IndexOf("玩法规则", StringComparison.Ordinal) > -1)
  139. { WfgzHtml = "<div class='info' id='wfgz_" + list.Cid + "'>" + item.Context + "</div>"; }
  140. else if (item.Title.IndexOf("中奖规则", StringComparison.Ordinal) > -1)
  141. { ZjgzHtml = "<div class='info' style='display:none' id='zjgz_" + list.Cid + "'>" + item.Context + "</div>"; }
  142. }
  143. SwitchHtml += "<div name ='rulel' id='rule_" + list.Cid + "'" + style + ">"
  144. + "<li><a href='javascript:void(0);' class='bbline' onclick=\"switchRule(" + list.Cid + ",'wfgz')\">玩法规则</a></li>"
  145. + "<li><a href='javascript:void(0);' onclick='switchRule(" + list.Cid + ",\"zjgz\")'>中奖规则</a></li></div>";
  146. ContentHtml += "<div name='divl' id='content_" + list.Cid + "'" + style + ">" + WfgzHtml + ZjgzHtml + "</div>";
  147. //}
  148. }
  149. MenuHtml += "<li><span class=\"" + szl + "\">全国彩</span><ul class=\"" + szclass + "\">" + SzHtml + "</ul></li>";
  150. MenuHtml += "<li><span class=\"" + dfl + "\">地方彩</span><ul class=\"" + dfclass + "\">" + hoverHtml + "</ul></li>";
  151. MenuHtml += "<li><span class=\"" + gpl + "\">高频彩</span><ul class=\"" + gpclass + "\">" + lotHtml + "</ul></li>";
  152. base.InitData();
  153. }
  154. /// <summary>
  155. /// 将彩种转换成对应的id
  156. /// </summary>
  157. /// <returns></returns>
  158. private int GetTopicTypeId()
  159. {
  160. string lottery = WRequest.GetQueryString("lottery");
  161. int topicTypeId = 213;
  162. switch (lottery)
  163. {
  164. case "ssq": topicTypeId = 214; LotteryName = "双色球"; break;
  165. case "p5": topicTypeId = 215; LotteryName = "排列五"; break;
  166. case "p3": topicTypeId = 223; LotteryName = "排列三"; break;
  167. case "qxc": topicTypeId = 216; LotteryName = "七星彩"; break;
  168. case "ssc": topicTypeId = 217; LotteryName = "时时彩"; break;
  169. case "qlc": topicTypeId = 218; LotteryName = "七乐彩"; break;
  170. case "qyh": topicTypeId = 219; LotteryName = "群英会"; break;
  171. case "ssl": topicTypeId = 220; LotteryName = "时时乐"; break;
  172. case "hc1": topicTypeId = 221; LotteryName = "好彩1"; break;
  173. case "dlt": topicTypeId = 224; LotteryName = "大乐透"; break;
  174. case "3d":
  175. case "sd": topicTypeId = 213; LotteryName = "福彩3D"; break;
  176. case "df6j1": topicTypeId = 230; LotteryName = "东方6+1"; break;
  177. case "hlj11x5": topicTypeId = 234 ; LotteryName = "黑龙江11选5"; break;
  178. case "tjklsf": topicTypeId = 235; LotteryName = "天津快乐十分"; break;
  179. case "hd15x5": topicTypeId = 236; LotteryName = "华东15选5"; break;
  180. case "zj6j1": topicTypeId = 238; LotteryName = "浙江6+1"; break;
  181. case "js11x5": topicTypeId = 239; LotteryName = "江苏11选5"; break;
  182. case "js7ws": topicTypeId = 240; LotteryName = "江苏7位数"; break;
  183. case "sxklsf": topicTypeId = 241; LotteryName = "山西快乐十分"; break;
  184. case "heb11x5": topicTypeId =242; LotteryName = "河北11选5"; break;
  185. case "hb30x5": topicTypeId = 243; LotteryName = "湖北30选5"; break;
  186. case "gxklsf": topicTypeId = 244; LotteryName = "广西快乐十分"; break;
  187. case "gd11x5": topicTypeId = 245; LotteryName = "广东11选5"; break;
  188. case "zj11x5": topicTypeId = 246; LotteryName = "浙江11选5"; break;
  189. case "gdklsf": topicTypeId = 247; LotteryName = "广东快乐十分"; break;
  190. case "yn11x5": topicTypeId = 248; LotteryName = "云南11选5"; break;
  191. case "hn22x5": topicTypeId = 249; LotteryName = "河南22选5"; break;
  192. case "zjklc": topicTypeId = 250; LotteryName = "浙江快乐彩"; break;
  193. case "jl11x5": topicTypeId = 251; LotteryName = "吉林11选5"; break;
  194. case "jx11x5": topicTypeId = 252; LotteryName = "江西11选5"; break;
  195. case "ln11x5": topicTypeId = 253; LotteryName = "辽宁11选5"; break;
  196. case "xj35x7": topicTypeId = 254; LotteryName = "新疆35选7"; break;
  197. case "sd11x5": topicTypeId = 255; LotteryName = "山东11选5"; break;
  198. case "jsk3": topicTypeId = 256; LotteryName = "江苏快3"; break;
  199. case "lnkl12": topicTypeId = 257; LotteryName = "辽宁快乐12"; break;
  200. case "fj36x7": topicTypeId = 258; LotteryName = "福建36选7"; break;
  201. case "ny36x7": topicTypeId = 259; LotteryName = "南粤36选7"; break;
  202. case "sckl12": topicTypeId = 260; LotteryName = "四川快乐12"; break;
  203. case "hbk3": topicTypeId = 261; LotteryName = "河北快3"; break;
  204. case "fj31x7": topicTypeId = 262; LotteryName = "福建31选7"; break;
  205. case "ahk3": topicTypeId = 263; LotteryName = "安徽快3"; break;
  206. case "jlk3": topicTypeId = 264; LotteryName = "吉林快3"; break;
  207. case "nmgk3": topicTypeId = 265; LotteryName = "内蒙古快3"; break;
  208. case "sdqyh": topicTypeId = 219; LotteryName = "山东群英会"; break;
  209. }
  210. return topicTypeId;
  211. }
  212. /// <summary>
  213. /// id转换对应的页面地址配置
  214. /// </summary>
  215. /// <returns></returns>
  216. private string GetUrlPrifix(int topicTypeId)
  217. {
  218. string prifix = "";
  219. switch (topicTypeId)
  220. {
  221. case 214: prifix = "ssq"; break;
  222. case 215: prifix = "p5"; break;
  223. case 223: prifix = "p3"; break;
  224. case 216: prifix = "qxc"; break;
  225. case 217: prifix = "ssc"; break;
  226. case 218: prifix = "qlc"; break;
  227. case 219: prifix = "sdqyh"; break;//
  228. case 220: prifix = "ssl"; break;
  229. case 221: prifix = "hc1"; break;
  230. case 224: prifix = "dlt"; break;
  231. case 213: prifix = "3d"; break;
  232. case 230: prifix = "df6j1"; break;
  233. case 234: prifix = "hlj11x5"; break;
  234. case 235: prifix = "tjklsf"; break;
  235. case 236: prifix = "hd15x5"; break;
  236. case 238: prifix = "zj6j1"; break;
  237. case 239: prifix = "js11x5"; break;
  238. case 240: prifix = "js7ws"; break;
  239. case 241: prifix = "sxklsf"; break;
  240. case 242: prifix = "heb11x5"; break;
  241. case 243: prifix = "hb30x5"; break;
  242. case 244: prifix = "gxklsf"; break;
  243. case 245: prifix = "gd11x5"; break;
  244. case 246: prifix = "zj11x5"; break;
  245. case 247: prifix = "gdklsf"; break;
  246. case 248: prifix = "yn11x5"; break;
  247. case 249: prifix = "hn22x5"; break;
  248. case 250: prifix = "zjklc"; break;
  249. case 251: prifix = "jl11x5"; break;
  250. case 252: prifix = "jx11x5"; break;
  251. case 253: prifix = "ln11x5"; break;
  252. case 254: prifix = "xj35x7"; break;
  253. case 255: prifix = "sd11x5"; break;
  254. case 256: prifix = "jsk3"; break;
  255. case 257: prifix = "lnkl12"; break;
  256. case 258: prifix = "fj36x7"; break;
  257. case 259: prifix = "ny36x7"; break;
  258. case 260: prifix = "sckl12"; break;
  259. case 261: prifix = "hbk3"; break;
  260. case 262: prifix = "fj31x7"; break;
  261. case 263: prifix = "ahk3"; break;
  262. case 264: prifix = "jlk3"; break;
  263. case 265: prifix = "nmgk3"; break;
  264. // case 219: prifix = "sdqyh"; break;
  265. }
  266. return prifix;
  267. }
  268. }
  269. }