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

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Example #2
0
 public static bool Equals(EConsumeType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Example #3
0
 public static string GetText(EConsumeType type)
 {
     if (type == EConsumeType.Cash)
     {
         return("现金消费");
     }
     else if (type == EConsumeType.CardAmount)
     {
         return("会员卡余额消费");
     }
     else
     {
         throw new Exception();
     }
 }
Example #4
0
 public static string GetValue(EConsumeType type)
 {
     if (type == EConsumeType.Cash)
     {
         return("Cash");
     }
     else if (type == EConsumeType.CardAmount)
     {
         return("CardAmount");
     }
     else
     {
         throw new Exception();
     }
 }
Example #5
0
 public static bool Equals(string typeStr, EConsumeType type)
 {
     return(Equals(type, typeStr));
 }