Exemple #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);
         }
     });
 }
Exemple #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(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
             Application.Current.Dispatcher.Invoke(() =>
             {
                 CollectionESGR_ProductoSubCategoria.Add(new ESGR_ProductoSubCategoria()
                 {
                     IdSubCategoria = 0, SubCategoria = "TODOS"
                 });
             });
             SelectedESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(x => x.IdSubCategoria == 0);
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.ListadoVentaDia, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Exemple #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);
         }
     });
 }