| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace CallCenterApi.Interface.Models.Common
- {
- public class ButtonGroup
- {
-
-
- public static button delete()
- {
- return new button(3, "删除");
- }
- public static button submit()
- {
- return new button(4, "提交");
- }
- public static button assign()
- {
- return new button(5, "指派");
- }
- public static button handle()
- {
- return new button(6, "处理");
- }
- public static button goback()
- {
- return new button(7, "退回");
- }
- public static button sign()
- {
- return new button(8, "标记");
- }
- /// <summary>
- /// 按钮类
- /// </summary>
- public class button
- {
- public int key { get; set; }
- public string value { get; set; }
- public button(int _key, string _value)
- {
- key = _key;
- value = _value;
- }
- }
- /// <summary>
- /// 根据状态和角色代码获取操作按钮
- /// </summary>
- /// <param name="state"></param>
- /// <param name="code"></param>
- /// <param name="iszb"></param>
- /// <returns></returns>
- public static List<button> GetButtons(string state, string code)
- {
- List<button> buttons = new List<button>();
-
- switch (state)
- {
- case "0":
- //坐席 坐席班长 管理员
- if (code == "JDYPTZX" || code == "JDYBTZX" || code == "XTGLY")
- {
- buttons.Add(submit());
- buttons.Add(delete());
- buttons.Add(sign());
- }
- break;
- case "1":
- //办事处经理
- if (code == "BSCJL" || code == "XTGLY")
- {
- buttons.Add(assign());
- buttons.Add(goback());
- buttons.Add(sign());
- }
- break;
- case "3":
- //业务员
- if (code == "YWY" || code == "XTGLY")
- {
- buttons.Add(handle());
- buttons.Add(goback());
- buttons.Add(sign());
- }
- break;
- case "4":
- //业务员
- if (code == "YWY" || code == "XTGLY")
- {
- buttons.Add(handle());
- buttons.Add(goback());
- buttons.Add(sign());
- }
- break;
- case "5":
- //办事处经理
- if (code == "BSCJL" || code == "XTGLY")
- {
- buttons.Add(assign());
- buttons.Add(goback());
- buttons.Add(sign());
- }
- break;
- case "6":
- //坐席 坐席班长 管理员
- if (code == "JDYPTZX" || code == "JDYBTZX" || code == "XTGLY")
- {
- buttons.Add(submit());
- buttons.Add(delete());
- buttons.Add(sign());
- }
- break;
- }
- return buttons;
- }
-
- }
- }
|