wxr
2020-09-09 c3e1b733fc45bd9f0b88bfb560cfa87a270b079b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using Shared;
using HDL_ON.UI.CSS;
 
namespace HDL_ON.UI
{
    public partial class ResetPasswordPage : FrameLayout
    {
        FrameLayout bodyView;
        public ResetPasswordPage()
        {
            bodyView = this;
        }
 
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView();
 
 
 
        }
    }
 
    public partial class ResetPasswordPage
    {
        public void ResetPassword(string password,string repeatPassword )
        {
            var waitPage = new Loading();
            waitPage.Start("Please wait...");
            var resetResult = new DAL.Server.HttpServerRequest().ResetPassword(MainPage.LoginUser.accountString, password, repeatPassword, 86);
            if (resetResult.StateCode.ToUpper() == "SUCCESS")
            {
                Application.RunOnMainThread(() =>
                {
                    var page = new OperationResultDisPalyPage();
                    page.Show();
                    page.LoadPage(true, Language.StringByID(StringId.UnbindEmail), Language.StringByID(StringId.UnbindEmailSuccess), "");
 
                    for (int i = 0; i < 2; i++)
                    {
                        MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
                    }
                });
            }
            else
            {
                string erorrInfo = "";
                switch (resetResult.StateCode)
                {
                    case "PwdNoConfirm"://两次输入的密码不一致
                        erorrInfo = Language.StringByID(StringId.IncorrectRepeatPassword);
                        break;
                    case "AccountNoExists"://两次输入的密码不一致
                        erorrInfo = Language.StringByID(StringId.AccountNotExist);
                        break;
                    default:
                        erorrInfo = "Server error";
                        break;
                }
                Application.RunOnMainThread(() =>
                {
                    waitPage.Hide();
                    new Tip()
                    {
                        CloseTime = 1,
                        Direction = AMPopTipDirection.None,
                        Text = erorrInfo,
                    }.Show(bodyView);
                });
            }
        }
    }
}