using Shared.SimpleControl.Phone; using System; namespace Shared.SimpleControl.Pad { public class ForgotPassword : Dialog { /// /// 构造函数 /// public ForgotPassword () { ForgotPasswordShow (); } void ForgotPasswordShow () { FrameLayout BodyView = new FrameLayout () { }; BodyView.MouseUpEventHandler += (sender, e) => { this.Close (); new Register ().Show (); }; AddChidren (BodyView); #region BOTTOM var FrameLayoutView = new FrameLayout () { Width = Application.GetRealWidth(860), Height = Application.GetRealHeight (860), BackgroundColor = SkinStyle.Current.MainColor, Gravity = Gravity.Center }; BodyView.AddChidren (FrameLayoutView); Button TopButton = new Button () { Height = Application.GetRealHeight (120), TextID = R.MyInternationalizationString.ForgotPassword, TextAlignment = TextAlignment.Center, BackgroundColor = 0xFF333333, TextSize = 20 }; FrameLayoutView.AddChidren (TopButton); EditText Register_Email_Address = new EditText () { Width = Application.GetRealWidth (700), Height = Application.GetRealHeight (100), X = Application.GetRealWidth (70), Y = Application.GetRealHeight (300), UnSelectedImagePath = "Register/Register_Email_Address.png", //SelectedImagePath = "Register/Register_Email_Address_on.png", PlaceholderText = Language.StringByID (R.MyInternationalizationString.EmailAddress ), PlaceholderTextColor = 0xFF333333, TextAlignment = TextAlignment.Center, Radius = (uint)Application.GetRealHeight (0), }; Register_Email_Address.MouseUpEventHandler += (sender, e) => { //Register_Email_Address.IsSelected = !Register_Email_Address.IsSelected; }; FrameLayoutView.AddChidren (Register_Email_Address); Button Register_Send = new Button () { Width = Application.GetRealWidth (700), Height = Application.GetRealHeight (100), X = Register_Email_Address.X, Y = Register_Email_Address.Bottom + Application.GetRealHeight (210), BackgroundColor = 0xFF2f2f2f, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextID = R.MyInternationalizationString.Send , TextAlignment = TextAlignment.Center, TextSize = 20, }; FrameLayoutView.AddChidren (Register_Send); Register_Send.MouseDownEventHandler += (sender, e) => { Register_Send.IsSelected = true; }; Register_Send.MouseUpEventHandler += (sender, e) => { try { Register_Send.IsSelected = false; WebServiceLogin Forgot_password = new WebServiceLogin (); var result = Forgot_password.ForgetPassword (Register_Email_Address .Text .Trim (),0); /// /// 0:发送成功 /// 1:发送失败 /// if (result == 1) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.SendEmaiFailed ), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } else { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.CheckMailbox ), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } } catch(Exception ex) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.CheckInternet), Language.StringByID (R.MyInternationalizationString.Close)).Show (); string mess = ex.Message; } }; #endregion } } }