private async void botonAddCarrito_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { detalleCompra.Cantidad = cantidadProducto; detalleCompra.Producto = producto; detalleCompra.Monto = producto.Precio; BufferUsuario.Usuario = await servicioAei.agregarCarritoAsync(BufferUsuario.Usuario, detalleCompra); MessageDialog mensajeError = new MessageDialog("Se agrego el poducto a su carrito con exito!"); mensajeError.ShowAsync(); popup.IsOpen = false; }
private void botonComprar_Click(object sender, System.Windows.RoutedEventArgs e) { detalleCompra.Cantidad = cantidadProducto; detalleCompra.Producto = producto; detalleCompra.Monto = producto.Precio; servicioAei.agregarCarritoAsync(BufferUsuario.Usuario, detalleCompra); servicioAei.agregarCarritoCompleted += (s, a) => { BufferUsuario.Usuario = a.Result; MessageBox.Show("Se agrego el poducto a su carrito con exito"); servicioAei.ConsultarUsuarioAsync(BufferUsuario.Usuario.Email); servicioAei.ConsultarUsuarioCompleted += (t, b) => { BufferUsuario.Usuario = b.Result; NavigationService.Navigate(new Uri("/StorePage.xaml", UriKind.Relative)); }; }; }