Пример #1
0
        private async void GuardarCliente(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(Rut.Text) || String.IsNullOrEmpty(Nombre.Text) || String.IsNullOrEmpty(emailEntry.Text) ||
                String.IsNullOrEmpty(Clave.Text))
            {
                await DisplayAlert("ALERTA", "Por favor complete todos los campos ", "Ok");
            }
            else
            {
                var cliente = new Cliente()
                {
                    Rut        = Convert.ToInt32(Rut.Text),
                    Nombre     = Nombre.Text,
                    Apellido   = Apellido.Text,
                    Correo     = emailEntry.Text,
                    Contrasena = Clave.Text
                };

                await ServiceConnect.PostAsync("Clientes", cliente);

                await DisplayAlert("Bienvenido " + Nombre.Text, "Te has registrado exitosamente", "Ok");

                LimpiarFormulario();
            }
        }
        private async Task CargarAsesor()
        {
            List <Asesor> listado = await ServiceConnect.GetAllAsync <Asesor>("Asesors");/*Aqui se cargan todas las comunas desde la DB*/

            Console.WriteLine(listado.Count());
            foreach (var asesor in listado)
            {
                //ControlXamarin
                Console.WriteLine(asesor.Nombre);
                AsesorPicker.Items.Add(asesor.Nombre);
            }
        }
Пример #3
0
        private async void GuardarAsesor(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(RutAsesor.Text) || String.IsNullOrEmpty(NombreAsesor.Text) || String.IsNullOrEmpty(ApellidoPaternoAs.Text)

                || String.IsNullOrEmpty(IdComunaLabel.Text) || String.IsNullOrEmpty(ApellidoMaternoAs.Text) || String.IsNullOrEmpty(IdComunaLabel.Text) ||
                String.IsNullOrEmpty(PrecioHora.Text) || String.IsNullOrEmpty(SobreMi.Text) || String.IsNullOrEmpty(Fono.Text) ||
                String.IsNullOrEmpty(CorreoAsesor.Text) || String.IsNullOrEmpty(ClaveAsesor.Text))
            {
                await DisplayAlert("ALERTA", "Por favor complete todos los campos ", "ok");
            }
            else
            {
                var asesor = new Asesor()
                {
                    Rut             = Convert.ToInt32(RutAsesor.Text),
                    Nombre          = NombreAsesor.Text,
                    ApellidoPaterno = ApellidoPaternoAs.Text,
                    ApellidoMaterno = ApellidoMaternoAs.Text,
                    Sexo            = SexoAsesorPicker.SelectedItem.ToString(),
                    FechaNacimiento = dtpFechaNacimiento.Date,
                    Nacionalidad    = NacionalidadPicker.SelectedItem.ToString(),
                    IdComuna        = Convert.ToInt32(IdComunaLabel.Text),
                    ValorHora       = Convert.ToInt32(PrecioHora.Text),
                    Comentario      = SobreMi.Text,
                    Fono            = Convert.ToInt32(Fono.Text),
                    Correo          = CorreoAsesor.Text,
                    Contrasena      = ClaveAsesor.Text,
                };


                /* await DisplayAlert("ciudad", "id " + IdComuna.Text, "ok");*/

                await ServiceConnect.PostAsync("Asesors", asesor);



                await DisplayAlert("Bienvenido " + NombreAsesor.Text, "Te has registrado exitosamente", "Ok");

                LimpiarFormularioAsesor();
            }
        }
Пример #4
0
 protected virtual void OnServiceConnect(object sender, LeapEventArgs eventArgs)
 {
     ServiceConnect.DispatchOnContext <LeapEventArgs> (this, EventContext, eventArgs);
 }
Пример #5
0
 private async Task <List <Asesor> > GetAsesorAsync()
 {
     return(await ServiceConnect.GetAllAsync <Asesor>("Asesors"));
 }
Пример #6
0
 private async Task <List <Comuna> > GetComunasAsync()
 {
     return(await ServiceConnect.GetAllAsync <Comuna>("Comunas"));
 }