コード例 #1
0
ファイル: EWXAccountType.cs プロジェクト: yankaics/cms-1
        public static ListItem GetListItem(EWXAccountType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
コード例 #2
0
ファイル: EWXAccountType.cs プロジェクト: yankaics/cms-1
 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);
 }
コード例 #3
0
ファイル: EWXAccountType.cs プロジェクト: yankaics/cms-1
 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();
     }
 }
コード例 #4
0
ファイル: EWXAccountType.cs プロジェクト: yankaics/cms-1
 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();
     }
 }
コード例 #5
0
ファイル: EWXAccountType.cs プロジェクト: yankaics/cms-1
 public static bool Equals(string typeStr, EWXAccountType type)
 {
     return(Equals(type, typeStr));
 }