WFApiBLL.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Business.WF;
  2. using Cache;
  3. using Cache.Cache;
  4. using Common;
  5. using KJH55128_Rec.ViewModels;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Web;
  10. namespace KJH55128_Rec.Business.WF
  11. {
  12. public class WFApiBLL
  13. {
  14. static WFApiBLL() { }
  15. public static PalyRuleModel GetPlayRule(string lottery, string lotterytype)
  16. {
  17. PalyRuleModel model = new PalyRuleModel();
  18. try
  19. {
  20. var datatiem = TJDataCache.GetDataItemModelCache();
  21. string id = datatiem.FirstOrDefault(d => d.ItemValue == lottery).ItemDetailId;
  22. var data = PlayRuleBLL.GetAwardByPrizeID(id);
  23. if (data == null || string.IsNullOrWhiteSpace(data.ItemName))
  24. {
  25. model.LotteryName = LotteryCache.GetLotteryType().FirstOrDefault(d => d.TypeCode == lotterytype).Name;
  26. }
  27. else
  28. {
  29. model.LotteryName = data.ItemName;
  30. model.Gameplay = data.Gameplay;
  31. model.LotteryRule = data.LotteryRule;
  32. model.LotteryTime = data.LotteryTime;
  33. model.Winning = data.Winning;
  34. }
  35. }
  36. catch (Exception ee)
  37. {
  38. LogHelper.Error(typeof(ZXApiBLL), ee.Message + "GetPlayRule");
  39. }
  40. return model;
  41. }
  42. }
  43. }