Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="password"></param>
        /// <param name="imei"></param>
        /// <param name="openId"></param>
        /// <returns>0:失败, 1:成功 2:已绑定</returns>
        public static int RegisterWeixin(string pid, string password, string imei, string openId)
        {
            SnsCenterUser snsCenterUser = new SnsCenterUser(pid, password, imei);
            var           snsuser       = snsCenterUser.GetUserInfo(pid);

            if (snsuser.UserId > 0)
            {
                if (string.IsNullOrEmpty(snsuser.WeixinCode))
                {
                    return(snsCenterUser.ChangeUserInfo(pid, new SnsUser()
                    {
                        PassportId = pid, WeixinCode = openId
                    }) > 0 ? 1 : 0);
                }
                return(2);
            }
            return(0);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="password"></param>
        /// <param name="deviceID"></param>
        /// <param name="openId"></param>
        /// <returns>0:失败, 1:成功 2:已绑定</returns>
        public static int RegisterWeixin(string pid, string password, string deviceID, string openId)
        {
            SnsCenterUser snsCenterUser = new SnsCenterUser(pid, password, deviceID);

            if (snsCenterUser.GetUserId() > 0)
            {
                if (string.IsNullOrEmpty(snsCenterUser.WeixinCode))
                {
                    SnsUser snsuser = new SnsUser()
                    {
                        PassportId = pid, WeixinCode = openId
                    };
                    return(snsCenterUser.ChangeUserInfo(pid, snsuser) > 0 ? 1 : 0);
                }
                return(2);
            }
            return(0);
        }
Beispiel #3
0
 /// <summary>
 /// 补全用户信息
 /// </summary>
 /// <param name="pid"></param>
 /// <param name="snsuser"></param>
 /// <returns></returns>
 public static int ChangeUserInfo(string pid, SnsUser snsuser)
 {
     SnsCenterUser snsCenterUser = new SnsCenterUser();
     return snsCenterUser.ChangeUserInfo(pid, snsuser);
 }
Beispiel #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="pid"></param>
 /// <param name="password"></param>
 /// <param name="imei"></param>
 /// <param name="openId"></param>
 /// <returns>0:失败, 1:成功 2:已绑定</returns>
 public static int RegisterWeixin(string pid, string password, string imei, string openId)
 {
     SnsCenterUser snsCenterUser = new SnsCenterUser(pid, password, imei);
     var snsuser = snsCenterUser.GetUserInfo(pid);
     if (snsuser.UserId > 0)
     {
         if (string.IsNullOrEmpty(snsuser.WeixinCode))
         {
             return snsCenterUser.ChangeUserInfo(pid, new SnsUser() { PassportId = pid, WeixinCode = openId }) > 0 ? 1 : 0;
         }
         return 2;
     }
     return 0;
 }
Beispiel #5
0
        /// <summary>
        /// 补全用户信息
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="snsuser"></param>
        /// <returns></returns>
        public static int ChangeUserInfo(string pid, SnsUser snsuser)
        {
            SnsCenterUser snsCenterUser = new SnsCenterUser();

            return(snsCenterUser.ChangeUserInfo(pid, snsuser));
        }
Beispiel #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="password"></param>
        /// <param name="deviceID"></param>
        /// <param name="openId"></param>
        /// <returns>0:失败, 1:成功 2:已绑定</returns>
        public static int RegisterWeixin(string pid, string password, string deviceID, string openId)
        {
            SnsCenterUser snsCenterUser = new SnsCenterUser(pid, password, deviceID);

            if (snsCenterUser.GetUserId() > 0)
            {
                if (string.IsNullOrEmpty(snsCenterUser.WeixinCode))
                {
                    SnsUser snsuser = new SnsUser() { PassportId = pid, WeixinCode = openId };
                    return snsCenterUser.ChangeUserInfo(pid, snsuser) > 0 ? 1 : 0;
                }
                return 2;
            }
            return 0;
        }