Exemplo n.º 1
0
        private async void GetEvidences()
        {
            var ServiceClient = new HackAtHome.SAL.ServiceClient();

            evidencias.Evidences = await ServiceClient.GetEvidencesAsync(Email);

            evidencias.EvidencesAdapter =
                new ServicioWEBAPI(
                    this,
                    evidencias.Evidences,
                    Resource.Layout.ListItem,
                    Resource.Id.title,
                    Resource.Id.sub);

            lvEvidencia.Adapter = evidencias.EvidencesAdapter;
        }
Exemplo n.º 2
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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



            toolbar  = FindViewById <Toolbar>(Resource.Id.toolbar);
            etCorreo = FindViewById <EditText>(Resource.Id.etCorreo);
            etPass   = FindViewById <EditText>(Resource.Id.etPass);



            FindViewById <Button>(Resource.Id.btnValidar).Click += async(sender, e) =>
            {
                var ServiceClient = new HackAtHome.SAL.ServiceClient();

                var Result =
                    await ServiceClient.AutenticateAsync(
                        etCorreo.Text.ToString(), etPass.Text.ToString());

                if (Result.Status == Status.Success)
                {
                    SendEvidence();


                    Toast.MakeText(this,
                                   "Status Success",
                                   ToastLength.Short).Show();


                    var ActivityIntent =
                        new Android.Content.Intent(this, typeof(EvidenciaActivity));
                    ActivityIntent.PutExtra("email", Result.Token);
                    ActivityIntent.PutExtra("pass", Result.FullName);
                    StartActivity(ActivityIntent);
                }
                else
                {
                    Toast.MakeText(this,
                                   $"{Result.Status}\n{Result.FullName}\n{Result.Token}",
                                   ToastLength.Long).Show();
                }
            };
        }
Exemplo n.º 3
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.DetalleEvidencia);

            var nombreCompleto = FindViewById <TextView>(Resource.Id.TextViewItemNombre);

            nombreCompleto.Text = Intent.GetStringExtra("Nombre");

            var token       = Intent.GetStringExtra("Token");
            var evidenciaId = Intent.GetIntExtra("EvidenceID", 0);
            var titulo      = Intent.GetStringExtra("Title");
            var estado      = Intent.GetStringExtra("Status");

            var service = new HackAtHome.SAL.ServiceClient();

            var evidencia = await service.GetEvidenceByIDAsync(token, evidenciaId);

            var tituloText = FindViewById <TextView>(Resource.Id.TextViewEvidenciaItemTitulo);

            tituloText.Text = titulo;

            var description = FindViewById <WebView>(Resource.Id.evidenceDescription);

            description.LoadDataWithBaseURL(null, evidencia.Description, "text/html", "utf-8", null);


            var estadoText = FindViewById <TextView>(Resource.Id.TextViewEvidenciaEstadoItem);

            estadoText.Text = estado;

            var imagen = FindViewById <ImageView>(Resource.Id.ImageViewEvidenciaItem);

            Koush.UrlImageViewHelper.SetUrlDrawable(imagen, evidencia.Url);

            var microsoftEvidence = new LabItem
            {
                Email    = "*****@*****.**",
                Lab      = "Hack@Home",
                DeviceId = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)
            };

            var microsoftClient = new MicrosoftServiceClient();
            await microsoftClient.SendEvidence(microsoftEvidence);
        }