public DetalleModelo Copia(int linea) { DetalleModelo p = new DetalleModelo(); p.Linea = linea; p.Sublinea = this.Sublinea; p.ArtiId1 = this.ArtiId1; p.DetalleDescripcion = this.DetalleDescripcion; p.Cantidad = this.Cantidad; p.UnidadId = this.UnidadId; p.UnidadDescripcion = this.UnidadDescripcion; p.Precio = this.Precio; p.DescuentoId = this.DescuentoId; p.DescuentoDescripcion = this.DescuentoDescripcion; foreach (odts.DetalleDeterminacion d in this.Determinaciones) { p.Determinaciones.Add(d.Copia(linea)); } return p; }
public List<odts.PresupuestoVentaDetalle> GetDetalleByBloque(string docuId, string presuvId, int bloqueId) { List<odts.PresupuestoVentaDetalle> lista = new List<odts.PresupuestoVentaDetalle>(); detalles_bloque = PedidovDetalleDataCtx.Q2_GET_DETALLE_BY_BLOQUE(docuId, presuvId, bloqueId).ToList(); odts.DetalleModelo p = new odts.DetalleModelo(); foreach (Q2_GET_DETALLE_BY_BLOQUEResult detalle in detalles_bloque) { string tipoLinea = detalle.LIDO_ID; if (tipoLinea == "N") { p = new odts.DetalleModelo(); p.Linea = detalle.PRESUVL_LINEA; p.Sublinea = detalle.PRESUVL_SUBLINEA; p.ArtiId1 = (int)detalle.ARTI_ID1; p.DetalleDescripcion = detalle.PRESUVL_DESCRIPCION; p.Cantidad = detalle.PRESUVL_CANTIDAD; p.UnidadId = detalle.UNID_ID; p.UnidadDescripcion = detalle.UNID_DESCRIPCION; p.Precio = detalle.PRESUVL_PRECIO; p.DescuentoId = detalle.GRDE_ID; p.DescuentoDescripcion = detalle.GRDE_DESCRIPCION; p.ComportamientoIVA = (int)detalle.COMP_ID; p.ArtiDeterminaciones = detalle.ARTI_DETERMINACIONES; p.ArtiPNTMetodologia = detalle.ARTI_PNT_METODOLOGIA; lista.Add(p); } else if (tipoLinea == "N+") { odts.DetalleDeterminacion dd = new odts.DetalleDeterminacion(); dd.Linea = detalle.PRESUVL_LINEA; dd.Sublinea = detalle.PRESUVL_SUBLINEA; dd.ArtiId1 = (int)detalle.ARTI_ID1; dd.DetalleDescripcion = detalle.PRESUVL_DESCRIPCION; dd.Cantidad = detalle.PRESUVL_CANTIDAD; dd.UnidadId = detalle.UNID_ID; dd.UnidadDescripcion = detalle.UNID_DESCRIPCION; dd.Precio = detalle.PRESUVL_PRECIO; dd.DescuentoId = detalle.GRDE_ID; dd.DescuentoDescripcion = detalle.GRDE_DESCRIPCION; dd.ComportamientoIVA = (int)detalle.COMP_ID; dd.ArtiDeterminaciones = detalle.ARTI_DETERMINACIONES; dd.ArtiPNTMetodologia = detalle.ARTI_PNT_METODOLOGIA; p.Determinaciones.Add(dd); } else { System.Windows.Forms.MessageBox.Show("Tipo de línea no contemplado, coméntalo con el responsable del desarrollo"); } } return lista; }