WFController.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Models;
  7. using Common;
  8. using KJH55128_Rec.Business.TJ;
  9. using KJH55128_Rec.ViewModels;
  10. using KJH55128_Rec.Business.WF;
  11. using KJH55128_Rec.Util;
  12. namespace KJH55128_Rec.Controllers
  13. {
  14. /// <summary>
  15. /// 玩法
  16. /// </summary>
  17. public class WFController : Controller
  18. {
  19. /// <summary>
  20. /// 玩法规则
  21. /// </summary>
  22. /// <returns></returns>
  23. [Route("wfgz.html")]
  24. //[Route("wfgz/{type}/{code}.html")]
  25. [Route("wfgz/{strparams}.html")]
  26. public ActionResult Index(string strparams)
  27. {
  28. string type = "QGC",code = "ssq";
  29. if (!string.IsNullOrWhiteSpace(strparams)) {
  30. string[] arrs = strparams.Split('-');
  31. if (arrs.Length > 0)
  32. {
  33. type = ValidationTools.CheckStr(arrs[0], "QGC", 20);
  34. code = ValidationTools.CheckStr(arrs[1], "fc3d", 20);
  35. }
  36. }
  37. ViewBag.type = type.ToUpper();
  38. ViewBag.lottery = code;
  39. var lotterytype = EnumHelper.GETEnumTypeByText<SCCLottery>(code);
  40. string lottery = "";
  41. if (ZSlotterType.TypeOfNameDict.Keys.Contains(lotterytype.ToString()))
  42. {
  43. lottery = ZSlotterType.TypeOfNameDict[lotterytype.ToString()];
  44. }
  45. PalyRuleModel model = WFApiBLL.GetPlayRule(lottery,lotterytype);
  46. return View(model);
  47. }
  48. }
  49. }