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);
|
});
|
}
|
}
|
}
|
}
|