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

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
示例#2
0
 public ThirdLoginInfo(int id, EThirdLoginType thirdLoginType, string thirdLoginName, bool isEnabled, int taxis, string description, string settingsXml)
 {
     Id             = id;
     ThirdLoginType = thirdLoginType;
     ThirdLoginName = thirdLoginName;
     IsEnabled      = isEnabled;
     Taxis          = taxis;
     Description    = description;
     SettingsXml    = settingsXml;
 }
示例#3
0
 public static bool Equals(EThirdLoginType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
示例#4
0
        public bool IsExists(EThirdLoginType thirdLoginType)
        {
            var exists = false;

            var parms = new IDataParameter[]
            {
                GetParameter(ParmType, EDataType.VarChar, 50, EThirdLoginTypeUtils.GetValue(thirdLoginType))
            };

            using (var rdr = ExecuteReader(SqlSelectByType, parms))
            {
                if (rdr.Read())
                {
                    exists = true;
                }
                rdr.Close();
            }

            return(exists);
        }
示例#5
0
 public static string GetDescription(EThirdLoginType type)
 {
     if (type == EThirdLoginType.Weibo)
     {
         return("新浪微博");
     }
     else if (type == EThirdLoginType.QQ)
     {
         return("QQ账号");
     }
     else if (type == EThirdLoginType.WeixinPC)
     {
         return("微信账号");
     }
     else if (type == EThirdLoginType.WeixinMob)
     {
         return("微信账号");
     }
     else
     {
         throw new Exception();
     }
 }
示例#6
0
 public static string GetValue(EThirdLoginType type)
 {
     if (type == EThirdLoginType.Weibo)
     {
         return("Weibo");
     }
     else if (type == EThirdLoginType.QQ)
     {
         return("QQ");
     }
     else if (type == EThirdLoginType.WeixinPC)
     {
         return("WeixinPC");
     }
     else if (type == EThirdLoginType.WeixinMob)
     {
         return("WeixinMob");
     }
     else
     {
         throw new Exception();
     }
 }
示例#7
0
 public static bool Equals(string typeStr, EThirdLoginType type)
 {
     return(Equals(type, typeStr));
 }