| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 | 
							- using Common;
 
- using KJH55128_Rec.Business;
 
- using KJH55128_Rec.Business.TJ;
 
- using KJH55128_Rec.Business.TrendChart;
 
- using KJH55128_Rec.ViewModels;
 
- using Models;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Web;
 
- using System.Web.Mvc;
 
- namespace KJH55128_Rec.Controllers
 
- {
 
-     public class TemplateController : Controller
 
-     {
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         private List<string> dfclottery = new List<string>()
 
-         { "GP_11x5_JiangSu","GP_11x5_HeiLongJiang","GP_11x5_GuangDong","GP_11x5_HeBei","GP_11x5_LiaoNing",
 
-             "GP_11x5_JiangXi","GP_11x5_JiLin","GP_11x5_ShanDong","GP_11x5_YunNan","GP_11x5_ZheJiang"};
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _qgc(string type)
 
-         {
 
-             ViewBag.lottery = type;
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(type, 0, 0, "Term", null, 10, true);
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _dfc(string type)
 
-         {
 
-             ViewBag.lottery = type;
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(type, 0, 0, "Term", null, 10, true);
 
-             return PartialView(data);
 
-         }
 
-         #region 高频彩
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpc11x5(string type, string date)
 
-         {
 
-             ViewBag.Dispaly = getDfcIsDisplay(type);
 
-             List<LotteryViewModel> data = new List<LotteryViewModel>();
 
-             if (string.IsNullOrWhiteSpace(date))
 
-             {
 
-                 data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             }
 
-             else
 
-             {
 
-                 Dictionary<string, object> dict2 = null;
 
-                 dict2["MinDate"] = date + " 00:00:00";
 
-                 dict2["MaxDate"] = date + " 23:59:59";
 
-                 data = KJApiBLL.GetLotteryList(type, 0, 0, null, dict2, 0, true);
 
-             }
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpck3(string type, string date)
 
-         {
 
-             List<LotteryViewModel> data = new List<LotteryViewModel>();
 
-             if (string.IsNullOrWhiteSpace(date))
 
-             {
 
-                 data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             }
 
-             else
 
-             {
 
-                 Dictionary<string, object> dict2 = null;
 
-                 dict2["MinDate"] = date + " 00:00:00";
 
-                 dict2["MaxDate"] = date + " 23:59:59";
 
-                 data = KJApiBLL.GetLotteryList(type, 0, 0, null, dict2, 0, true);
 
-             }
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpckl12(string type, string date)
 
-         {
 
-             List<LotteryViewModel> data = new List<LotteryViewModel>();
 
-             if (string.IsNullOrWhiteSpace(date))
 
-             {
 
-                 data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             }
 
-             else
 
-             {
 
-                 Dictionary<string, object> dict2 = null;
 
-                 dict2["MinDate"] = date + " 00:00:00";
 
-                 dict2["MaxDate"] = date + " 23:59:59";
 
-                 data = KJApiBLL.GetLotteryList(type, 0, 0, null, dict2, 0, true);
 
-             }
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpcklsf(string type, string date)
 
-         {
 
-             ViewBag.lottery = type;
 
-             List<LotteryViewModel> data = new List<LotteryViewModel>();
 
-             if (string.IsNullOrWhiteSpace(date))
 
-             {
 
-                 data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             }
 
-             else
 
-             {
 
-                 Dictionary<string, object> dict2 = null;
 
-                 dict2["MinDate"] = date + " 00:00:00";
 
-                 dict2["MaxDate"] = date + " 23:59:59";
 
-                 data = KJApiBLL.GetLotteryList(type, 0, 0, null, dict2, 0, true);
 
-             }
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpcssc(string type, string date)
 
-         {
 
-             ViewBag.lottery = type;
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             return PartialView(data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _gpcqt(string type, string date)
 
-         {
 
-             ViewBag.lottery = type;
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(type, 1, 0, null, null, 0, true);
 
-             return PartialView(data);
 
-         }
 
-         #endregion 
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         private bool getDfcIsDisplay(string type)
 
-         {
 
-             return dfclottery.FindIndex(d => d == type) > -1;
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _getTable(string tablename = "", string lotterytype = "",
 
-             int day = 1, int num = 0, string date = "", int year = 0,string qs="")
 
-         {
 
-             
 
-             ViewBag.lottery = lotterytype;
 
-             ViewBag.Dispaly = getDfcIsDisplay(lotterytype);
 
-             string param = null;
 
-             Dictionary<string, object> dict2 = null;
 
-             if (tablename.IndexOf("qgc") != -1 || tablename.IndexOf("dfc") != -1)
 
-             {
 
-                 
 
-                 if (num == 0 && day == 1&& year == 0 && string.IsNullOrWhiteSpace(qs))
 
-                 {
 
-                     day = 0;
 
-                     num = 20;
 
-                     param = "Term";
 
-                 }
 
-                 else
 
-                 {
 
-                     day = 0;
 
-                     param = "Term";
 
-                 }
 
-                 if (year != 0)
 
-                 {
 
-                     dict2 = new Dictionary<string, object>();
 
-                     dict2["MinYear"] = year;
 
-                     dict2["MaxYear"] = (year + 1);
 
-                 }
 
-                 if (!string.IsNullOrWhiteSpace(qs))
 
-                 {
 
-                     dict2 = new Dictionary<string, object>();
 
-                     dict2["Num"] = qs;
 
-                 }
 
-                 try
 
-                 {
 
-                     int value = -1;
 
-                     value = (int)Enum.Parse(typeof(EnumZXCid), lotterytype);
 
-                     ZXViewModel temp = new ZXViewModel();
 
-                     temp = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).FirstOrDefault(d => d.Name.Contains("基本") && d.Name.IndexOf("手机") == -1);
 
-                     if (temp == null)
 
-                     {
 
-                         ViewBag.zsSrc = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).FirstOrDefault(d => d.Name.IndexOf("手机") == -1).Url;
 
-                     }
 
-                     else
 
-                     {
 
-                         ViewBag.zsSrc = temp.Url;
 
-                     }
 
-                 }
 
-                 catch
 
-                 {
 
-                 }
 
-             }
 
-             else
 
-             {
 
-                 
 
-                 if (!string.IsNullOrWhiteSpace(date))
 
-                 {
 
-                     
 
-                     dict2 = new Dictionary<string, object>();
 
-                     dict2["MinDate"] = date + " 00:00:00";
 
-                     dict2["MaxDate"] = date + " 23:59:59";
 
-                     day = 0;                   
 
-                 }
 
-             }
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(lotterytype, day, 0, param, dict2, num, true);
 
-             return PartialView(tablename, data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         [HttpPost]
 
-         public PartialViewResult _getTables(string tablename = "", string lotterytype = "", int day = 1, int num = 0,
 
-             string minDate = "", string maxDate = "")
 
-         {
 
-             
 
-             ViewBag.lottery = lotterytype;
 
-             ViewBag.Dispaly = getDfcIsDisplay(lotterytype);
 
-             string param = null;
 
-             if (num > 0)
 
-             {
 
-                 param = "Term";
 
-             }
 
-             Dictionary<string, object> dict2 = null;
 
-             if (!string.IsNullOrWhiteSpace(minDate) || !string.IsNullOrWhiteSpace(maxDate))
 
-             {
 
-                 dict2 = new Dictionary<string, object>();
 
-                 dict2["MinDate"] = minDate;
 
-                 dict2["MaxDate"] = maxDate;
 
-             }
 
-             List<LotteryViewModel> data = KJApiBLL.GetLotteryList(lotterytype, day, 0, param, dict2, num, true);
 
-             try
 
-             {
 
-                 int value = -1;
 
-                 value = (int)Enum.Parse(typeof(EnumZXCid), lotterytype);
 
-                 ZXViewModel temp = new ZXViewModel();
 
-                 temp = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).FirstOrDefault(d => d.Name.Contains("基本") && d.Name.IndexOf("手机") == -1);
 
-                 if (temp == null)
 
-                 {
 
-                     ViewBag.zsSrc = TrendChastApiBLL.GetTrendChartChache(value, (int)EnumZXTid.走势图).FirstOrDefault(d => d.Name.IndexOf("手机") == -1).Url;
 
-                 }
 
-                 else {
 
-                     ViewBag.zsSrc = temp.Url;
 
-                 }
 
-             }
 
-             catch
 
-             {
 
-             }
 
-             return PartialView(tablename, data);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         [HttpPost]
 
-         public JsonResult _getKjData(string lotterytype = "")
 
-         {
 
-             
 
-             if (!string.IsNullOrWhiteSpace(lotterytype))
 
-             {
 
-                 LotteryData data = KJApiBLL.GetLotteryAdTJ(lotterytype);
 
-                 return Json(data, JsonRequestBehavior.AllowGet);
 
-             }
 
-             else
 
-             {
 
-                 return Json(new { msg = "lotterytype 参数传值有误" }, JsonRequestBehavior.AllowGet);
 
-             }
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         [HttpPost]
 
-         public PartialViewResult _getKJHorSJHTable(string lotterytype, string type = "kjh", int term = 0, string minTerm = "", string maxTerm = "", string minYear = "", string maxYear = "")
 
-         {
 
-             if (!string.IsNullOrWhiteSpace(lotterytype))
 
-             {
 
-                 lotterytype = EnumHelper.GETEnumTypeByText<SCCLottery>(lotterytype);
 
-                 Dictionary<string, object> dict2 = null;
 
-                 string param = null;
 
-                 if (term > 0)
 
-                 {
 
-                     param = "Term";
 
-                 }
 
-                 if (!string.IsNullOrWhiteSpace(minYear) || !string.IsNullOrWhiteSpace(maxYear))
 
-                 {
 
-                     dict2 = new Dictionary<string, object>();
 
-                     dict2["MinYear"] = minYear;
 
-                     dict2["MaxYear"] = maxYear;
 
-                 }
 
-                 if (!string.IsNullOrWhiteSpace(minTerm) || !string.IsNullOrWhiteSpace(maxTerm))
 
-                 {
 
-                     dict2 = new Dictionary<string, object>();
 
-                     dict2["MinTerm"] = minTerm;
 
-                     dict2["MaxTerm"] = maxTerm;
 
-                 }
 
-                 List<LotteryKaiJiHaoAdShijihaoHModel> data = null;
 
-                 if (type == "kjh")
 
-                 {
 
-                     data = KJApiBLL.GetLotteryListKaiJiHao(lotterytype, 0, 0, param, dict2, term, true);
 
-                     return PartialView("_kjhTable", data);
 
-                 }
 
-                 else
 
-                 {
 
-                     data = KJApiBLL.GetLotteryListShiJiHao(lotterytype, 0, 0, param, dict2, term, true);
 
-                     return PartialView("_sjhTable", data);
 
-                 }
 
-             }
 
-             else
 
-             {
 
-                 return PartialView("/Shared/Error");
 
-             }
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         [HttpPost]
 
-         public JsonResult _getKJHorSJHDataByTerm(string lotterytype = "fc3d", string type = "kjh", string qs = "")
 
-         {
 
-             try
 
-             {
 
-                 if (!string.IsNullOrWhiteSpace(lotterytype))
 
-                 {
 
-                     lotterytype = EnumHelper.GETEnumTypeByText<SCCLottery>(lotterytype);
 
-                     Dictionary<string, object> dict2 = null;
 
-                     if (!string.IsNullOrWhiteSpace(qs))
 
-                     {
 
-                         dict2 = new Dictionary<string, object>();
 
-                         dict2["Num"] = qs;
 
-                     }
 
-                     KaiJiHaoAdShijihaoHModel data = null;
 
-                     if (type == "kjh")
 
-                     {
 
-                         data = KJApiBLL.GetLotteryListKaiJiHao(lotterytype, 0, 0, null, dict2, 0, true)[0].Kaijianghao;
 
-                     }
 
-                     else
 
-                     {
 
-                         data = KJApiBLL.GetLotteryListShiJiHao(lotterytype, 0, 0, null, dict2, 0, true)[0].Shijihao;
 
-                     }
 
-                     return Json(data, JsonRequestBehavior.AllowGet);
 
-                 }
 
-                 else
 
-                 {
 
-                     return Json(new { msg = "lotterytype 参数传值有误" }, JsonRequestBehavior.AllowGet);
 
-                 }
 
-             }
 
-             catch (Exception ee)
 
-             {
 
-                 return null;
 
-             }
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _getNavLotteryTable(string id)
 
-         {
 
-             
 
-             List<string> types = TJApiBLL.GetShowHomeTypes(id);
 
-             List<LotteryData> datalist = KJApiBLL.GetLotteryAdTJ(types);
 
-             return PartialView("_navLotteryTable", datalist);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PartialViewResult _getSjhHistoryToday(string lotterytype, string term)
 
-         {
 
-             Dictionary<string, object> dict = null;
 
-             List<LotteryKaiJiHaoAdShijihaoHModel> list = new List<LotteryKaiJiHaoAdShijihaoHModel>();
 
-             if (!string.IsNullOrWhiteSpace(lotterytype) && !string.IsNullOrWhiteSpace(term))
 
-             {
 
-                 dict = new Dictionary<string, object>();
 
-                 dict["InTerm"] = getTerms(term);
 
-                 list = KJApiBLL.GetLotteryListShiJiHao(lotterytype, 0, 0, null, dict);
 
-             }
 
-             return PartialView("_sjhTable", list);
 
-         }
 
-         private List<string> getTerms(string term)
 
-         {
 
-             int num = 0; string per = "";
 
-             List<string> terms = new List<string>();
 
-             if (term.Length >= 7)
 
-             {
 
-                 num = Int32.Parse(term.Substring(0, 4));
 
-                 per = term.Substring(4, 3);
 
-             }
 
-             else
 
-             {
 
-                 num = Int32.Parse(term.Substring(0, 2));
 
-                 per = term.Substring(2, 3);
 
-             }
 
-             int yearCount = DateTime.Now.Year - 2000;
 
-             for (int i = 0; i <= yearCount; i++)
 
-             {
 
-                 terms.Add((num - i).ToString() + per);
 
-             }
 
-             return terms;
 
-         }
 
-     }
 
- }
 
 
  |