public static ListItem GetListItem(EConsumeType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
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); }
public static string GetText(EConsumeType type) { if (type == EConsumeType.Cash) { return("现金消费"); } else if (type == EConsumeType.CardAmount) { return("会员卡余额消费"); } else { throw new Exception(); } }
public static string GetValue(EConsumeType type) { if (type == EConsumeType.Cash) { return("Cash"); } else if (type == EConsumeType.CardAmount) { return("CardAmount"); } else { throw new Exception(); } }
public static bool Equals(string typeStr, EConsumeType type) { return(Equals(type, typeStr)); }