public static ListItem GetListItem(EWXAccountType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(EWXAccountType 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(EWXAccountType type) { if (type == EWXAccountType.Subscribe) { return("订阅号"); } else if (type == EWXAccountType.AuthenticatedSubscribe) { return("认证订阅号"); } else if (type == EWXAccountType.Service) { return("服务号"); } else if (type == EWXAccountType.AuthenticatedService) { return("认证服务号"); } else { throw new Exception(); } }
public static string GetValue(EWXAccountType type) { if (type == EWXAccountType.Subscribe) { return("Subscribe"); } else if (type == EWXAccountType.AuthenticatedSubscribe) { return("AuthenticatedSubscribe"); } else if (type == EWXAccountType.Service) { return("Service"); } else if (type == EWXAccountType.AuthenticatedService) { return("AuthenticatedService"); } else { throw new Exception(); } }
public static bool Equals(string typeStr, EWXAccountType type) { return(Equals(type, typeStr)); }