예제 #1
0
 public async void MethodLoadCategoria()
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoria();
             Application.Current.Dispatcher.Invoke(() =>
             {
                 if (ESGR_Producto.Opcion == "I")
                 {
                     SelectESGR_ProductoCategoria = CollectionESGR_ProductoCategoria.FirstOrDefault();
                 }
                 else
                 {
                     SelectESGR_ProductoCategoria = CollectionESGR_ProductoCategoria.FirstOrDefault(x => x.IdCategoria == ESGR_Producto.ESGR_ProductoSubCategoria.ESGR_ProductoCategoria.IdCategoria);
                 }
             });
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorProducto, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 private async void MethodLoadCategoria()
 {
     await Task.Factory.StartNew(() =>
     {
         CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoriaCartaDia();
         SelectedESGR_ProductoCategoria          = CollectionESGR_ProductoCategoria.FirstOrDefault();
     });
 }
예제 #3
0
 private async void MethodLoadProductoCategoria()
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoriaCartaDia();
             SelectedESGR_ProductoCategoria          = CollectionESGR_ProductoCategoria.FirstOrDefault();
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 private void MethodLoadHeader()
 {
     try
     {
         SelectedFechaFin    = DateTime.Now;
         SelectedFechaInicio = DateTime.Now;
         CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoria();
         Application.Current.Dispatcher.Invoke(() =>
         {
             CollectionESGR_ProductoCategoria.Add(new ESGR_ProductoCategoria()
             {
                 IdCategoria = 0, Categoria = "TODOS"
             });
             SelectedESGR_ProductoCategoria = CollectionESGR_ProductoCategoria.FirstOrDefault(x => x.IdCategoria == 0);
         });
     }
     catch (Exception ex)
     {
         CmpMessageBox.Show(SGRMessage.ListadoVentaDia, ex.Message, CmpButton.Aceptar);
     }
 }
        private async void MethodLoadHeader()
        {
            try
            {
                await Task.Factory.StartNew(() =>
                {
                    CollectionESGR_ProductoCategoria.Source = new BSGR_ProductoCategoria().GetCollectionProductoCategoria();
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        CollectionESGR_ProductoCategoria.Add(new ESGR_ProductoCategoria()
                        {
                            IdCategoria = 0, Categoria = "TODOS"
                        });
                        SelectedESGR_ProductoCategoria = CollectionESGR_ProductoCategoria.LastOrDefault();

                        PropertyProfile = SGRVariables.ESGR_Usuario.ESGR_Perfil.NombrePerfil;
                    });
                });
            }
            catch (Exception ex)
            {
                CmpMessageBox.Show(SGRMessage.ListadoPedidoAnulado, ex.Message, CmpButton.Aceptar);
            }
        }
예제 #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);
         }
     });
 }