public static string Eliminar(int idDetalleDescuento) { DatosDetalleDescuento DetalleDescuento = new DatosDetalleDescuento(); DetalleDescuento.IdDetalleDescuento = idDetalleDescuento; return(DetalleDescuento.Eliminar(DetalleDescuento)); }
/*MÉTODOS QUE LLAMAN A LOS MÉTODOS CORRESPONDIENTES DE LA CLASE "DATOSDESCUENTO" DE LA CAPADATOS*/ public static string Insertar(string nombreDescuento, string descripcion, DataTable dtDetalleDescuento) { DatosDescuento Descuento = new DatosDescuento(); Descuento.NombreDescuento = nombreDescuento; Descuento.Descripcion = descripcion; List <DatosDetalleDescuento> DetalleDescuento = new List <DatosDetalleDescuento>(); foreach (DataRow row in dtDetalleDescuento.Rows) { DatosDetalleDescuento detalleDescuento = new DatosDetalleDescuento(); detalleDescuento.IdArticulo = Convert.ToInt32(row["IdArticulo"].ToString()); detalleDescuento.Cantidad = Convert.ToDecimal(row["Cantidad"].ToString()); detalleDescuento.PorcentajeGanancia = Convert.ToDecimal(row["PorcentajeGanancia"].ToString()); detalleDescuento.MontoInversion = Convert.ToDecimal(row["MontoInversion"].ToString()); detalleDescuento.PrecioVentaDescuento = Convert.ToDecimal(row["PrecioVentaDescuento"].ToString()); detalleDescuento.Actualizar = Convert.ToBoolean(row["Actualizar"].ToString()); DetalleDescuento.Add(detalleDescuento); } return(Descuento.Insertar(Descuento, DetalleDescuento)); }