private void busqueda_categoria(string calificacion)
        {
            ServicioAEIClient servicio = new ServicioAEIClient();
            List <Producto>   resultado;

            //Llamamos el metodo del servicio
            servicio.BusquedaProductoConCategoriaAsync(calificacion, this.textBuscador.Text);

            //Cuando se complete la llamada se disparara el evento
            servicio.BusquedaProductoConCategoriaCompleted += (s, a) =>
            {
                resultado = a.Result;
                try
                {
                    ProductosPage.busqueda  = this.textBuscador.Text;
                    ProductosPage.productos = resultado;
                    ProductosPage.origen    = 1;
                    NavigationService.Navigate(new Uri("/ProductosPage.xaml", UriKind.Relative));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            };
        }
        private async void botonLupa_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            MessageDialog mensajeError = new MessageDialog("Su búsqueda no retornó ningún resultado.");
            ServicioAEIClient servicioProducto = new ServicioAEIClient();
            if (comboCategoria.SelectedIndex == 0)
                ListaProducto.ListaProductos = await servicioProducto.BusquedaProductoAplicacionAsync(textBoxBusqueda.Text);
            else
                ListaProducto.ListaProductos = await servicioProducto.BusquedaProductoConCategoriaAsync(comboCategoria.SelectedItem.ToString(), textBoxBusqueda.Text);

            if (ListaProducto.ListaProductos.Count() == 0)
            {
                mensajeError.ShowAsync();
            }
            else
                cargarProductos();
        }
Exemple #3
0
        private async void botonLupa_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            MessageDialog     mensajeError     = new MessageDialog("Su búsqueda no retornó ningún resultado.");
            ServicioAEIClient servicioProducto = new ServicioAEIClient();

            if (comboCategoria.SelectedIndex == 0)
            {
                ListaProducto.ListaProductos = await servicioProducto.BusquedaProductoAplicacionAsync(textBoxBusqueda.Text);
            }
            else
            {
                ListaProducto.ListaProductos = await servicioProducto.BusquedaProductoConCategoriaAsync(comboCategoria.SelectedItem.ToString(), textBoxBusqueda.Text);
            }

            if (ListaProducto.ListaProductos.Count() == 0)
            {
                mensajeError.ShowAsync();
            }
            else
            {
                cargarProductos();
            }
        }
        private void busqueda_categoria(string calificacion)
        {
            ServicioAEIClient servicio = new ServicioAEIClient();
            List<Producto> resultado;
            //Llamamos el metodo del servicio
            servicio.BusquedaProductoConCategoriaAsync(calificacion, this.textBuscador.Text);

            //Cuando se complete la llamada se disparara el evento
            servicio.BusquedaProductoConCategoriaCompleted += (s, a) =>
            {
                resultado = a.Result;
                try
                {
                    ProductosPage.busqueda = this.textBuscador.Text;
                    ProductosPage.productos = resultado;
                    ProductosPage.origen = 1;
                    NavigationService.Navigate(new Uri("/ProductosPage.xaml", UriKind.Relative));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            };
        }