Ejemplo n.º 1
0
        private void BtnVolver_Click(object sender, RoutedEventArgs e)
        {
            menu menu = new menu();

            menu.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private async void BtnIngresar_Click(object sender, RoutedEventArgs e)
        {
            NaturalWSClient cliente = new NaturalWSClient();

            String user = txtUser.Text.ToUpper();
            String pass = txtPass.Password.ToUpper();

            try
            {
                if (txtUser.Text.Equals(""))
                {
                    await this.ShowMessageAsync("Error", "Porfavor Ingrese su Usuario");
                }
                else if (txtPass.Password.Equals(""))
                {
                    await this.ShowMessageAsync("Error", "Porfavir Ingrese su Contraseña");
                }
                else
                {
                    if (cliente.loginAdmin(user, pass))
                    {
                        await this.ShowMessageAsync("Exito", "BIENVENIDO " + user);

                        Vistas.Administrador.menu menu = new Vistas.Administrador.menu();
                        menu.Show();
                        this.Close();
                    }
                    else
                    {
                        await this.ShowMessageAsync("Error", "Usuario o Contraseña Incorrecta");
                    }
                }
            }
            catch
            {
                await this.ShowMessageAsync("Error", "No se pudo iniciar");
            }
        }