public void AddProforma(Proforma proforma) { var newProforma = new Proforma(); newProforma.ClienteId = proforma.ClienteId; // newVenta.Cliente = venta.Cliente; newProforma.Fecha = proforma.Fecha; newProforma.total = proforma.total; //newVenta.TipoDocumento = venta.TipoDocumento; foreach (var item in proforma.detalleproforma) { var detalle = new DetalleProforma(); detalle.Cantidad = item.Cantidad; detalle.ProductoId = item.ProductoId; detalle.Precio = item.Precio; //TIPO DOC newProforma.detalleproforma.Add(detalle); } _context.Proformas.Add(newProforma); _context.SaveChanges(); }
public void AddProforma(Proforma proforma) { ProformaRepository.AddProforma(proforma); }