예제 #1
0
        public static ListItem GetListItem(EPredefinedRole type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
예제 #2
0
 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);
 }
예제 #3
0
 public static string GetText(EPredefinedRole type)
 {
     if (type == EPredefinedRole.ConsoleAdministrator)
     {
         return("超级管理员");
     }
     if (type == EPredefinedRole.SystemAdministrator)
     {
         return("站点管理员");
     }
     if (type == EPredefinedRole.Administrator)
     {
         return("管理员");
     }
     return(string.Empty);
 }
예제 #4
0
 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);
 }
예제 #5
0
 public static bool Equals(string typeStr, EPredefinedRole type)
 {
     return(Equals(type, typeStr));
 }