예제 #1
0
        public void Limpiar()

        {
            Nombretxt.Clear();
            Apellidotxt.Clear();
            Grupocmbx.Refresh();
            contactotxt.Clear();
            Correotxt.Clear();
        }
예제 #2
0
        public async void RegisterMethod()
        {
            if (string.IsNullOrWhiteSpace(this.Emailtxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Email.", "Accept");

                return;
            }


            //Valida que el formato del correo sea valido
            bool isEmail = Regex.IsMatch(Emailtxt, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase);

            if (!isEmail)
            {
                await Application.Current.MainPage.DisplayAlert("Advertencia", "El formato del correo electrónico es incorrecto, revíselo e intente de nuevo.", "OK");

                return;
            }


            if (string.IsNullOrEmpty(this.Passwordtxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Password.", "Accept");

                return;
            }

            if (string.IsNullOrEmpty(this.Nombretxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter nombre.", "Accept");

                return;
            }



            if (string.IsNullOrEmpty(this.Edadtxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter edad.", "Accept");

                return;
            }

            else
            {
                if (Edadtxt.Length != 2)
                {
                    await Application.Current.MainPage.DisplayAlert("Advertencia", "Solo permite 2 digitos .", "OK");

                    return;
                }
            }



            this.isVisible  = true;
            this.isRunning  = true;
            this.isEnabled  = true;
            this.isPassword = true;


            await Task.Delay(1000);

            // User Modelo

            var user = new User
            {
                Email         = Emailtxt.ToLower(),
                Password      = Passwordtxt.ToLower(),
                Nombre        = Nombretxt.ToLower(),
                Edad          = Edadtxt.ToLower(),
                Creation_Date = DateTime.UtcNow.Date
            };

            await App.Database.SaveUserAsync(user);



            await Application.Current.MainPage.DisplayAlert("Datos guardados", "Bienvenido" + nombre.ToString(), "Acectar");

            this.IsRunningTxt = false;
            this.IsVisibleTxt = false;
            this.IsEnabledTxt = true;


            await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
        }
예제 #3
0
 public void Limpiar()
 {
     Nombretxt.Clear();
     Cedulatxt.Clear();
     lista_de_Cedulas.Items.Clear();
 }