protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var ImageButton = FindViewById <ImageButton>(Resource.Id.imageButton1);

            ImageButton.Click += async(sender, e) =>
            {
                var    Client   = new SALLab13.ServiceClient();
                string Email    = "";
                string Password = "";
                var    Result   = await Client.ValidateAsync(this, Email, Password);

                Android.App.AlertDialog.Builder Builder = new AlertDialog.Builder(this);
                AlertDialog Alert = Builder.Create();
                Alert.SetTitle("Resultado de la verificación");
                Alert.SetIcon(Resource.Drawable.Icon);
                Alert.SetMessage($"{Result.Status}\n{Result.FullName}\n{Result.Token}");
                Alert.SetButton("Ok", (s, ev) => { });
                Alert.Show();
            };
        }
        async Task Validar()
        {
            var    Client = new SALLab13.ServiceClient();
            string Email  = "*****@*****.**";
            string Pass   = "******";
            var    Result = await Client.ValidateAsync(this, Email, Pass);

            Android.App.AlertDialog.Builder Builder = new AlertDialog.Builder(this);
            AlertDialog Alert = Builder.Create();

            Alert.SetTitle("Resultado de la verificación");
            Alert.SetIcon(Resource.Drawable.Icon);
            Alert.SetMessage($"{Result.Status}\n{Result.FullName}\n{Result.Token}");
            Alert.SetButton("OK", (s, e) => { });
            Alert.Show();
        }
示例#3
0
        private async void ImageButton_ClickAsync(object sender, System.EventArgs e)
        {
            var ServiceClient = new SALLab13.ServiceClient();

            string studentEmail = "*****@*****.**";
            string password     = "******";


            var Result = await ServiceClient.ValidateAsync(this, studentEmail, password);

            Android.App.AlertDialog.Builder Builder = new AlertDialog.Builder(this);
            AlertDialog Alert = Builder.Create();

            Alert.SetTitle("Resultado de la verificación");
            Alert.SetIcon(Resource.Drawable.Icon);
            Alert.SetMessage($"{Result.Status}\n{Result.FullName}\n{Result.Token}");
            Alert.SetButton("Ok", (s, ev) => { });
            Alert.Show();
        }
示例#4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.myButton);

            button.Click += async delegate
            {
                var    Client   = new SALLab13.ServiceClient();
                string EMail    = "*****@*****.**";          /* Aquí pon tu correo */
                string Password = "******";                 /* Aquí pon tu contraseña */

                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Por favor espera...");
                progress.SetCancelable(false);
                progress.Show();

                var Result = await Client.ValidateAsync(this, EMail, Password);

                Android.App.AlertDialog.Builder Builder =
                    new AlertDialog.Builder(this);
                progress.Cancel();

                AlertDialog Alert = Builder.Create();
                Alert.SetTitle("Resultado de la verificación");
                Alert.SetIcon(Resource.Drawable.dotnet);
                Alert.SetMessage(
                    $"{Result.Status}\n{Result.FullName}\n{Result.Token}");
                Alert.SetButton("Ok", (s, ev) => { });
                Alert.Show();
            };
        }
示例#5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            FindViewById <ImageButton>(Resource.Id.imageButton).Click += async(sender, e) =>
            {
                var    client   = new SALLab13.ServiceClient();
                string email    = "*****@*****.**";
                string password = "******";
                var    result   = await client.ValidateAsync(this, email, password);

                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                AlertDialog         alert   = builder.Create();
                alert.SetTitle("Resultado de la verificación");
                alert.SetIcon(Resource.Drawable.Icon);
                alert.SetMessage($"{result.Status}\n{result.FullName}\n{result.Token}");
                alert.SetButton("Ok", delegate { });
                alert.Show();
            };
        }