LuckyCardUtils.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace ReportWeb.Source
  6. {
  7. public class LuckyCardUtils
  8. {
  9. public class Period
  10. {
  11. public const int DAILY = 1;
  12. public const int WEEKLY = 2;
  13. public const int MONTHLY = 3;
  14. }
  15. public class CodeType
  16. {
  17. public const int LUCKY_CARD = 0;
  18. public const int LUCKY_CALL = 1;
  19. }
  20. public class Status
  21. {
  22. public const int NOT_REDEEM = 0;
  23. public const int REDEEM = 1;
  24. public const int PROCESSED = 2;
  25. }
  26. public class Channel
  27. {
  28. public const int OTHERS = 0;
  29. public const int MOCHA = 1;
  30. public const int SMS = 2;
  31. public const int USSD = 3;
  32. public const int WEB = 4;
  33. }
  34. public static String ParseChannel(int channel)
  35. {
  36. switch (channel)
  37. {
  38. case Channel.MOCHA:
  39. return "MOCHA+";
  40. case Channel.SMS:
  41. return "SMS";
  42. case Channel.USSD:
  43. return "USSD";
  44. case Channel.WEB:
  45. return "WEB";
  46. case Channel.OTHERS:
  47. return "OTHERS";
  48. default:
  49. return "UNKNOWN";
  50. }
  51. }
  52. public static String ParsePeriod(int period)
  53. {
  54. switch (period)
  55. {
  56. case Period.DAILY:
  57. return "DAILY";
  58. case Period.WEEKLY:
  59. return "WEEKLY";
  60. case Period.MONTHLY:
  61. return "MONTHLY";
  62. default:
  63. return "PROMOTION";
  64. }
  65. }
  66. public static String ParseStatus(int status)
  67. {
  68. switch (status)
  69. {
  70. case Status.NOT_REDEEM:
  71. return "NOT_REDEEM+";
  72. case Status.REDEEM:
  73. return "REDEEM";
  74. case Status.PROCESSED:
  75. return "PROCESSED";
  76. default:
  77. return "UNKNOWN";
  78. }
  79. }
  80. }
  81. }