| | |
| | | /// </summary> |
| | | public AccountLogin() |
| | | { |
| | | CommonPage.Instance.IsDrawerLockMode = true; |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | Tag = "Login"; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | if(CheckAccount(accountStr)==false) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); |
| | | |
| | | var requestObj = new SendDataToServer.LoginObj |
| | |
| | | //}); |
| | | }; |
| | | action(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhone(accountStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | phoneEmailForm.SelectedPhone.IsSelected = phoneEmailForm.SelectedEmail.IsSelected = false; |
| | | loginBtn.Enable = loginBtn.IsSelected = false; |
| | | loginErrorBtn.Text = string.Empty; |
| | | (sender as Button).IsSelected = true; |
| | | if((sender as Button).Tag.ToString()=="Phone") |
| | | { |
| | |
| | | pwdRow = new PwdLoginRowForm(); |
| | | pwdRow.Init(accountPwdFrameLayout, 29, 225); |
| | | pwdRow.PasswrodET.TextChangeEventHandler += Pwd_TextChange; |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | |
| | | private void Register(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | var registerPage = new AccountRegister(); |
| | | Shared.Common.CommonPage.Instance.AddChidren(registerPage); |
| | | CommonPage.Instance.AddChidren(registerPage); |
| | | registerPage.Show(); |
| | | } |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Account_TextChange(object sender,string mouseEventArgs) |
| | | { |
| | | loginErrorBtn.Text = ""; |
| | | loginErrorBtn.Text = string.Empty; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Pwd_TextChange(object sender,string mouseEventArgs) |
| | | { |
| | | loginErrorBtn.Text = ""; |
| | | loginErrorBtn.Text = string.Empty; |
| | | if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow.AccountET.Text.Trim().Length>0)) |
| | | { |
| | | loginBtn.Enable = loginBtn.IsSelected = true; |