Example #1
0
        public JsonResult BindAccount(int type, string accountpwd, string account, string code)
        {
            var    result   = false;
            var    contnext = true;
            var    model    = CurrentUser;
            string msg      = "";

            if (string.IsNullOrEmpty(CurrentUser.AccountPwd))
            {
                contnext = false;
                msg      = "资金密码未设置,操作失败";
            }
            if (Encrypt.GetEncryptPwd(accountpwd, CurrentUser.LoginName).ToLower() !=
                CurrentUser.AccountPwd.ToLower())
            {
                contnext = false;
                msg      = "资金密码输入错误,操作失败";
            }

            if (contnext)
            {
                result = M_UsersBusiness.BindOtherAccount(type, CurrentUser.UserID, account, ref msg);
                if (result)
                {
                    if (type == 1)
                    {
                        model.Email = account;
                    }
                    else
                    {
                        model.MobilePhone = account;
                    }
                    Session["Manage"] = model;
                }
            }
            JsonDictionary.Add("result", result);
            JsonDictionary.Add("ErrMsg", msg);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }