Ejemplo n.º 1
0
 public RealizarPregunta(Models.Evento_Usuario R)
 {
     InitializeComponent();
     // Title = "Realizar Pregunta";
     _eveU              = R;
     btnenviar.Clicked += Btnenviar_Clicked;
 }
Ejemplo n.º 2
0
 public Encuesta(Models.Evento_Usuario R, string Titulo)
 {
     InitializeComponent();
     Title              = "Evalua esta charla!";
     _Eveu              = R;
     LblCharla.Text     = Titulo;
     btnEnviar.Clicked += BtnEnviar_Clicked;
 }
        async public Task <bool> RegistrarEvento_Usuario(Models.Evento_Usuario semi)
        {
            var json    = JsonConvert.SerializeObject(semi);
            var content = new StringContent(json, Encoding.UTF8, "application/json");

            httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Settings.AccesToken);
            var response = await httpClient.PostAsync(BaseUri, content);

            return(response.IsSuccessStatusCode);
        }
        private async void getUserEve()
        {
            if (_eveu == null)
            {
                var R = await api.GetEvento_Usuario(Convert.ToInt32(Settings.idUsuario), _evento.Id);

                if (R != null)
                {
                    _eveu = R;
                }
            }
        }
Ejemplo n.º 5
0
        private async void GuardarEu(Models.Evento_Usuario EveU, string Titulo)
        {
            var resp = await apiEventosU.RegistrarEvento_Usuario(EveU);

            if (resp)
            {
                await  DisplayAlert("Aviso", Titulo + " fue agregado a tus eventos!", "Ok");
            }
            else
            {
                await DisplayAlert("Aviso", "Error de conexión, intenta de nuevo", "Ok");
            }
        }
Ejemplo n.º 6
0
        private void Switch_Toggled(object sender, ToggledEventArgs e)
        {
            var task = (sender as Switch).BindingContext as Models.Evento;

            if (e.Value)
            {
                if (task != null)
                {
                    var eu = new Models.Evento_Usuario()
                    {
                        Id_evento  = task.Id,
                        Id_usuario = Convert.ToInt32(Settings.idUsuario)
                    };
                    GuardarEu(eu, task.Titulo);
                }
            }
            else
            {
                if (task != null)
                {
                    EliminarEu(task.Id, task.Titulo);
                }
            }
        }