コード例 #1
0
        public async void RegisterMethod()
        {
            if (string.IsNullOrEmpty(this.NombreTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Nombre.", "Accept");

                return;
            }

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

                return;
            }
            if (string.IsNullOrEmpty(this.EmailTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Email.", "Accept");

                return;
            }

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

                return;
            }
            //this.IsVisibleTxt = true;
            //this.isRunning = true;
            //this.isEnabled = true;

            var carros = new Carros
            {
                Nombre   = NombreTxt.ToLower(),
                Apellido = ApellidoTxt.ToLower(),
                Email    = EmailTxt.ToLower(),
                Edad     = EdadTxt.ToLower()
            };



            var obtenerId = await _databaseQuery.SaveCarrosAsync(carros);

            var obtengoRegistro = await _databaseQuery.GetCarros();


            await Application.Current.MainPage.DisplayAlert("Datos guardados", "Perfectamente", "Acectar");



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



            // await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
        }
コード例 #2
0
        public bool ValidarCampos()
        {
            int controlador = 0;

            if (NumeroLiquidacionTxt.Text == "")
            {
                EpRegistrar.SetError(NumeroLiquidacionTxt, "ingrese numero de liquidacion");
                NumeroLiquidacionTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (CedulaTxt.Text == "")
            {
                EpRegistrar.SetError(CedulaTxt, "ingrese cedula");
                CedulaTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (NombreTxt.Text == "")
            {
                EpRegistrar.SetError(NombreTxt, "ingrese nombres");
                NombreTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (ApellidoTxt.Text == "")
            {
                EpRegistrar.SetError(ApellidoTxt, "ingrese apellidos");
                ApellidoTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (SalarioDevengadoTxt.Text == "")
            {
                EpRegistrar.SetError(SalarioDevengadoTxt, "ingrese salario");
                SalarioDevengadoTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (ValorServicioTxt.Text == "")
            {
                EpRegistrar.SetError(ValorServicioTxt, "ingrese valor");
                ValorServicioTxt.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (TipoAfiliacionCmb.Text == "")
            {
                EpRegistrar.SetError(TipoAfiliacionCmb, "ingrese afiliacion");
                TipoAfiliacionCmb.Focus();
                controlador = 1;
            }
            else
            {
                EpRegistrar.Clear();
            }
            if (controlador == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }