Esempio n. 1
0
        public static ListItem GetListItem(ELimitType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
 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();
     }
 }
Esempio n. 5
0
 public static bool Equals(string typeStr, ELimitType type)
 {
     return(Equals(type, typeStr));
 }