Exemplo n.º 1
0
        private async void BtnLogin_CLicked(Object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtemail.Text))
            {
                await DisplayAlert("Error", "Debes introducir un usuario", "Aceptar");

                txtemail.Focus();
            }
            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                await DisplayAlert("Error", "Debes introducir un password", "Aceptar");

                txtemail.Focus();
            }
            aiIndicator.IsRunning = true;
            try
            {
                WsLogin  objWSL = new WsLogin();
                Usuarios result = await objWSL.conexion(txtemail.Text, txtPassword.Text);

                //DisplayAlert("Error", result, "Aceptar");
                if (result.Equals("Acceso denegado"))
                {
                    await DisplayAlert("Error", "Acceso denegado", "Aceptar");

                    aiIndicator.IsRunning = false;
                }
                else
                {
                    await DisplayAlert("Correcto", "Acceso correcto", "Aceptar " + Settings.Settings.rol);

                    aiIndicator.IsRunning = false;

                    if (Settings.Settings.rol.Equals("Alumno"))
                    {
                        WSAlumno objWSA  = new WSAlumno();
                        Alumno   result2 = await objWSA.getAlumno(txtemail.Text);

                        Console.Write("este es el emmail del alumno " + result2.nocont);

                        Settings.Settings.nocont = result2.nocont;

                        await Navigation.PushModalAsync(new DashBoardAlumno());
                    }
                    else
                    {
                        WSMaestro objWSM  = new WSMaestro();
                        Maestro   result3 = await objWSM.getMaestro(txtemail.Text);

                        Console.Write("este es el emmail del maestro " + result3.cvemae);
                        await DisplayAlert("Correcto", "Acceso correcto", "cvemae" + result3.cvemae);

                        Settings.Settings.cvemae = result3.cvemae;
                        await Navigation.PushModalAsync(new DashBoardMaestro());
                    }
                }
            }
            catch (Exception) { }
        }
Exemplo n.º 2
0
        //   private Label lblMateria, lblNogpo, lblMaestro, lblSalon;

        public MaestrosPage()
        {
            list_inst   = new List <Modelos.Maestro>();
            objWsKardex = new WSMaestro();
            //   NavigationPage.SetHasNavigationBar(this, false);  //eliminar barra de navegación
            DashBoard dashBoard = new DashBoard();

            CrearGUIAsync();
        }