Example #1
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);
         }
     });
 }