public NuevaVentaForm(EntComanda entComanda, PuntoVentaLandingPage puntoVentaLandingPage, String nombreComanda) { InitializeComponent(); dgvVenta.DefaultCellStyle.Font = new Font("Arial", 12.00F, FontStyle.Regular); dgvVenta.RowTemplate.Height = 50; cargarProductos(); cargarCombos(); cargarBebidas(); if(entComanda != null ) { cargarComandaPrevia(entComanda.getListaProductos()); } else { entComanda = new EntComanda(); } this.puntoVentaLandingPage = puntoVentaLandingPage; this.entComanda = entComanda; this.nombreComanda = nombreComanda; nombreComandaLabel.Text = this.nombreComanda; this.entComanda.setNombreComanda(this.nombreComanda); }
public void guardarComandaPagada(EntComanda entComanda) { List<EntProductoComanda> listaDeProductosEnComanda = null; WRK_VENTAS wrkVenta = null; //Se almacena la nueva venta wrkVenta = guardarNuevaVenta(entComanda); listaDeProductosEnComanda = entComanda.getListaProductos(); //Se almacena una venta nueva en la base de datos foreach (EntProductoComanda entProductoComanda in listaDeProductosEnComanda) { guardaDetalleVenta(wrkVenta, entProductoComanda); this.context.SaveChanges(); } }