| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class AppUnlockPasswordPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | EditText etPassword; |
| | | |
| | | string passwrod = ""; |
| | | string oldPasswrod = ""; |
| | |
| | | oldPasswrod = pw; |
| | | backAction = action; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | bodyView.AddChidren(btnTipError); |
| | | |
| | | |
| | | var etPassword = new EditText() |
| | | etPassword = new EditText() |
| | | { |
| | | Y = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(0), |
| | |
| | | { |
| | | if (passwrod == oldPasswrod) |
| | | { |
| | | //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | return; |
| | |
| | | this.RemoveFromParent(); |
| | | return; |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("1"); |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockType =new System.Collections.Generic.List<string>();//.Remove("1"); |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | |
| | | { |
| | | if (optionType == "5") |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("3"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("3"); |
| | | OnAppConfig.Instance.appUnlockType.Add("3"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (optionType == "6") |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("4")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("4"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("4"); |
| | | OnAppConfig.Instance.appUnlockType.Add("4"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | backAction(); |
| | |
| | | { |
| | | if (result) |
| | | { |
| | | if (!MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add(unlockType); |
| | | OnAppConfig.Instance.appUnlockType.Add(unlockType); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove(unlockType); |
| | | OnAppConfig.Instance.appUnlockType.Remove(unlockType); |
| | | } |
| | | } |
| | | backAction(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | } |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("1"); |
| | | OnAppConfig.Instance.appUnlockType.Add("1"); |
| | | } |
| | | MainPage.LoginUser.appUnlockPasswrod = passwrod; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockPasswrod = passwrod; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | backAction(); |
| | | } |
| | | else |
| | |
| | | btnTipIcon4.MouseUpEventHandler = eventHandler; |
| | | |
| | | etPassword.Foucs = true; |
| | | |
| | | |
| | | if (optionType == "3" || optionType == "5" || optionType == "6" || optionType == "7") |
| | | { |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(517), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.EnterLoginPasswordVerification, |
| | | }; |
| | | bodyView.AddChidren(btnLoginAccountVerify); |
| | | |
| | | btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (optionType == "7") |
| | | { |
| | | MainPage.GoLoginPage( UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.AccountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |