| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | this.RemoveFromParent(); |
| | | return; |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType =new System.Collections.Generic.List<string>();//.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 |
| | |
| | | { |
| | | if (optionType == "7") |
| | | { |
| | | MainPage.GoLoginPage(MainPage.LoginUser.accountString); |
| | | MainPage.GoLoginPage( UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var loginResult = new DAL.Server.HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); |
| | | if (loginResult.StateCode.ToUpper() == "SUCCESS") |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.AccountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | | //登录失败 |
| | | else |
| | | { |
| | | string tipStr = "Sever erorr"; |
| | | switch (loginResult.StateCode) |
| | | { |
| | | case "ValidCodeAndPhoneNoEqual": |
| | | tipStr = Language.StringByID(StringId.VerificationCodeError); |
| | | break; |
| | | case "USERNAMEORPWDERROR": |
| | | tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError); |
| | | break; |
| | | case "ACCOUNTNOEXISTS": |
| | | tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS); |
| | | break; |
| | | case "NoRecord": |
| | | tipStr = Language.StringByID(StringId.PlsGetTheVerificationCode); |
| | | break; |
| | | case "Self:Net_Error": |
| | | tipStr = Language.StringByID(StringId.NetworkAnomaly); |
| | | break; |
| | | } |
| | | //账号或者密码错误 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //提示原因 |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipStr, |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(bodyView); |
| | | }); |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |