public ItemFactura(Consumo Consumo) { this.Consumo = Consumo; this.Precio = Consumo.Consumible.Precio; this.Descripción = Consumo.Consumible.Descripción; this.Cantidad = Consumo.Cantidad; }
public ItemFactura(DataRow row) { Row = row; Id = GetValue <int>("id_item_factura"); Consumo = new Consumo(row); Leyenda = GetValue <string>("leyenda"); Subtotal = GetValue <decimal>("subtotal"); Factura = new Factura(row); }
public int agregar(Consumo consumo) { conexion.Open(); SqlCommand cmd = new SqlCommand("NPM.P_Insertar_consumo", conexion); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@estadia", consumo.Estadia); cmd.Parameters.AddWithValue("@habitacion", consumo.Habitacion); cmd.Parameters.AddWithValue("@nombre", consumo.Consumible); cmd.Parameters.AddWithValue("@cantidad", consumo.cantidad); retorno = cmd.ExecuteNonQuery(); conexion.Close(); return(retorno); }