Example #1
0
 private async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             PropertyMetroProgressBarSubCategoria       = true;
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
             SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
             if (SelectedESGR_ProductoSubCategoria.SubCategoria == "NINGUNA")
             {
                 PropertyVisibilitySubCategoria = Visibility.Collapsed;
             }
             else
             {
                 PropertyVisibilitySubCategoria = Visibility.Visible;
             }
             PropertyMetroProgressBarSubCategoria = false;
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Example #2
0
 public async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
             Application.Current.Dispatcher.Invoke(() =>
             {
                 if (ESGR_Producto.Opcion == "I")
                 {
                     SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
                 }
                 else
                 {
                     SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(x => x.IdSubCategoria == ESGR_Producto.ESGR_ProductoSubCategoria.IdSubCategoria);
                 }
             });
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorProducto, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 private async void MethodLoadSubCategorĂ­a(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
         SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
     });
 }
 private async void MethodLoadSubCategoria()
 {
     try
     {
         await Task.Factory.StartNew(() =>
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(SelectedESGR_ProductoCategoria);
             Application.Current.Dispatcher.Invoke(() =>
             {
                 CollectionESGR_ProductoSubCategoria.Add(new ESGR_ProductoSubCategoria()
                 {
                     IdSubCategoria = 0, SubCategoria = "TODOS"
                 });
                 SelectedESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.LastOrDefault();
             });
         });
     }
     catch (Exception ex)
     {
         CmpMessageBox.Show(SGRMessage.ListadoPedidoAnulado, ex.Message, CmpButton.Aceptar);
     }
 }
Example #5
0
 private async void MethodLoadProductoSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
             SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
             if (CollectionESGR_ProductoSubCategoria.Count == 1 && SelectedESGR_ProductoSubCategoria.SubCategoria == "NINGUNA")
             {
                 PropertyVisibilitySubCategoria = Visibility.Collapsed;
             }
             else
             {
                 PropertyVisibilitySubCategoria = Visibility.Visible;
             }
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Example #6
0
 private async void MethodLoadCategoria()
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             PropertyMetroProgressBarCategoria       = true;
             CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoriaCartaDia();
             Application.Current.Dispatcher.Invoke(() => { CollectionESGR_ProductoSubCategoria.Clear(); SelectedESGR_ProductoCategoria = CollectionESGR_ProductoCategoria.FirstOrDefault(); });
             if (CollectionESGR_ProductoCategoria.Count == 0)
             {
                 CmpMessageBox.Show(SGRMessage.TitlePedido, "No se ha registrado Carta del DĂ­a para hoy " + DateTime.Now.ToLongDateString(), CmpButton.Aceptar, () =>
                 {
                     Volver();
                 });
             }
             PropertyMetroProgressBarCategoria = false;
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.BusquedaMesaDisponible, ex.Message, CmpButton.Aceptar);
         }
     });
 }