public ValidarPedidoViewModel(double precioTotal, COMANDA comanda)
        {
            PrecioTotal          = precioTotal;
            ComandaPedidoActual  = comanda;
            ListaRegistrosPedido = new ObservableCollection <FACTURA>(ComandaPedidoActual.FACTURAS);
            porcentajeIVA        = ApirRestIva.RescatarIva();

            PrecioTotalIVA = (PrecioTotal * porcentajeIVA) / 100 + precioTotal;
        }
Ejemplo n.º 2
0
        public void DeleteComanda()
        {
            BDService.DeleteComanda(PedidoActual);

            PedidoActual = new COMANDA
            {
                FechaComanda = DateTime.Now,
                Servida      = 0
            };

            BDService.AddComanda(PedidoActual);

            TotalElementosSeleccionados = 0;

            PrecioTotal = 0;

            ElementosSeleccionados = new ObservableCollection <ELEMENTOS>();

            ElementoSeleccionado = null;
        }
Ejemplo n.º 3
0
        public MainViewModel()
        {
            ListaElementos = new CollectionViewSource
            {
                Source = BDService.GetElementos()
            };

            repetido = false;

            PedidoActual = new COMANDA
            {
                FechaComanda = DateTime.Now,
                Servida      = 0
            };

            BDService.AddComanda(PedidoActual);

            TotalElementosSeleccionados = 0;

            PrecioTotal = 0;

            ElementosSeleccionados = new ObservableCollection <ELEMENTOS>();
        }
 public ValidarPedido(double precioTotal, COMANDA ComandaPedidoActual)
 {
     this.DataContext = new ValidarPedidoViewModel(precioTotal, ComandaPedidoActual);
     InitializeComponent();
 }
 public static void DeleteComanda(COMANDA item)
 {
     _contexto.COMANDAS.Remove(item);
 }
 public static int AddComanda(COMANDA item)
 {
     _contexto.COMANDAS.Add(item);
     return(_contexto.SaveChanges());
 }
Ejemplo n.º 7
0
 public static int DeleteComanda(COMANDA item)
 {
     _contexto.COMANDAS.Remove(item);
     return(_contexto.SaveChanges());
 }