KJApiBLL.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. using Business.KJH;
  2. using Cache;
  3. using Common;
  4. using JobService;
  5. using KJH55128_Rec.Business.TrendChart;
  6. using KJH55128_Rec.ViewModels;
  7. using Models;
  8. using Models.Entity.LotteryNumDB;
  9. using Models.Views;
  10. using Newtonsoft.Json;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. using System.Web;
  15. namespace KJH55128_Rec.Business
  16. {
  17. public static class KJApiBLL
  18. {
  19. // private static LogHelper log = null;
  20. static KJApiBLL()
  21. {
  22. JobMange jobMange= new JobMange();
  23. jobMange.JobStart();
  24. // log = new LogHelper();
  25. }
  26. public static List<LotteryData> GetLottery()
  27. {
  28. List<LotteryData> list = new List<LotteryData>();
  29. try
  30. {
  31. list = AppCtrl.GetObj().GetLotteryCache().GetLottery();
  32. }
  33. catch (Exception ee)
  34. {
  35. LogHelper.Error(typeof(KJApiBLL), ee.Message + "GetLottery");
  36. }
  37. return list;
  38. }
  39. public static LotteryData GetLottery(string typename)
  40. {
  41. return AppCtrl.GetObj().GetLotteryCache().GetLottery(typename);
  42. }
  43. public static KaijiangDetailsEntity GetKaijiangEntity(string type, string id)
  44. {
  45. try
  46. {
  47. return KJBLL.GetKaijiangEntity(type, id);
  48. }
  49. catch (Exception ee)
  50. {
  51. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":GetKaijiangEntity(string type, string id)");
  52. return null;
  53. }
  54. }
  55. /// <summary>
  56. /// 获取几天以内的开奖历史数据
  57. /// </summary>
  58. /// <param name="lotterytype"></param>
  59. /// <param name="day"></param>
  60. /// <returns></returns>
  61. public static List<LotteryViewModel> GetLotteryList(string lotterytype, int day, int num,
  62. string order, Dictionary<string, Object> param, int count = 0, Boolean isdesc = true,bool kjhOrsjh = false)
  63. {
  64. try
  65. {
  66. Dictionary<string, Object> dict = new Dictionary<string, object>();
  67. List<LotteryData> data = new List<LotteryData>();
  68. if (day > 0)
  69. {
  70. data = AppCtrl.GetObj().GetLotteryCache().GetLotteryList(lotterytype, day);
  71. }
  72. else if (count > 0)
  73. {
  74. data = AppCtrl.GetObj().GetLotteryCache().GetTopNumList(lotterytype, order, count, isdesc);
  75. }
  76. else
  77. {
  78. data = AppCtrl.GetObj().GetLotteryCache().GetLotteryList(lotterytype, param);
  79. }
  80. List<LotteryViewModel> result = new List<LotteryViewModel>();
  81. List<LotteryViewModel.LotteryDetail> detaillist = new List<LotteryViewModel.LotteryDetail>();
  82. for (int i = 0; i < data.Count; i++)
  83. {
  84. LotteryViewModel tmp = new LotteryViewModel();
  85. tmp.NextOpenTime = data[i].NextOpenTime;
  86. tmp.MoneyPond = data[i].MoneyPond;
  87. tmp.OpenTime = data[i].OpenTime;
  88. tmp.SkipDate = data[i].SkipDate;
  89. tmp.StartHour = data[i].StartHour;
  90. tmp.StartMinute = data[i].StartMinute;
  91. tmp.MoneyCount = data[i].MoneyCount;
  92. tmp.TimesPerDay = data[i].TimesPerDay;
  93. tmp.RedBall = data[i].RedBall;
  94. tmp.RuleId = data[i].RuleId;
  95. tmp.MenuName = data[i].MenuName;
  96. tmp.LotteryName = data[i].LotteryName;
  97. tmp.KJTime = data[i].KJTime;
  98. tmp.LotteryText = data[i].LotteryText;
  99. tmp.LotteryType = data[i].LotteryType;
  100. tmp.KaiJiHao = data[i].KaiJiHao;
  101. tmp.Interval = data[i].Interval;
  102. tmp.ShiJiHao = data[i].ShiJiHao;
  103. tmp.BallCount = data[i].BallCount;
  104. tmp.BlueBall = data[i].BlueBall;
  105. tmp.DaXiaoZJZ = data[i].DaXiaoZJZ;
  106. tmp.Term = data[i].Term;
  107. tmp.HasLotteryZS = data[i].HasLotteryZS;
  108. tmp.Details = null;
  109. tmp.ID = data[i].ID;
  110. tmp.ZhongZhi = 14;
  111. if (data[i].RedBall != null)
  112. {
  113. tmp.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 = AppCtrl.GetObj().GetLotteryCache().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 = AppCtrl.GetObj().GetLotteryCache().GetLotteryListAdKjTimeCache();
  443. list = data.Where(w => types.Contains(w.LotteryType)).ToList();
  444. //添加走势图
  445. var datadetails = AppCtrl.GetObj().GetDataItemDetailCache().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 = AppCtrl.GetObj().GetLotteryCache().GetLotteryListAdKjTimeCache().ToList();
  526. model = data.FirstOrDefault(d => d.LotteryType == type);
  527. return model;
  528. }
  529. catch (Exception ee)
  530. {
  531. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":GetLotteryAdTJ(string type)");
  532. return null;
  533. }
  534. }
  535. /// <summary>
  536. /// header数据组装
  537. /// </summary>
  538. /// <returns></returns>
  539. public static List<ViewLotteryType> getHeaderNav()
  540. {
  541. List<ViewLotteryType> data = new List<ViewLotteryType>();
  542. try
  543. {
  544. var list = TypeList();
  545. //全国彩
  546. //var qgc = list.Where(d => d.MenuName == "qgc")
  547. // .Select(d => new LotteryItems(d.Name, "qgc", d.TypeCode, d.ZSTypeCode))
  548. // .ToList();
  549. ////地方彩
  550. //var dfc = list.Where(d => d.MenuName == "dfc")
  551. // .Select(d => new LotteryItems(d.Name, "dfc", d.TypeCode, d.ZSTypeCode))
  552. // .ToList();
  553. ////11x5
  554. //var l11x5 = list.Where(d => d.MenuName == "c11x5")
  555. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  556. // .ToList();
  557. ////k3
  558. //var lk3 = list.Where(d => d.MenuName == "k3")
  559. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  560. // .ToList();
  561. ////kl12
  562. //var lKL12 = list.Where(d => d.MenuName == "kl12")
  563. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  564. // .ToList();
  565. ////klsf
  566. //var lKLSF = list.Where(d => d.MenuName == "klsf")
  567. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  568. // .ToList();
  569. ////时时彩
  570. //var ssc = list.Where(d => d.MenuName == "ssc")
  571. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  572. // .ToList();
  573. //其他彩
  574. //var qtc = list.Where(d => d.MenuName == "qt")
  575. // .Select(d => new LotteryItems(d.Name, "gpc", d.TypeCode, d.ZSTypeCode))
  576. // .ToList();
  577. List<LotteryItems> qgcc = new List<LotteryItems>();
  578. List<LotteryItems> dfcc = new List<LotteryItems>();
  579. List<LotteryItems> qtcc = new List<LotteryItems>();
  580. List<LotteryItems> sscc = new List<LotteryItems>();
  581. List<LotteryItems> lKLSFc = new List<LotteryItems>();
  582. List<LotteryItems> lKL12c = new List<LotteryItems>();
  583. List<LotteryItems> lk3c = new List<LotteryItems>();
  584. List<LotteryItems> l11x5c = new List<LotteryItems>();
  585. if (list!=null)
  586. {
  587. foreach (var item in list)
  588. {
  589. if (item.MenuName== "qgc")
  590. {
  591. LotteryItems tmp = new LotteryItems(item.Name, "qgc", item.TypeCode, item.ZSTypeCode);
  592. qgcc.Add(tmp);
  593. }
  594. if (item.MenuName == "dfc")
  595. {
  596. LotteryItems tmp = new LotteryItems(item.Name, "dfc", item.TypeCode, item.ZSTypeCode);
  597. dfcc.Add(tmp);
  598. }
  599. if (item.MenuName == "c11x5")
  600. {
  601. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  602. l11x5c.Add(tmp);
  603. }
  604. if (item.MenuName == "k3")
  605. {
  606. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  607. lk3c.Add(tmp);
  608. }
  609. if (item.MenuName == "kl12")
  610. {
  611. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  612. lKL12c.Add(tmp);
  613. }
  614. if (item.MenuName == "klsf")
  615. {
  616. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  617. lKLSFc.Add(tmp);
  618. }
  619. if (item.MenuName == "ssc")
  620. {
  621. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  622. sscc.Add(tmp);
  623. }
  624. if (item.MenuName == "qt")
  625. {
  626. LotteryItems tmp = new LotteryItems(item.Name, "gpc", item.TypeCode, item.ZSTypeCode);
  627. qtcc.Add(tmp);
  628. }
  629. }
  630. }
  631. data.Add(new ViewLotteryType("全国彩", "QGC", qgcc));
  632. data.Add(new ViewLotteryType("地方彩", "DFC", dfcc));
  633. data.Add(new ViewLotteryType("11选5", "GPC11X5", l11x5c));
  634. data.Add(new ViewLotteryType("快3", "GPCK3", lk3c));
  635. data.Add(new ViewLotteryType("快乐十二", "GPCKL12", lKL12c));
  636. data.Add(new ViewLotteryType("快乐十分", "GPCKLSF", lKLSFc));
  637. data.Add(new ViewLotteryType("时时彩", "GPCSSC", sscc));
  638. data.Add(new ViewLotteryType("其他彩种", "GPCQTC", qtcc));
  639. }
  640. catch (Exception ee)
  641. {
  642. LogHelper.Error(typeof(KJApiBLL), ee.Message + ":getHeaderNav");
  643. }
  644. return data;
  645. }
  646. /// <summary>
  647. /// 获取页面TDK
  648. /// </summary>
  649. /// <param name="TDKType"></param>
  650. /// <returns></returns>
  651. public static TDKModel GetTDK(string TDKType)
  652. {
  653. try
  654. {
  655. var query = AppCtrl.GetObj().GetTDKDataCache().GetTDKId(TDKType);
  656. if (query != null)
  657. {
  658. TDKModel tdk = new TDKModel();
  659. tdk.Description = query.Description;
  660. tdk.Keywords = query.Keywords;
  661. tdk.Title = query.Title;
  662. tdk.Tags = query.Tags;
  663. return tdk;
  664. }
  665. return null;
  666. }
  667. catch (Exception e)
  668. {
  669. LogHelper.Error(typeof(KJApiBLL), "GetTDK" + e.Message);
  670. return null;
  671. }
  672. }
  673. }
  674. }