コード例 #1
0
        async void btnRegistrar_Clicked(object sender, EventArgs e)
        {
            if (emocion.Score > 0)
            {
                var  bd = new ServicioBaseDatos();
                bool op = (emocion.Id > 0)
                    ? await bd.ActualizarEmocion(emocion)
                    : await bd.AgregarEmocion(emocion);

                if (op)
                {
                    await DisplayAlert("Éxito", "Operación realizada con éxito", "OK");

                    await Navigation.PopAsync(true);
                }
                else
                {
                    await DisplayAlert("Error", "Rating no registrado", "OK");
                }
            }
            else
            {
                await DisplayAlert("Error", "Debes analizar una foto primero.", "OK");
            }
        }