public static ListItem GetListItem(ELimitType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(ELimitType 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(ELimitType type) { if (type == ELimitType.Normal) { return("未超期"); } else if (type == ELimitType.Alert) { return("预警"); } else if (type == ELimitType.Yellow) { return("黄牌"); } else if (type == ELimitType.Red) { return("红牌"); } else { throw new Exception(); } }
public static string GetValue(ELimitType type) { if (type == ELimitType.Normal) { return("Normal"); } else if (type == ELimitType.Alert) { return("Alert"); } else if (type == ELimitType.Yellow) { return("Yellow"); } else if (type == ELimitType.Red) { return("Red"); } else { throw new Exception(); } }
public static bool Equals(string typeStr, ELimitType type) { return(Equals(type, typeStr)); }