public static ListItem GetListItem(EAdvLevel type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(EAdvLevel 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(EAdvLevel type) { if (type == EAdvLevel.Level1) { return("1级"); } else if (type == EAdvLevel.Level2) { return("2级"); } else if (type == EAdvLevel.Level3) { return("3级"); } else if (type == EAdvLevel.Level4) { return("4级"); } else if (type == EAdvLevel.Level5) { return("5级"); } else if (type == EAdvLevel.Level6) { return("6级"); } else if (type == EAdvLevel.Level7) { return("7级"); } else if (type == EAdvLevel.Level8) { return("8级"); } else if (type == EAdvLevel.Level9) { return("9级"); } else if (type == EAdvLevel.Level10) { return("10级"); } else { throw new Exception(); } }
public static string GetValue(EAdvLevel type) { if (type == EAdvLevel.Level1) { return("1"); } else if (type == EAdvLevel.Level2) { return("2"); } else if (type == EAdvLevel.Level3) { return("3"); } else if (type == EAdvLevel.Level4) { return("4"); } else if (type == EAdvLevel.Level5) { return("5"); } else if (type == EAdvLevel.Level6) { return("6"); } else if (type == EAdvLevel.Level7) { return("7"); } else if (type == EAdvLevel.Level8) { return("8"); } else if (type == EAdvLevel.Level9) { return("9"); } else if (type == EAdvLevel.Level10) { return("10"); } else { throw new Exception(); } }
public static bool Equals(string typeStr, EAdvLevel type) { return(Equals(type, typeStr)); }