using Shared.SimpleControl.Phone; using System; namespace Shared.SimpleControl.Pad { /// /// 注册 /// public class Register_info : Dialog { public int user_type = 0; /// /// 构造函数 /// public Register_info () { BackgroundColor = SkinStyle.Current.MainColor; Width = Application.GetRealWidth (870); Height = Application.GetRealHeight (1050); Register_infoShow (); } void Register_infoShow () { Button topButton = new Button () { Height = Application.GetRealHeight (120), BackgroundColor = 0xFF333333, TextID = R.MyInternationalizationString.UserAccount, TextAlignment = TextAlignment.Center, TextSize = 20, }; AddChidren (topButton); #region FrameLayout FrameLayoutView = new FrameLayout () { Y = topButton.Bottom, BackgroundColor = SkinStyle.Current.MainColor, Height = Application.GetRealHeight (1000), }; AddChidren (FrameLayoutView); Button btnEmail = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (60), Y = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.Email, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (btnEmail); Button Register_Star = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = btnEmail.Right + Application.GetRealWidth (10), Y = Application.GetRealHeight (77), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star); EditText Register_Email_Address = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Star.Right + Application.GetRealWidth (3), Y = Application.GetRealHeight (40), //BorderWidth=1, //BorderColor=SkinStyle.Current.DelColor, BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, // SelectedImagePath = "Register/Register_City_Kuang_on.png", // PlaceholderText = Language.StringByID (R.MyInternationalizationString.PleaseEnterPassword), TextAlignment = TextAlignment.Center, }; Register_Email_Address.MouseUpEventHandler += (sender, e) => { }; FrameLayoutView.AddChidren (Register_Email_Address); Button btnPassword = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = btnEmail.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.Password, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (btnPassword); Button Register_Star1 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star.Bottom + Application.GetRealHeight (89), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star1); EditText Register_password = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Star.Right + Application.GetRealWidth (3), Y = btnEmail.Bottom + Application.GetRealHeight (20), BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, TextAlignment = TextAlignment.Center, }; Register_password.MouseUpEventHandler += (sender, e) => { }; FrameLayoutView.AddChidren (Register_password); Button Repeat_password = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = btnPassword.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.RepeatPassword, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (Repeat_password); Button Register_Star2 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star1.Bottom + Application.GetRealHeight (90), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star2); EditText Register_Repeat_password = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Star.Right + Application.GetRealWidth (3), Y = btnPassword.Bottom + Application.GetRealHeight (20), BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, TextAlignment = TextAlignment.Center, }; Register_Repeat_password.MouseUpEventHandler += (sender, e) => { }; FrameLayoutView.AddChidren (Register_Repeat_password); var location = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = Repeat_password.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.Location, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (location); Button Register_Star3 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star2.Bottom + Application.GetRealHeight (90), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star3); EditText etCountry = new EditText () { Width = Application.GetRealWidth (270), Height = Application.GetRealHeight (85), X = Register_Repeat_password.X, Y = Register_Repeat_password.Bottom + Application.GetRealHeight (20), UnSelectedImagePath = "Register/Register_City_Kuang.png", PlaceholderText = Language.StringByID (R.MyInternationalizationString.Country1), PlaceholderTextColor = 0xFF333333, TextAlignment = TextAlignment.Center, Radius = (uint)Application.GetRealHeight (0), }; etCountry.MouseUpEventHandler += (sender, e) => { if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } }; FrameLayoutView.AddChidren (etCountry); EditText etCity = new EditText () { Width = Application.GetRealWidth (270), Height = Application.GetRealHeight (85), X = etCountry.Right + Application.GetRealWidth (20), Y = etCountry.Y, UnSelectedImagePath = "Register/Register_City_Kuang.png", PlaceholderText = Language.StringByID (R.MyInternationalizationString.City1), PlaceholderTextColor = 0xFF333333, TextAlignment = TextAlignment.Center, Radius = (uint)Application.GetRealHeight (0), }; etCity.MouseUpEventHandler += (sender, e) => { if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } }; FrameLayoutView.AddChidren (etCity); Button btnCompany = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = location.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.Company1, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (btnCompany); Button Register_Star4 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star3.Bottom + Application.GetRealHeight (91), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star4); EditText etRegister_company = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Repeat_password.X, Y = etCountry.Bottom + Application.GetRealHeight (20), BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, //SelectedImagePath = "Register/Register_City_Kuang_on.png", TextAlignment = TextAlignment.Center, }; etRegister_company.MouseUpEventHandler += (sender, e) => { if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } }; FrameLayoutView.AddChidren (etRegister_company); var btnContacts = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = btnCompany.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.Contact1, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (btnContacts); Button Register_Star5 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star4.Bottom + Application.GetRealHeight (92), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star5); EditText etContacts = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Repeat_password.X, Y = btnCompany.Bottom + Application.GetRealHeight (20), BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, //SelectedImagePath = "Register/Register_City_Kuang_on.png", TextAlignment = TextAlignment.Center, }; etContacts.MouseUpEventHandler += (sender, e) => { if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } }; FrameLayoutView.AddChidren (etContacts); Button btnCall = new Button () { Width = Application.GetRealWidth (160), Height = Application.GetRealHeight (85), X = Application.GetRealWidth (40), Y = btnContacts.Bottom + Application.GetRealHeight (20), TextID = R.MyInternationalizationString.Call, TextAlignment = TextAlignment.CenterLeft, TextSize = 12, TextColor = 0xFFDBDDDF, }; FrameLayoutView.AddChidren (btnCall); Button Register_Star6 = new Button () { Width = Application.GetRealWidth (15), Height = Application.GetRealHeight (15), X = Register_Star.X, Y = Register_Star5.Bottom + Application.GetRealHeight (92), UnSelectedImagePath = "Register/Register_Star.png", }; FrameLayoutView.AddChidren (Register_Star6); EditText etCall = new EditText () { Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (85), X = Register_Repeat_password.X, Y = etContacts.Bottom + Application.GetRealHeight (20), BorderWidth = 1, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, //SelectedImagePath = "Register/Register_City_Kuang_on.png", TextAlignment = TextAlignment.Center, }; etCall.MouseUpEventHandler += (sender, e) => { if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } }; FrameLayoutView.AddChidren (etCall); #endregion #region Button btnClose = new Button () { X = etCall.X, Y = etCall.Bottom + Application.GetRealHeight (40), Width = Application.GetRealWidth (250), Height = Application.GetRealHeight (90), BackgroundColor = 0xFF2f2f2f, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextSize = 18, BorderWidth = 0, Radius = 5, TextID = R.MyInternationalizationString.Cancel }; FrameLayoutView.AddChidren (btnClose); btnClose.MouseUpEventHandler += (sender, e) => { this.Close (); new Register ().Show (); }; Button btnOK = new Button () { Width = Application.GetRealWidth (250), Height = Application.GetRealHeight (90), X = btnClose.Right + Application.GetRealWidth (40), Y = btnClose.Y, BackgroundColor = 0xFF2f2f2f, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextSize = 18, BorderWidth = 0, Radius = 5, TextID = R.MyInternationalizationString.OK }; FrameLayoutView.AddChidren (btnOK); btnOK.MouseDownEventHandler += (sender, e) => { btnOK.IsSelected = true; }; btnOK.MouseUpEventHandler += (sender, e) => { btnOK.IsSelected = false; }; btnOK.MouseUpEventHandler += (sender, e) => { if (Register_Email_Address.Text == "" && Register_password.Text == "" && etCountry.Text == "" && etCity.Text == "" && etRegister_company.Text == "" && etContacts.Text == "" && etCall.Text == "") { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.PleaseWriteTheCompleteContent), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } if (Register_password.Text.Trim () != Register_Repeat_password.Text.Trim ()) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch), Language.StringByID (R.MyInternationalizationString.Close)).Show (); return; } try { WebServiceLogin service_sign = new WebServiceLogin (); var result = 99;//service_sign.SignIn (Register_Email_Address.Text.Trim (), Register_password.Text.Trim (), etCountry.Text.Trim (), etCity.Text.Trim (), etRegister_company.Text.Trim (), etContacts.Text.Trim (), etCall.Text.Trim (), Language.CurrentLanguage); /// /// 0:成功 /// 1:信息没填完整 /// 2: 邮箱格式错误 /// 3:邮箱已经存在 /// 4:发送失败 /// if (result == 0) { Close (); } else if (result == 1) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.PleaseWriteTheCompleteContent), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } else if (result == 2) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.PleaseCheckEmailAddressCorrectly), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } else if (result == 3) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.EmailAddressAlreadyExists), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } else if (result == 4) { new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.SendEmaiFailed), Language.StringByID (R.MyInternationalizationString.Close)).Show (); } else { Close (); } } 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 } } }