| | |
| | | Button btnShowPassword = new Button () { |
| | | X = etPasswrod.Right - Application.GetRealWidth (80), |
| | | Y = etPasswrod.Y + Application.GetRealHeight (12), |
| | | Width = Application.GetRealWidth (73), |
| | | Height = Application.GetRealHeight (60), |
| | | Width = Application.GetMinRealAverage (73), |
| | | Height = Application.GetMinRealAverage (60), |
| | | SelectedImagePath = "CrabtreeAdd/ShowPW.png", |
| | | UnSelectedImagePath = "CrabtreeAdd/HidePW.png", |
| | | BorderColor = SkinStyle.Current.Transparent, |
| | |
| | | Button btnShowPassword2 = new Button () { |
| | | X = etPasswrod.Right - Application.GetRealWidth (80), |
| | | Y = etConfirmPassword.Y + Application.GetRealHeight (12), |
| | | Width = Application.GetRealWidth (73), |
| | | Height = Application.GetRealHeight (60), |
| | | Width = Application.GetMinRealAverage (73), |
| | | Height = Application.GetMinRealAverage (60), |
| | | SelectedImagePath = "CrabtreeAdd/ShowPW.png", |
| | | UnSelectedImagePath = "CrabtreeAdd/HidePW.png", |
| | | BorderColor = SkinStyle.Current.Transparent, |
| | |
| | | }; |
| | | |
| | | btnOK.MouseUpEventHandler += (sender, e) => { |
| | | var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); |
| | | var ss = reg.Match (etEmailAddress.Text); |
| | | //var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); |
| | | //var ss = reg.Match (etEmailAddress.Text); |
| | | |
| | | string account = etEmailAddress.Text.Trim (); |
| | | string passwordText = etPasswrod.Text.Trim (); |
| | |
| | | } else if (regName.Match (userName).Success) { |
| | | new Alert ("", "Protect Your Illegal Characters in Name", Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (!ss.Success) { |
| | | } else if (!CommonUtlis.Current.CheckEmail (account)) { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseCheckEmailAddressCorrectly), |
| | | Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (etPasswrod.Text.Trim ().Length < 6) { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.PasswordLenghtTip), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (etPasswrod.Text == "" && etConfirmPassword.Text == "") { |
| | | } |
| | | |
| | | |
| | | |
| | | if (etPasswrod.Text == "" && etConfirmPassword.Text == "") { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseWriteTheCompleteContent), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (passwordText.Contains(userName)) { |
| | | //密码不能包含用户名 |
| | | new Alert ("", ErrorCode.PasswordNotUsername, |
| | | Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (!CommonUtlis.Current.CheckPassword(etPasswrod.Text.Trim ())) { |
| | | new Alert ("", ErrorCode.PasswordStrengthNotMatch, |
| | | Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | } else if (etPasswrod.Text.Trim () != etConfirmPassword.Text.Trim ()) { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), |
| | |
| | | var detectionAccountObj = new DetectionAccountObj () { Account = account }; |
| | | var postJson = Newtonsoft.Json.JsonConvert.SerializeObject (detectionAccountObj); |
| | | |
| | | var isExistingAccountObj = MainPage.RequestHttps (API.DetectionAccount, postJson, false); |
| | | var isExistingAccountObj = MainPage.RequestHttps (API.DetectionAccount, postJson); |
| | | if (isExistingAccountObj.StateCode == "AccountExists") { |
| | | string sssd = "这个账号已经注册。"; |
| | | if (Language.CurrentLanguage == "English") |
| | |
| | | } else { |
| | | var requestObj = new YdRegisterAccountObj () { Account = account, Password = passwordText, Contact = userName, Language = Language.CurrentLanguage, Company = MainPage.SoftSmsType }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); |
| | | var revertObj = MainPage.RequestHttps (API.YdRegisterAccount, requestJson, false); |
| | | var revertObj = MainPage.RequestHttps (API.YdRegisterAccount, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | Application.RunOnMainThread (() => { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.AuthenticationMail), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | |
| | | //2020-01-06 代补充 |
| | | if (stateCodeStr == "AccountExists") { |
| | | mes = "This account has been registered."; |
| | | } else if (stateCodeStr == "AccountYesRegisterNoIsverify") { |
| | | mes = ErrorCode.AccountYesRegisterNoIsverify; |
| | | } else if (stateCodeStr == ErrorCode.NetworkError) { |
| | | mes = ErrorCode.NetworkError; |
| | | } else { |
| | | mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr; |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty (mes)) { |
| | | Application.RunOnMainThread (() => { |