예제 #1
0
        public async void Calificar(object sender, EventArgs e)
        {
            EstudiantePutDto estudiantado = new EstudiantePutDto();

            estudiantado.NumeroControl = id;
            estudiantado.PIN           = 5484;
            estudiantado.Calificacion  = int.Parse(edtCal.Text);
            var bandera = await service.PonerMiCalificacion(estudiantado);

            if (bandera)
            {
                Toast.MakeText(this, "Asistencia", ToastLength.Long).Show();
                var detallesIntent = new Intent(this, typeof(MainActivity));
                StartActivity(detallesIntent);
            }
            else
            {
                Toast.MakeText(this, "Error", ToastLength.Long).Show();
            }
        }
예제 #2
0
        public async Task <bool> PonerMiCalificacion(EstudiantePutDto datos)
        {
            string baseurl = "http://ne2exam2v1.azurewebsites.net/api/Exam3/";
            var    Client  = new HttpClient();

            Client.MaxResponseContentBufferSize = 256000;

            var           uril     = new Uri(baseurl);
            var           json     = JsonConvert.SerializeObject(datos);
            StringContent content  = new StringContent(json, Encoding.UTF8, "application/json");
            var           response = await Client.PutAsync(uril, content);

            if (response.IsSuccessStatusCode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }