Example #1
0
        public object DeleteUser(string useID)
        {
            JsonResponse response = new JsonResponse();
            //if (token == CurrentToken())
            //{
            BllLogin bl = new BllLogin();

            // List<LoginAtt> ll = JsonUtility.DeSerialize(args, typeof(List<LoginAtt>)) as List<LoginAtt>;
            // response.Message = bl.SaveParameter(ll, role);
            try
            {
                response.Message = bl.DeleteUser(useID);
                if (response.Message != "")
                {
                    response.IsSucess = false;
                }
                else
                {
                    response.IsSucess = true;
                }
            }
            catch (Exception ex)
            {
                response.Message  = ex.Message;
                response.IsSucess = false;
            }
            return(JsonUtility.Serialize(response));
        }
Example #2
0
 public LoginUserInfo WeixinRegister(string phone, string password, string serialnumer, string vccode)
 {
     if (MgRegister(phone, password, phone))
     {
         YiwenGPSEntities db        = new YiwenGPSEntities();
         BllLogin         bllLogin  = new BllLogin();
         LoginUserInfo    loginUser = bllLogin.SystemLogin_Bll(phone, Utils.GetMD5(password), "MgooWeixin@AMAP", "2");
         Devices          d         = new Weixin.Devices(new Common.AuthHeader()
         {
             UserID = loginUser.UserID.ToString()
         });
         var result = d.AddDevice(serialnumer, vccode, loginUser.UserID.ToString(), "-1");
         var ar     = Utils.ToObjects <ajaxResult>(result);
         if (ar.StatusCode != statusCode.Code.success)
         {
             loginUser.Address = "failure";
         }
         else
         {
             var dev = db.Devices.Where(item => item.SerialNumber == serialnumer && item.DevicePassword == vccode && item.Deleted == false).FirstOrDefault();
             loginUser.DeviceID = dev?.DeviceID.ToString();
         }
         return(loginUser);
     }
     return(null);
 }
Example #3
0
        public string DeleteOpenID(string UserID, string OpenID)
        {
            BllLogin bl  = new BllLogin();
            string   url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxda27104d229a3608&redirect_uri=http://m.mgoogps.com/login.aspx?action=weixin&type=wxpay&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect";

            if (bl.DeleteOpenID(OpenID, UserID))
            {
                return(Utils.GetResult("清除成功.", statusCode.Code.success, url));
            }
            else
            {
                return(Utils.GetResult("清除失败.", statusCode.Code.failure, url));
            }
        }
Example #4
0
        public object GetUser()
        {
            BllLogin bl = new BllLogin();

            JsonResponse response = new JsonResponse();

            try
            {
                response.ResponseData = bl.GetUser();
                response.IsSucess     = true;
            }
            catch (Exception ex)
            {
                response.Message  = ex.Message;
                response.IsSucess = false;
            }
            return(JsonUtility.Serialize(response));
        }
Example #5
0
        public string MobileApps(string appid, string appkey, string packagename, string os)
        {
            BllLogin bl     = new BllLogin();
            int      status = bl.MobileApps(appid, appkey, packagename, os);

            if (status == -1)
            {
                return(Utils.GetResult("参数错误.", statusCode.Code.failure));
            }
            else if (status == 2)
            {
                return(Utils.GetResult("已存在.", statusCode.Code.success));
            }
            else if (status > 0)
            {
                return(Utils.GetResult("操作成功.", statusCode.Code.success));
            }
            return(Utils.GetResult("操作失败.", statusCode.Code.failure));
        }