KJApiBLL.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. using Business.KJH;
  2. using Cache;
  3. using Cache.Cache;
  4. using Common;
  5. using JobService;
  6. using KJH55128_Rec.Business.TrendChart;
  7. using KJH55128_Rec.ViewModels;
  8. using Models;
  9. using Models.Entity.LotteryNumDB;
  10. using Models.Views;
  11. using Newtonsoft.Json;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Linq;
  15. using System.Web;
  16. namespace KJH55128_Rec.Business
  17. {
  18. public static class KJApiBLL
  19. {
  20. // private static LogHelper log = null;
  21. static KJApiBLL()
  22. {
  23. JobMange jobMange= new JobMange();
  24. jobMange.JobStart();
  25. // log = new LogHelper();
  26. }
  27. public static List<LotteryData> GetLottery()
  28. {
  29. List<LotteryData> list = new List<LotteryData>();
  30. try
  31. {
  32. list = LotteryCache.GetLottery();
  33. }
  34. catch (Exception ee)
  35. {
  36. LogHelper.Error(typeof(KJApiBLL), ee.Message + "GetLottery");
  37. }
  38. return list;
  39. }
  40. public static LotteryData GetLottery(string typename)
  41. {
  42. return LotteryCache.GetLottery(typename);
  43. }
  44. public static KaijiangDetailsEntity GetKaijiangEntity(string type, string id)
  45. {
  46. try
  47. {
  48. return KJBLL.GetKaijiangEntity(type, id);
  49. }
  50. catch (Exception ee)
  51. {
  52. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":GetKaijiangEntity(string type, string id)");
  53. return null;
  54. }
  55. }
  56. /// <summary>
  57. /// 获取几天以内的开奖历史数据
  58. /// </summary>
  59. /// <param name="lotterytype"></param>
  60. /// <param name="day"></param>
  61. /// <returns></returns>
  62. public static List<LotteryViewModel> GetLotteryList(string lotterytype, int day, int num,
  63. string order, Dictionary<string, Object> param, int count = 0, Boolean isdesc = true,bool kjhOrsjh = false)
  64. {
  65. try
  66. {
  67. Dictionary<string, Object> dict = new Dictionary<string, object>();
  68. List<LotteryData> data = new List<LotteryData>();
  69. if (day > 0)
  70. {
  71. data = LotteryCache.GetLotteryList(lotterytype, day);
  72. }
  73. else if (count > 0)
  74. {
  75. data = LotteryCache.GetTopNumList(lotterytype, order, count, isdesc);
  76. }
  77. else
  78. {
  79. data = LotteryCache.GetLotteryList(lotterytype, param);
  80. }
  81. List<LotteryViewModel> result = new List<LotteryViewModel>();
  82. List<LotteryViewModel.LotteryDetail> detaillist = new List<LotteryViewModel.LotteryDetail>();
  83. for (int i = 0; i < data.Count; i++)
  84. {
  85. LotteryViewModel tmp = new LotteryViewModel()
  86. {
  87. NextOpenTime = data[i].NextOpenTime,
  88. MoneyPond = data[i].MoneyPond,
  89. OpenTime = data[i].OpenTime,
  90. SkipDate = data[i].SkipDate,
  91. StartHour = data[i].StartHour,
  92. StartMinute = data[i].StartMinute,
  93. MoneyCount = data[i].MoneyCount,
  94. TimesPerDay = data[i].TimesPerDay,
  95. RedBall = data[i].RedBall,
  96. RuleId = data[i].RuleId,
  97. MenuName = data[i].MenuName,
  98. LotteryName = data[i].LotteryName,
  99. KJTime = data[i].KJTime,
  100. LotteryText = data[i].LotteryText,
  101. LotteryType = data[i].LotteryType,
  102. KaiJiHao = data[i].KaiJiHao,
  103. Interval = data[i].Interval,
  104. ShiJiHao = data[i].ShiJiHao,
  105. BallCount = data[i].BallCount,
  106. BlueBall = data[i].BlueBall,
  107. DaXiaoZJZ = data[i].DaXiaoZJZ,
  108. Term = data[i].Term,
  109. HasLotteryZS = data[i].HasLotteryZS,
  110. Details = null,
  111. ID = data[i].ID,
  112. ZhongZhi = 14,
  113. HKBall = HongKongHelper.GetHongKongLotteryAttr(data[i].RedBall.ToList())
  114. };
  115. var lottery = Enum.Parse(typeof(SCCLottery), data[i].LotteryType);
  116. var lotteryttext = EnumHelper.GetLotteryText((SCCLottery)lottery);
  117. tmp.LotteryText = lotteryttext;
  118. var detials = data[i].Details;
  119. //tmp.Results = reslist as List<LotteryViewModel.LotteryResults>;
  120. //开奖详情转换
  121. if (data[i].ResultsList != null)
  122. {
  123. var enumer = data[i].ResultsList.GetEnumerator();
  124. List<LotteryViewModel.LotteryResults> tmpresult = new List<LotteryViewModel.LotteryResults>();
  125. while (enumer.MoveNext())
  126. {
  127. LotteryViewModel.LotteryResults tmplr = new LotteryViewModel.LotteryResults()
  128. {
  129. Count = enumer.Current.Count,
  130. LevelName = enumer.Current.LevelName,
  131. Money = enumer.Current.Money
  132. };
  133. tmpresult.Add(tmplr);
  134. }
  135. tmp.Results = tmpresult;//开奖内容添加进去
  136. }
  137. foreach (var item in detials)
  138. {
  139. if (item.Label == "大小比")
  140. {
  141. tmp.daxiao = item.Value;
  142. }
  143. else if (item.Label == "三区比")
  144. {
  145. tmp.sanqu = item.Value;
  146. }
  147. else if (item.Label == "012路个数比")
  148. {
  149. tmp.zotgsb = item.Value;
  150. }
  151. else if (item.Label == "大小形态")
  152. {
  153. tmp.dxxt = String.Join(",", item.Value.ToCharArray());
  154. }
  155. else if (item.Label == "奇偶形态")
  156. {
  157. tmp.jioxt = String.Join(",", item.Value.ToCharArray());
  158. }
  159. else if (item.Label == "质合比")
  160. {
  161. tmp.zihebi = item.Value;
  162. }
  163. else if (item.Label == "奇偶比")
  164. {
  165. tmp.jio = item.Value;
  166. }
  167. else if (item.Label == "跨度")
  168. {
  169. tmp.kuadu = item.Value;
  170. }
  171. else if (item.Label == "和值")
  172. {
  173. tmp.hezhi = item.Value;
  174. }
  175. else
  176. {
  177. LotteryViewModel.LotteryDetail tmpd = new LotteryViewModel.LotteryDetail()
  178. {
  179. Label = item.Label,
  180. Value = item.Value
  181. };
  182. detaillist.Add(tmpd);
  183. }
  184. }
  185. tmp.Details = detaillist;
  186. detaillist = new List<LotteryViewModel.LotteryDetail>();
  187. if (lotterytype == SCCLottery.QG_FCSSQ.ToString())
  188. {
  189. tmp.shama = @"http://zx.55128.cn/ssq/ssqyc_list/42.htm";
  190. tmp.danma = @"http://zx.55128.cn/ssq/ssqdm_list/52.htm";
  191. tmp.zoushi = @"http://www.55128.cn/zs/4_26.htm";
  192. tmp.gongju = @"http://www.55128.cn/tool/ssq_ss.aspx";
  193. }
  194. if (lotterytype == SCCLottery.QG_FC3D.ToString())
  195. {
  196. tmp.shama = @"http://zx.55128.cn/3dsm/38.htm";
  197. tmp.danma = @"http://zx.55128.cn/3ddm/29.htm";
  198. tmp.zoushi = @"http://www.55128.cn/zs/1_1.htm";
  199. tmp.gongju = @"http://www.55128.cn/tool/3dss.aspx";
  200. tmp.yuce = @"http://zx.55128.cn/3d/3dyc_list/15.htm";
  201. }
  202. if (lotterytype == SCCLottery.QG_TCP3.ToString())
  203. {
  204. tmp.shama = @"http://zx.55128.cn/p3/p3sm_list/40.htm";
  205. tmp.danma = @"http://zx.55128.cn/p3/p3dm_list/48.htm";
  206. tmp.zoushi = @"http://www.55128.cn/zs/2_14.htm";
  207. tmp.gongju = @"http://www.55128.cn/tool/p3ss.aspx";
  208. tmp.yuce = "http://zx.55128.cn/p3/p3yc_list/23.htm";
  209. }
  210. if (lotterytype == SCCLottery.QG_TCDLT.ToString())
  211. {
  212. tmp.zoushi = @"http://www.55128.cn/zs/12_96.htm";
  213. tmp.gongju = @"http://www.55128.cn/tool/dlt_qss.aspx";
  214. }
  215. result.Add(tmp);
  216. }
  217. return result;
  218. }
  219. catch (Exception ee)
  220. {
  221. return null;
  222. }
  223. }
  224. public static List<LotteryKaiJiHaoAdShijihaoHModel> GetLotteryListKaiJiHao(string lotterytype, int day, int num, string order, Dictionary<string, Object> param, int count = 0, Boolean isdesc = true)
  225. {
  226. var data = GetLotteryList(lotterytype, day, num, order, param, count, isdesc,true);
  227. if (data== null)
  228. {
  229. return new List<LotteryKaiJiHaoAdShijihaoHModel>();
  230. }
  231. List<LotteryKaiJiHaoAdShijihaoHModel> list = new List<LotteryKaiJiHaoAdShijihaoHModel>();
  232. foreach (var item in data)
  233. {
  234. KaiJiHaoAdShijihaoHModel kaijianghao = new KaiJiHaoAdShijihaoHModel()
  235. {
  236. BallCount = item.BallCount,
  237. BlueBall = item.BlueBall,
  238. daxiao = item.daxiao,
  239. Details = item.Details,
  240. HasLotteryZS = item.HasLotteryZS,
  241. hezhi = item.hezhi,
  242. ID = item.ID,
  243. jio = item.jio,
  244. LotteryName = item.LotteryName,
  245. LotteryText = item.LotteryText,
  246. LotteryType = item.LotteryType,
  247. MenuName = item.MenuName,
  248. NextOpenTime = item.NextOpenTime,
  249. OpenTime = item.OpenTime,
  250. RedBall = item.RedBall,
  251. RuleId = item.RuleId,
  252. Term = item.Term,
  253. yuce = item.yuce,
  254. ZhongZhi = item.ZhongZhi,
  255. KJTime=item.KJTime
  256. };
  257. List<LotteryViewModel.LotteryDetail> detaillist = new List<LotteryViewModel.LotteryDetail>();
  258. KaiJiHaoAdShijihaoHModel kaijihao = new KaiJiHaoAdShijihaoHModel();
  259. if (!string.IsNullOrEmpty(item.KaiJiHao))
  260. {
  261. var ary = Array.ConvertAll<string, int>(item.KaiJiHao.Split(',').ToArray(), s => int.Parse(s));
  262. var item2 = KJBLL.GetLotteryData(lotterytype, int.Parse(item.Term.ToString()), DateTime.Parse(item.OpenTime), item.ID, ary, null, "", item.KaiJiHao == null ? "" : item.KaiJiHao == null ? "" : item.KaiJiHao, item.ShiJiHao);
  263. kaijihao = new KaiJiHaoAdShijihaoHModel()
  264. {
  265. BallCount = item2.BallCount,
  266. BlueBall = item2.BlueBall,
  267. // daxiao = item2.daxiao,
  268. //Details = item2.Details,
  269. HasLotteryZS = item2.HasLotteryZS,
  270. //hezhi = item2.hezhi,
  271. ID = item2.ID,
  272. // jio = item2.jio,
  273. LotteryName = item2.LotteryName,
  274. LotteryText = item2.LotteryText,
  275. LotteryType = item2.LotteryType,
  276. MenuName = item2.MenuName,
  277. NextOpenTime = item2.NextOpenTime,
  278. OpenTime = item2.OpenTime,
  279. RedBall = item2.RedBall,
  280. RuleId = item2.RuleId,
  281. Term = item2.Term,
  282. // yuce = item2.yuce,
  283. ZhongZhi = 14
  284. };
  285. var detials = item2.Details;
  286. foreach (var itemdetials in detials)
  287. {
  288. if (itemdetials.Label == "大小比")
  289. {
  290. kaijihao.daxiao = itemdetials.Value;
  291. }
  292. else if (itemdetials.Label == "奇偶比")
  293. {
  294. kaijihao.jio = itemdetials.Value;
  295. }
  296. else if (itemdetials.Label == "和值")
  297. {
  298. kaijihao.hezhi = itemdetials.Value;
  299. }
  300. else
  301. {
  302. LotteryViewModel.LotteryDetail tmpd = new LotteryViewModel.LotteryDetail()
  303. {
  304. Label = itemdetials.Label,
  305. Value = itemdetials.Value
  306. };
  307. detaillist.Add(tmpd);
  308. }
  309. }
  310. kaijihao.Details = detaillist;
  311. }
  312. detaillist = new List<LotteryViewModel.LotteryDetail>();
  313. list.Add(new LotteryKaiJiHaoAdShijihaoHModel() { Kaijianghao = kaijianghao, Kaijihao = kaijihao });
  314. }
  315. return list;
  316. }
  317. public static List<LotteryKaiJiHaoAdShijihaoHModel> GetLotteryListShiJiHao(string lotterytype, int day, int num, string order, Dictionary<string, Object> param, int count = 0, Boolean isdesc = true)
  318. {
  319. try
  320. {
  321. var data = GetLotteryList(lotterytype, day, num, order, param, count, isdesc, true);
  322. List<LotteryKaiJiHaoAdShijihaoHModel> list = new List<LotteryKaiJiHaoAdShijihaoHModel>();
  323. foreach (var item in data)
  324. {
  325. KaiJiHaoAdShijihaoHModel kaijianghao = new KaiJiHaoAdShijihaoHModel()
  326. {
  327. BallCount = item.BallCount,
  328. BlueBall = item.BlueBall,
  329. daxiao = item.daxiao,
  330. Details = item.Details,
  331. HasLotteryZS = item.HasLotteryZS,
  332. hezhi = item.hezhi,
  333. ID = item.ID,
  334. jio = item.jio,
  335. LotteryName = item.LotteryName,
  336. LotteryText = item.LotteryText,
  337. LotteryType = item.LotteryType,
  338. MenuName = item.MenuName,
  339. NextOpenTime = item.NextOpenTime,
  340. OpenTime = item.OpenTime,
  341. RedBall = item.RedBall,
  342. RuleId = item.RuleId,
  343. Term = item.Term,
  344. yuce = item.yuce,
  345. ZhongZhi = item.ZhongZhi,
  346. KJTime = item.KJTime
  347. };
  348. KaiJiHaoAdShijihaoHModel shijihao = new KaiJiHaoAdShijihaoHModel();
  349. List<LotteryViewModel.LotteryDetail> detaillist = new List<LotteryViewModel.LotteryDetail>();
  350. if (!string.IsNullOrEmpty(item.ShiJiHao))
  351. {
  352. var ary = Array.ConvertAll<string, int>(item.ShiJiHao.Split(',').ToArray(), s => int.Parse(s));
  353. var item2 = KJBLL.GetLotteryData(lotterytype, int.Parse(item.Term.ToString()), DateTime.Parse(item.OpenTime), item.ID, ary, null, "", item.KaiJiHao == null ? "" : item.KaiJiHao == null ? "" : item.KaiJiHao, item.ShiJiHao);
  354. shijihao = new KaiJiHaoAdShijihaoHModel()
  355. {
  356. BallCount = item2.BallCount,
  357. BlueBall = item2.BlueBall,
  358. // daxiao = item2.daxiao,
  359. //Details = item2.Details,
  360. HasLotteryZS = item2.HasLotteryZS,
  361. //hezhi = item2.hezhi,
  362. ID = item2.ID,
  363. // jio = item2.jio,
  364. LotteryName = item2.LotteryName,
  365. LotteryText = item2.LotteryText,
  366. LotteryType = item2.LotteryType,
  367. MenuName = item2.MenuName,
  368. NextOpenTime = item2.NextOpenTime,
  369. OpenTime = item2.OpenTime,
  370. RedBall = item2.RedBall,
  371. RuleId = item2.RuleId,
  372. Term = item2.Term,
  373. // yuce = item2.yuce,
  374. ZhongZhi = 14
  375. };
  376. var detials = item2.Details;
  377. foreach (var itemdetials in detials)
  378. {
  379. if (itemdetials.Label == "大小比")
  380. {
  381. shijihao.daxiao = itemdetials.Value;
  382. }
  383. else if (itemdetials.Label == "奇偶比")
  384. {
  385. shijihao.jio = itemdetials.Value;
  386. }
  387. else if (itemdetials.Label == "和值")
  388. {
  389. shijihao.hezhi = itemdetials.Value;
  390. }
  391. else
  392. {
  393. LotteryViewModel.LotteryDetail tmpd = new LotteryViewModel.LotteryDetail()
  394. {
  395. Label = itemdetials.Label,
  396. Value = itemdetials.Value
  397. };
  398. detaillist.Add(tmpd);
  399. }
  400. }
  401. shijihao.Details = detaillist;
  402. }
  403. detaillist = new List<LotteryViewModel.LotteryDetail>();
  404. list.Add(new LotteryKaiJiHaoAdShijihaoHModel() { Kaijianghao = kaijianghao, Shijihao = shijihao });
  405. }
  406. return list;
  407. }
  408. catch (Exception ee)
  409. {
  410. LogHelper.Error(typeof(KJApiBLL), ee.Message + "GetLotteryListShiJiHao");
  411. return null;
  412. }
  413. }
  414. /// <summary>
  415. /// 彩票类型集合
  416. /// </summary>
  417. /// <returns></returns>
  418. public static List<LotteryType> TypeList()
  419. {
  420. try
  421. {
  422. List<LotteryType> list = new List<LotteryType>();
  423. list = LotteryCache.GetLotteryType();
  424. return list;
  425. }
  426. catch (Exception ee)
  427. {
  428. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":TypeList");
  429. return null;
  430. }
  431. }
  432. /// <summary>
  433. /// 彩种集合(包括倒计时、推荐链接)
  434. /// </summary>
  435. /// <param name="types">筛选彩种</param>
  436. /// <returns>得到筛选彩种集合</returns>
  437. public static List<LotteryData> GetLotteryAdTJ(List<string> types)
  438. {
  439. try
  440. {
  441. List<LotteryData> list = new List<LotteryData>();
  442. var data = LotteryCache.GetLotteryListAdKjTimeCache();
  443. list = data.Where(w => types.Contains(w.LotteryType)).ToList();
  444. //添加走势图
  445. var datadetails = DataItemDetailCache.GetDataItemModelDetailCache();
  446. for (int i = 0; i < list.Count; i++)
  447. {
  448. string type = list[i].LotteryType;
  449. EnumZXCid typezs;
  450. if (Enum.TryParse<EnumZXCid>(type, out typezs))
  451. {
  452. if (list[i].MenuName == "qgc")
  453. {
  454. var tools = TrendChastApiBLL.GetTrendChartChache( (int)typezs,(int)EnumZXTid.工具);
  455. var zoushis = TrendChastApiBLL.GetTrendChartChache((int)typezs, (int)EnumZXTid.走势图);
  456. zoushis.AddRange(tools);
  457. List<TrendChartIem> trs = new List<TrendChartIem>();
  458. foreach (var item in zoushis)
  459. {
  460. if ( !string.IsNullOrEmpty(item.Url) && (!item.Name.Contains("手机")))
  461. {
  462. TrendChartIem tmp = new TrendChartIem()
  463. {
  464. Text = item.Name,
  465. UrlStr = item.Url,
  466. };
  467. trs.Add(tmp);
  468. }
  469. }
  470. list[i].Charts = trs;
  471. }
  472. else
  473. {
  474. var zoushis = TrendChastApiBLL.GetTrendChartChache((int)typezs, (int)EnumZXTid.走势图);
  475. List<TrendChartIem> trs = new List<TrendChartIem>();
  476. foreach (var item in zoushis)
  477. {
  478. if (!string.IsNullOrEmpty(item.Url)&&(!item.Name.Contains("手机")))
  479. {
  480. TrendChartIem tmp = new TrendChartIem()
  481. {
  482. Text = item.Name,
  483. UrlStr = item.Url,
  484. };
  485. trs.Add(tmp);
  486. }
  487. }
  488. list[i].Charts = trs;
  489. }
  490. }
  491. //添加sortcode
  492. if (ZSlotterType.TypeOfNameDict.Keys.Contains(list[i].LotteryType))
  493. {
  494. var sort=datadetails.SingleOrDefault(w => w.ItemValue == ZSlotterType.TypeOfNameDict[list[i].LotteryType]);
  495. if (sort != null)
  496. {
  497. list[i].SortCode = sort.SortCode.Value;
  498. }
  499. }
  500. }
  501. //foreach (string type in types)
  502. //{
  503. // LotteryData temp = new LotteryData();
  504. // temp = data.Find(d => d.LotteryType == type);
  505. // list.Add(temp);
  506. //}
  507. return list.OrderBy(d=>d.SortCode).ToList();
  508. }
  509. catch (Exception ee)
  510. {
  511. LogHelper.Error(typeof(KJApiBLL), "GetLotteryAdTJ" + ee.Message);
  512. return null;
  513. }
  514. }
  515. /// <summary>
  516. /// 某个彩种(包括倒计时、推荐链接)详情
  517. /// </summary>
  518. /// <param name="type">筛选彩种code</param>
  519. /// <returns>得到筛选彩种的详情</returns>
  520. public static LotteryData GetLotteryAdTJ(string type)
  521. {
  522. try
  523. {
  524. //LotteryData model = new LotteryData();
  525. //var data = LotteryCache.GetLotteryListAdKjTimeCache().ToList();
  526. //model = data.FirstOrDefault(d => d.LotteryType == type);
  527. //return model;
  528. return LotteryCache.GetLotteryListAdKjTimeCache(type);
  529. }
  530. catch (Exception ee)
  531. {
  532. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":GetLotteryAdTJ(string type)");
  533. return null;
  534. }
  535. }
  536. /// <summary>
  537. /// header数据组装
  538. /// </summary>
  539. /// <returns></returns>
  540. public static List<ViewLotteryType> getHeaderNav()
  541. {
  542. List<ViewLotteryType> data = new List<ViewLotteryType>();
  543. try
  544. {
  545. var list = TypeList();
  546. //全国彩
  547. //var qgc = list.Where(d => d.MenuName == "qgc")
  548. // .Select(d => new LotteryItems(d.Name, "qgc", d.TypeCode, d.ZSTypeCode))
  549. // .ToList();
  550. ////地方彩
  551. //var dfc = list.Where(d => d.MenuName == "dfc")
  552. // .Select(d => new LotteryItems(d.Name, "dfc", d.TypeCode, d.ZSTypeCode))
  553. // .ToList();
  554. ////11x5
  555. //var l11x5 = list.Where(d => d.MenuName == "c11x5")
  556. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  557. // .ToList();
  558. ////k3
  559. //var lk3 = list.Where(d => d.MenuName == "k3")
  560. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  561. // .ToList();
  562. ////kl12
  563. //var lKL12 = list.Where(d => d.MenuName == "kl12")
  564. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  565. // .ToList();
  566. ////klsf
  567. //var lKLSF = list.Where(d => d.MenuName == "klsf")
  568. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  569. // .ToList();
  570. ////时时彩
  571. //var ssc = list.Where(d => d.MenuName == "ssc")
  572. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  573. // .ToList();
  574. //其他彩
  575. //var qtc = list.Where(d => d.MenuName == "qt")
  576. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  577. // .ToList();
  578. List<LotteryItems> qgcc = new List<LotteryItems>();
  579. List<LotteryItems> dfcc = new List<LotteryItems>();
  580. List<LotteryItems> qtcc = new List<LotteryItems>();
  581. List<LotteryItems> sscc = new List<LotteryItems>();
  582. List<LotteryItems> lKLSFc = new List<LotteryItems>();
  583. List<LotteryItems> lKL12c = new List<LotteryItems>();
  584. List<LotteryItems> lk3c = new List<LotteryItems>();
  585. List<LotteryItems> l11x5c = new List<LotteryItems>();
  586. if (list!=null)
  587. {
  588. foreach (var item in list)
  589. {
  590. if (item.MenuName== "qgc")
  591. {
  592. LotteryItems tmp = new LotteryItems(item.Name, "qgc", item.TypeCode, item.ZSTypeCode);
  593. qgcc.Add(tmp);
  594. }
  595. if (item.MenuName == "dfc")
  596. {
  597. LotteryItems tmp = new LotteryItems(item.Name, "dfc", item.TypeCode, item.ZSTypeCode);
  598. dfcc.Add(tmp);
  599. }
  600. if (item.MenuName == "c11x5")
  601. {
  602. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  603. l11x5c.Add(tmp);
  604. }
  605. if (item.MenuName == "k3")
  606. {
  607. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  608. lk3c.Add(tmp);
  609. }
  610. if (item.MenuName == "kl12")
  611. {
  612. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  613. lKL12c.Add(tmp);
  614. }
  615. if (item.MenuName == "klsf")
  616. {
  617. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  618. lKLSFc.Add(tmp);
  619. }
  620. if (item.MenuName == "ssc")
  621. {
  622. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  623. sscc.Add(tmp);
  624. }
  625. if (item.MenuName == "qt")
  626. {
  627. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  628. qtcc.Add(tmp);
  629. }
  630. }
  631. }
  632. data.Add(new ViewLotteryType("全国彩", "QGC", qgcc));
  633. data.Add(new ViewLotteryType("地方彩", "DFC", dfcc));
  634. data.Add(new ViewLotteryType("11选5", "GPC11X5", l11x5c));
  635. data.Add(new ViewLotteryType("快3", "GPCK3", lk3c));
  636. data.Add(new ViewLotteryType("快乐十二", "GPCKL12", lKL12c));
  637. data.Add(new ViewLotteryType("快乐十分", "GPCKLSF", lKLSFc));
  638. data.Add(new ViewLotteryType("时时彩", "GPCSSC", sscc));
  639. data.Add(new ViewLotteryType("其他彩种", "GPCQTC", qtcc));
  640. }
  641. catch (Exception ee)
  642. {
  643. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":getHeaderNav");
  644. }
  645. return data;
  646. }
  647. /// <summary>
  648. /// 获取页面TDK
  649. /// </summary>
  650. /// <param name="TDKType"></param>
  651. /// <returns></returns>
  652. public static TDKModel GetTDK(string TDKType)
  653. {
  654. try
  655. {
  656. var query = TDKDataCache.GetTDKId(TDKType);
  657. if (query != null)
  658. {
  659. TDKModel tdk = new TDKModel();
  660. tdk.Description = query.Description;
  661. tdk.Keywords = query.Keywords;
  662. tdk.Title = query.Title;
  663. tdk.Tags = query.Tags;
  664. return tdk;
  665. }
  666. return null;
  667. }
  668. catch (Exception e)
  669. {
  670. LogHelper.Error(typeof(KJApiBLL), "GetTDK" + e.Message);
  671. return null;
  672. }
  673. }
  674. }
  675. }