copy from ZigbeeApp/Shared/Phone/UserCenter/Safety/EdtiorUserPasswordForm.cs
copy to ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs
File was copied from ZigbeeApp/Shared/Phone/UserCenter/Safety/EdtiorUserPasswordForm.cs |
| | |
| | | namespace Shared.Phone.UserCenter.Safety
|
| | | {
|
| | | /// <summary>
|
| | | /// 修改用户密码的画面
|
| | | /// 创建新的胁迫密码
|
| | | /// </summary>
|
| | | public class EdtiorUserPasswordForm : EditorCommonForm
|
| | | public class CoercePswAddNewForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 用户账号
|
| | | /// </summary>
|
| | | private int pswNo = 0;
|
| | | private int pswNo = 5;
|
| | | /// <summary>
|
| | | /// 第一个密码
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_pswNo">用户账号</param>
|
| | | /// <param name="i_titleText">头部标题信息</param>
|
| | | public void ShowForm(int i_pswNo, string i_titleText)
|
| | | /// <param name="i_pswTip">密码备注</param>
|
| | | public void ShowForm(string i_pswTip)
|
| | | {
|
| | | this.pswNo = i_pswNo;
|
| | | //设置头部信息
|
| | | base.SetTitleText(i_titleText);
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCoercePassword));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | this.InitMiddleFrame(i_pswTip);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | /// <param name="i_pswTip">密码备注</param>
|
| | | private void InitMiddleFrame(string i_pswTip)
|
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //请输入新安防密码
|
| | | pswControl = new PswNumberInputControl(Language.StringByID(R.MyInternationalizationString.uPleaseInputNewSafetyPassword), 4);
|
| | | //请输入新胁迫密码
|
| | | pswControl = new PswNumberInputControl(Language.StringByID(R.MyInternationalizationString.uPleaseInputNewCoercePassword), 4);
|
| | | pswControl.NumberIconBackColor = UserCenterColor.Current.White;
|
| | | pswControl.Gravity = Gravity.CenterHorizontal;
|
| | | pswControl.Y = Application.GetRealHeight(102);
|
| | | bodyFrameLayout.AddChidren(pswControl);
|
| | | pswControl.InitControl();
|
| | |
|
| | |
| | | string msg = this.CheckPassword(firstPsw, pssword);
|
| | | if (msg != string.Empty)
|
| | | {
|
| | | //请重复输入新安防密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewSafetyPassword));
|
| | | //请重复输入新胁迫密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewCoercePassword));
|
| | | //设置错误信息
|
| | | pswControl.SetErrorMsg(msg);
|
| | | return;
|
| | | }
|
| | | //执行修改用户密码
|
| | | this.ChangedAdminPassword(firstPsw, pssword);
|
| | | this.ChangedAdminPassword(firstPsw, i_pswTip);
|
| | | }
|
| | | else
|
| | | {
|
| | | firstPsw = pssword;
|
| | | //请重复输入新安防密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewSafetyPassword));
|
| | | //请重复输入新胁迫密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewCoercePassword));
|
| | | }
|
| | | };
|
| | | }
|
| | |
| | | /// 执行修改用户密码
|
| | | /// </summary>
|
| | | /// <param name="pswValue1">新密码</param>
|
| | | /// <param name="pswValue2">确认密码</param>
|
| | | private async void ChangedAdminPassword(string pswValue1, string pswValue2)
|
| | | private async void ChangedAdminPassword(string pswValue1, string i_titleText)
|
| | | {
|
| | | //执行修改
|
| | | bool result = await HdlSafeguardLogic.Current.ChangedUserPassword(this.pswNo, pswValue1);
|
| | | bool result = await HdlSafeguardLogic.Current.ChangedUserPassword(this.pswNo, pswValue1, string.Empty);
|
| | | if (result == false)
|
| | | {
|
| | | firstPsw = string.Empty;
|
| | | //请输入新安防密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseInputNewSafetyPassword));
|
| | | //请输入新胁迫密码
|
| | | pswControl.ResetControlInfo(Language.StringByID(R.MyInternationalizationString.uPleaseInputNewCoercePassword));
|
| | |
|
| | | return;
|
| | | }
|
| | |
|
| | | //用户密码已更新
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uUserPasswordRefreshMsg);
|
| | | //胁迫密码设置成功
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetCoercePasswordSuccess);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | |
|
| | | //界面直接关闭(暂时)
|
| | | //界面直接关闭
|
| | | this.CloseForm();
|
| | | //关闭编辑界面
|
| | | this.CloseFormByFormName("CoercePswEditorForm");
|
| | |
|
| | | var form = new CoercePswEditorForm();
|
| | | form.AddForm(pswValue1, i_titleText);
|
| | | }
|
| | |
|
| | | #endregion
|