示例#1
0
 private async void MethodLoadPedido(ESGR_Pedido ESGR_Pedido)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             ESGR_VentaCuenta.ESGR_Venta.ESGR_Pedido = ESGR_Pedido;
             if (CollectionESGR_PedidoDetalle.Count == 0)
             {
                 PropertyFiltroPedido = string.Empty;
             }
             Application.Current.Dispatcher.Invoke(() =>
             {
                 if (ESGR_VentaCuenta.Opcion == "I")
                 {
                     CollectionESGR_VentaDetalle.Clear();
                     CollectionESGR_PedidoDetalle.ToList().ForEach(x =>
                     {
                         CollectionESGR_VentaDetalle.Add(new ESGR_VentaDetalle()
                         {
                             Cantidad         = x.Cantidad,
                             ESGR_Producto    = x.ESGR_Producto,
                             ESGR_VentaCuenta = this.ESGR_VentaCuenta,
                             Importe          = 0
                         });
                     });
                 }
             });
             MethodCalcularTotales();
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 private void MethodClear()
 {
     CollectionESGR_PedidoDetalle.Clear();
     CollectionESGR_VentaDetalle.Clear();
 }