public static ListItem GetListItem(EPredefinedRole type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(EPredefinedRole type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
public static string GetText(EPredefinedRole type) { if (type == EPredefinedRole.ConsoleAdministrator) { return("超级管理员"); } if (type == EPredefinedRole.SystemAdministrator) { return("站点管理员"); } if (type == EPredefinedRole.Administrator) { return("管理员"); } return(string.Empty); }
public static string GetValue(EPredefinedRole type) { if (type == EPredefinedRole.ConsoleAdministrator) { return("ConsoleAdministrator"); } if (type == EPredefinedRole.SystemAdministrator) { return("SystemAdministrator"); } if (type == EPredefinedRole.Administrator) { return("Administrator"); } return(string.Empty); }
public static bool Equals(string typeStr, EPredefinedRole type) { return(Equals(type, typeStr)); }