123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- using Common;
- using KJH55128_Rec.Business;
- using KJH55128_Rec.Business.TJ;
- using KJH55128_Rec.Business.TrendChart;
- using KJH55128_Rec.Util;
- using KJH55128_Rec.ViewModels;
- using Models;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using KJH55128_Rec.Business.KJH;
- namespace KJH55128_Rec.Controllers
- {
- public class SharedController : Controller
- {
- /// <summary>
- /// 工具
- /// </summary>
- /// <returns></returns>
- public PartialViewResult tools()
- {
- List<IndexToolModel> list = new List<IndexToolModel>();
- list.Add(new IndexToolModel("福彩3D工具", "FC3DGJ", TrendChastApiBLL.GetTrendChartChache(1, (int)EnumZXTid.工具)));
- list.Add(new IndexToolModel("体彩P3工具", "TCP3GJ", TrendChastApiBLL.GetTrendChartChache(2, (int)EnumZXTid.工具)));
- list.Add(new IndexToolModel("体彩P5工具", "TCP5GJ", TrendChastApiBLL.GetTrendChartChache(3, (int)EnumZXTid.工具)));
- list.Add(new IndexToolModel("双色球工具", "SSQGJ", TrendChastApiBLL.GetTrendChartChache(4, (int)EnumZXTid.工具)));
- //string id = "c31d76a15ee54db08acbf330dba2f234";
- //List<Tools_Preview> list = SSApiBLL.QuerySSList(id).Take(3).ToList();
- return PartialView(list);
- }
- /// <summary>
- /// 资讯
- /// </summary>
- /// <returns></returns>
- public PartialViewResult news()
- {
- List<NewsItem> list = new List<NewsItem>();
- List<string> ids = new List<string>() {
- "08a45dd1830041f493c260942fd937e4",
- "23dafcc3ba6c4d67a9e98f20a0b53121",
- "fe166abac4ac4baba922a72f450d374c",
- "40a9e9c257a74f5f889df3c1238b1c3a" };
- for (int i = 0; i < ids.Count; i++)
- {
- list.AddRange(ZXApiBLL.GetNewsCache()
- .Where(d => d.CategoryId == ids[i])
- .Take(2)
- .Select(d => new NewsItem { NewsId = d.PK.ToString(), AddTime = d.CreateDate.ToString("yyyy-MM-dd"), Title = d.FullHead, Source = d.SourceAddress }));
- }
- return PartialView(list);
- }
- /// <summary>
- /// 推荐彩种
- /// </summary>
- /// <returns></returns>
- public PartialViewResult recomlot()
- {
- List<LotteryItems> list = TJApiBLL.GetRecommandList();
- return PartialView(list);
- }
- /// <summary>
- /// 热门彩种
- /// </summary>
- /// <returns></returns>
- public PartialViewResult hotlottery()
- {
- List<LotteryItems> list = TJApiBLL.GetHotLotteryList();
- return PartialView(list);
- }
- /// <summary>
- /// header
- /// </summary>
- /// <returns></returns>
- public PartialViewResult header(string nav = "")
- {
- ViewBag.nav = nav;
- List<ViewLotteryType> data = KJApiBLL.getHeaderNav();
- return PartialView(data);
- }
- /// <summary>
- /// footer
- /// </summary>
- /// <returns></returns>
- public PartialViewResult footer()
- {
- List<FriendLink> list = TJApiBLL.GetFriendLinksList();
- return PartialView(list);
- }
- /// <summary>
- /// 广告
- /// </summary>
- /// <returns></returns>
- public PartialViewResult ads()
- {
- List<AdViewModel> list = TJApiBLL.GetAdLists();
- return PartialView(list);
- }
- /// <summary>
- /// 广告
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ContentResult Getads()
- {
- List<AdViewModel> list = TJApiBLL.GetAdLists();
- return Content(list.TryToJson());
- }
- /// <summary>
- /// 全国彩|全国彩-导航bar
- /// </summary>
- /// <returns></returns>
- public PartialViewResult lotterynav(string type)
- {
- string id = "", name = "";
- ViewLotteryType navdata = new ViewLotteryType();
- switch (type)
- {
- case "QGC":
- {
- id = "qgc";//全国彩
- name = "全国彩";
- }
- break;
- case "DFC":
- {
- id = "dfc";//全国彩
- name = "地方彩";
- }
- break;
- }
- var list = KJApiBLL.TypeList();
- var data = list.Where(d => d.MenuName == id)
- .Select(d => new LotteryItems(d.Name, id, d.TypeCode, d.ZSTypeCode))
- .ToList();
- navdata.Lotterys = data;
- navdata.TypeName = name;
- navdata.TypeCode = type;
- return PartialView(navdata);
- }
- /// <summary>
- /// 高频彩-导航bar
- /// </summary>
- /// <returns></returns>
- public PartialViewResult gpcnav(string type, string gpcnav)
- {
- List<ViewLotteryType> navlist = KJApiBLL.getHeaderNav()
- .Where(d => d.TypeCode != "QGC" && d.TypeCode != "DFC").ToList();
- if (!string.IsNullOrWhiteSpace(gpcnav))
- {
- ViewBag.gpcnav = ("gpc" + gpcnav).ToUpper();
- }
- return PartialView(navlist);
- }
- /// <summary>
- /// 玩法规则导航
- /// </summary>
- /// <returns></returns>
- public PartialViewResult wfnav(string type = "QGC", string code = "ssq")
- {
- List<ViewLotteryType> list = KJApiBLL.getHeaderNav();
- if (type != "QGC" && type != "DFC")
- {
- if (type.IndexOf("GPC") == -1)
- {
- type = "gpc" + type;
- }
- }
- ViewBag.type = type.ToUpper();
- ViewBag.code = code;
- return PartialView(list);
- }
- /// <summary>
- /// 推荐专题???
- /// </summary>
- /// <returns></returns>
- public PartialViewResult recomnews(string code, string type = "gqc")
- {
- string id = null;
- List<NewsItem> list = new List<NewsItem>();
- if (type == "qgc")
- {
- switch (code)
- {
- case "fc3d": id = "08a45dd1830041f493c260942fd937e4"; break;
- case "ssq": id = "23dafcc3ba6c4d67a9e98f20a0b53121"; break;
- case "pl3": id = "fe166abac4ac4baba922a72f450d374c"; break;
- case "dlt": id = "40a9e9c257a74f5f889df3c1238b1c3a"; break;
- case "qlc": id = "b28b07513e6548719c33ddd1542e6cd6"; break;
- case "qxc": id = "330e5f0e8d894c8d8f770b0ac5ce4d38"; break;
- case "pl5": id = "940480808e514922b70b4863e0858354"; break;
- }
- list = ZXApiBLL.GetNewsCache().Where(d => d.CategoryId == id)
- .Select(d => new NewsItem { NewsId = d.PK.ToString(), AddTime = d.CreateDate.ToString("yyyy-MM-dd"), Title = d.FullHead, Source = d.SourceAddress })
- .Take(9)
- .ToList();
- }
- else
- {
- // "40a9e9c257a74f5f889df3c1238b1c3a"
- List<string> ids = new List<string>() {
- "08a45dd1830041f493c260942fd937e4",
- "23dafcc3ba6c4d67a9e98f20a0b53121",
- "fe166abac4ac4baba922a72f450d374c",
- };
- for (int i = 0; i < ids.Count; i++)
- {
- list.AddRange(ZXApiBLL.GetNewsCache()
- .Where(d => d.CategoryId == ids[i])
- .Take(3)
- .Select(d => new NewsItem { NewsId = d.PK.ToString(), AddTime = d.CreateDate.ToString("yyyy-MM-dd"), Title = d.FullHead, Source = d.SourceAddress }));
- }
- }
- return PartialView(list);
- }
- /// <summary>
- /// 根据彩种推荐资讯
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public PartialViewResult recomzxBytype(string type = "")
- {
- string id = null;
- switch (type)
- {
- case "sjhfc3d": id = "e29e4cbe01be4799b918dc9c0aeb3926"; ViewBag.title = "3D试后分析预测"; ViewBag.more = "http://zx.55128.cn/3d/3dsjhh_list/53.htm"; break;
- case "sjhpl3": id = "fe166abac4ac4baba922a72f450d374c"; ViewBag.title = "排列三分析预测"; ViewBag.more = "http://zx.55128.cn/p3/p3yc_list/23.htm"; break;
- case "fc3d": id = "08a45dd1830041f493c260942fd937e4"; ViewBag.title = "福彩3D预测推荐"; ViewBag.more = "http://zx.55128.cn/3d/3dyc_list/15.htm"; break;
- case "ssq": id = "23dafcc3ba6c4d67a9e98f20a0b53121"; ViewBag.title = "双色球预测推荐"; ViewBag.more = "http://zx.55128.cn/ssq/ssqyc_list/42.htm"; break;
- case "pl3": id = "fe166abac4ac4baba922a72f450d374c"; ViewBag.title = "排列三预测推荐"; ViewBag.more = "http://zx.55128.cn/p3/p3yc_list/23.htm"; break;
- case "dlt": id = "40a9e9c257a74f5f889df3c1238b1c3a"; ViewBag.title = "大乐透预测推荐"; ViewBag.more = "http://zx.55128.cn/qita/dlt_list/45.htm"; break;
- case "qlc": id = "b28b07513e6548719c33ddd1542e6cd6"; ViewBag.title = "七乐彩预测推荐"; ViewBag.more = "http://zx.55128.cn/qita/qlc_list/47.htm"; break;
- case "qxc": id = "330e5f0e8d894c8d8f770b0ac5ce4d38"; ViewBag.title = "七星彩预测推荐"; ViewBag.more = "http://zx.55128.cn/qita/qxc_list/46.htm"; break;
- case "pl5": id = "940480808e514922b70b4863e0858354"; ViewBag.title = "排列五预测推荐"; ViewBag.more = "http://zx.55128.cn/p3/p5_list/51.htm"; break;
- }
- List<NewsItem> list = ZXApiBLL.GetNewsCache().Where(d => d.CategoryId == id)
- .Select(d => new NewsItem { NewsId = d.PK.ToString(), AddTime = d.CreateDate.ToString("yyyy-MM-dd"), Title = d.FullHead, Source = d.SourceAddress })
- .Take(15)
- .ToList();
- return PartialView(list);
- }
- /// <summary>
- /// 试机号描述
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public PartialViewResult sjhDesc(string code = "", int type = 1)
- {
- lotteryDesc model = new lotteryDesc();
- SJiHdescribe sJiHdescribe = new SJiHdescribe();
- if (type == 1)
- {
- if (code == "fc3d")
- {
- model.Title = "什么是福彩3D试机号";
- model.Content = sJiHdescribe.GetValueByKey(SCCLottery.QG_FC3D.ToString() + "-" + SJHdescribeType.What);
- }
- else
- {
- model.Title = "什么是排列三试机号";
- model.Content = sJiHdescribe.GetValueByKey(SCCLottery.QG_TCP3.ToString() + "-" + SJHdescribeType.What);
- }
- }
- else
- {
- if (code == "fc3d")
- {
- model.Title = "3D试机号与开奖号的关系";
- model.Content = sJiHdescribe.GetValueByKey(SCCLottery.QG_TCP3.ToString() + "-" + SJHdescribeType.Andkjh);
- }
- else
- {
- model.Title = "排列三试机号与开奖号关系";
- model.Content = sJiHdescribe.GetValueByKey(SCCLottery.QG_TCP3.ToString() + "-" + SJHdescribeType.Andkjh);
- }
- }
- return PartialView(model);
- }
- /// <summary>
- /// 走势图工具推荐
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public PartialViewResult zsTools(string lottery = "", int type = 0)
- {
- List<ZXViewModel> list = new List<ZXViewModel>();
- lottery = EnumHelper.GETEnumTypeByText<SCCLottery>(lottery);
- //ViewBag.type = type.ToUpper();
- int value = -1;
- try
- {
- value = (int)Enum.Parse(typeof(EnumZXCid), lottery);
- if (value != -1)
- {
- if (type == 0)
- {
- list = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).Where(d=>d.Name.IndexOf("手机")==-1).Take(4).ToList();
- list.AddRange(TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.工具).Take(4).ToList());
- }
- if (type == 1)
- {
- list = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).Where(d => d.Name.IndexOf("手机") == -1).Take(8).ToList();
- }
- }
- }
- catch
- {
- }
- return PartialView("zsTools", list);
- }
- public PartialViewResult recomkjh(string lottery = "", string type = "kjh")
- {
- List<string> kjh = new List<string> { "QG_FC3D", "QG_FCSSQ", "QG_TCP3", "QG_TCDLT" };
- List<string> sjh = new List<string> { "QG_FC3D", "QG_TCP3", };
- List<LotteryData> list = new List<LotteryData>();
- lottery = EnumHelper.GETEnumTypeByText<SCCLottery>(lottery);
- ViewBag.type = type;
- if (type == "kjh")
- {
- if (kjh.Remove(lottery))
- {
- list = KJApiBLL.GetLotteryAdTJ(kjh);
- }
- }
- if (type == "sjh")
- {
- list = KJApiBLL.GetLotteryAdTJ(sjh);
- }
- return PartialView(list);
- }
- public PartialViewResult recomzs(string code, string type = "sjh")
- {
- List<ZXViewModel> list = new List<ZXViewModel>();
- code = EnumHelper.GETEnumTypeByText<SCCLottery>(code);
- int value = -1;
- try
- {
- value = (int)Enum.Parse(typeof(EnumZXCid), code);
- list = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图);
- }
- catch
- {
- }
- List<ZXViewModel> model = new List<ZXViewModel>();
- if (type == "kjh")
- {
- model.Add(list[list.Count - 2]);
- model.Add(list[list.Count - 1]);
- }
- if (type == "sjh")
- {
- model.Add(list[list.Count-1]);
- model.Add(list.FirstOrDefault(d => d.hTitle.Contains("试机")));
- }
- return PartialView(model);
- }
- public PartialViewResult recomurl(string code,int type=0) {
- List<UrlEntity> list = new List<UrlEntity>();
- code=EnumHelper.GETEnumTypeByText<SCCLottery>(code);
- ViewBag.type = type;
- if (type == 0)
- {
- list = LotteryFriUrlHandelBLL.GetKjxqFUbyLottery(code);
- }
- else {
- list= LotteryFriUrlHandelBLL.GetplayRuleFUbyLottery(code);
- }
- return PartialView(list);
- }
- /// <summary>
- /// 各省福彩体彩链接地址
- /// </summary>
- /// <param name="code"></param>
- /// <param name="type"></param>
- /// <returns></returns>
- public PartialViewResult FTCLink()
- {
- List<FriendLink> list = TJApiBLL.GetFTCLinksList();
- return PartialView(list);
- }
- }
- }
|