HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-14 e90209beae6a4e822cecb18e6889f8bda23f630e
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs
@@ -50,7 +50,7 @@
            rowOldPsw.Y = Application.GetRealHeight(26);
            frameBackGroud.AddChidren(rowOldPsw);
            var txtoldPsw = new TextInputControl(Application.GetRealWidth(800), rowOldPsw.Height);
            txtoldPsw.X = HdlControlResourse.XXLeft;
            txtoldPsw.X = ControlCommonResourse.XXLeft;
            txtoldPsw.SecureTextEntry = true;
            txtoldPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputOldPsw);
            rowOldPsw.AddChidren(txtoldPsw);
@@ -76,7 +76,7 @@
            btnForgotPsw.TextID = R.MyInternationalizationString.ForgotPasswordMsg;
            btnForgotPsw.TextAlignment = TextAlignment.CenterRight;
            frameBackGroud.AddChidren(btnForgotPsw);
            btnForgotPsw.X = bodyFrameLayout.Width - HdlControlResourse.XXLeft - btnForgotPsw.Width;
            btnForgotPsw.X = bodyFrameLayout.Width - ControlCommonResourse.XXLeft - btnForgotPsw.Width;
            btnForgotPsw.ButtonClickEvent += (sender, e) =>
            {
                var form = new ForgotAccountPasswordForm();
@@ -90,7 +90,7 @@
            rowNewPsw.Y = Application.GetRealHeight(236);
            frameBackGroud.AddChidren(rowNewPsw);
            var txtNewPsw = new TextInputControl(Application.GetRealWidth(800), rowNewPsw.Height);
            txtNewPsw.X = HdlControlResourse.XXLeft;
            txtNewPsw.X = ControlCommonResourse.XXLeft;
            txtNewPsw.SecureTextEntry = true;
            txtNewPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputNewPassword);
            rowNewPsw.AddChidren(txtNewPsw);
@@ -115,7 +115,7 @@
            rowConfirmPsw.Y = rowNewPsw.Bottom + Application.GetRealHeight(10);
            frameBackGroud.AddChidren(rowConfirmPsw);
            var txtConfirmPsw = new TextInputControl(Application.GetRealWidth(800), rowConfirmPsw.Height);
            txtConfirmPsw.X = HdlControlResourse.XXLeft;
            txtConfirmPsw.X = ControlCommonResourse.XXLeft;
            txtConfirmPsw.SecureTextEntry = true;
            txtConfirmPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewPassword);
            rowConfirmPsw.AddChidren(txtConfirmPsw);
@@ -152,7 +152,7 @@
                    return;
                }
                //保存密码
                this.SavePassword(txtoldPsw.Text, txtConfirmPsw.Text);
                this.SavePassword(txtConfirmPsw.Text);
            };
        }
@@ -163,13 +163,15 @@
        /// <summary>
        /// 保存密码
        /// </summary>
        /// <param name="i_oldPsw"></param>
        /// <param name="i_newPsw"></param>
        private void SavePassword(string i_oldPsw, string i_newPsw)
        /// <param name="newPassword"></param>
        private void SavePassword(string newPassword)
        {
            //编辑密码
            var result = HdlAccountLogic.Current.EditorPassword(i_oldPsw, i_newPsw);
            if (result == false)
            var pra = new SavePasswordPra();
            pra.NewPassword = newPassword;
            //更改密码
            bool flage = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatePassword", false, pra);
            if (flage == false)
            {
                return;
            }
@@ -178,7 +180,7 @@
            this.ShowMassage(ShowMsgType.Remind, msg, () =>
             {
                 //从新登录
                 HdlAccountLogic.Current.ReLoginAgain(Common.Config.Instance.Account);
                 UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
             }, Language.StringByID(R.MyInternationalizationString.Login));
        }
@@ -213,6 +215,12 @@
                this.msgControl.TextID = R.MyInternationalizationString.uPleaseRepeatInputNewPassword;
                return false;
            }
            if (oldPsw != Common.Config.Instance.Password)
            {
                //密码错误,请重新输入
                this.msgControl.TextID = R.MyInternationalizationString.uOldPsswordIsError;
                return false;
            }
            if (newPsw != newPsw2)
            {
                //确认密码不一致,请重新输入
@@ -241,5 +249,24 @@
        }
        #endregion
        #region ■ 结构体_____________________________
        /// <summary>
        /// 保存密码的启动参数类
        /// </summary>
        private class SavePasswordPra
        {
            /// <summary>
            /// 旧密码
            /// </summary>
            public string OldPassword = Common.Config.Instance.Password;
            /// <summary>
            /// 新密码
            /// </summary>
            public string NewPassword = string.Empty;
        }
        #endregion
    }
}