Нет описания

ButtonGroup.cs 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace CallCenterApi.Interface.Models.Common
  6. {
  7. public class ButtonGroup
  8. {
  9. public static button delete()
  10. {
  11. return new button(3, "删除");
  12. }
  13. public static button submit()
  14. {
  15. return new button(4, "提交");
  16. }
  17. public static button assign()
  18. {
  19. return new button(5, "指派");
  20. }
  21. public static button handle()
  22. {
  23. return new button(6, "处理");
  24. }
  25. public static button goback()
  26. {
  27. return new button(7, "退回");
  28. }
  29. public static button sign()
  30. {
  31. return new button(8, "标记");
  32. }
  33. /// <summary>
  34. /// 按钮类
  35. /// </summary>
  36. public class button
  37. {
  38. public int key { get; set; }
  39. public string value { get; set; }
  40. public button(int _key, string _value)
  41. {
  42. key = _key;
  43. value = _value;
  44. }
  45. }
  46. /// <summary>
  47. /// 根据状态和角色代码获取操作按钮
  48. /// </summary>
  49. /// <param name="state"></param>
  50. /// <param name="code"></param>
  51. /// <param name="iszb"></param>
  52. /// <returns></returns>
  53. public static List<button> GetButtons(string state, string code)
  54. {
  55. List<button> buttons = new List<button>();
  56. switch (state)
  57. {
  58. case "0":
  59. //坐席 坐席班长 管理员
  60. if (code == "JDYPTZX" || code == "JDYBTZX" || code == "XTGLY")
  61. {
  62. buttons.Add(submit());
  63. buttons.Add(delete());
  64. buttons.Add(sign());
  65. }
  66. break;
  67. case "1":
  68. //办事处经理
  69. if (code == "BSCJL" || code == "XTGLY")
  70. {
  71. buttons.Add(assign());
  72. buttons.Add(goback());
  73. buttons.Add(sign());
  74. }
  75. break;
  76. case "3":
  77. //业务员
  78. if (code == "YWY" || code == "XTGLY")
  79. {
  80. buttons.Add(handle());
  81. buttons.Add(goback());
  82. buttons.Add(sign());
  83. }
  84. break;
  85. case "4":
  86. //业务员
  87. if (code == "YWY" || code == "XTGLY")
  88. {
  89. buttons.Add(handle());
  90. buttons.Add(goback());
  91. buttons.Add(sign());
  92. }
  93. break;
  94. case "5":
  95. //办事处经理
  96. if (code == "BSCJL" || code == "XTGLY")
  97. {
  98. buttons.Add(assign());
  99. buttons.Add(goback());
  100. buttons.Add(sign());
  101. }
  102. break;
  103. case "6":
  104. //坐席 坐席班长 管理员
  105. if (code == "JDYPTZX" || code == "JDYBTZX" || code == "XTGLY")
  106. {
  107. buttons.Add(submit());
  108. buttons.Add(delete());
  109. buttons.Add(sign());
  110. }
  111. break;
  112. }
  113. return buttons;
  114. }
  115. }
  116. }