public ValidarPedidoViewModel(double precioTotal, COMANDA comanda) { PrecioTotal = precioTotal; ComandaPedidoActual = comanda; ListaRegistrosPedido = new ObservableCollection <FACTURA>(ComandaPedidoActual.FACTURAS); porcentajeIVA = ApirRestIva.RescatarIva(); PrecioTotalIVA = (PrecioTotal * porcentajeIVA) / 100 + precioTotal; }
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; }
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()); }
public static int DeleteComanda(COMANDA item) { _contexto.COMANDAS.Remove(item); return(_contexto.SaveChanges()); }