public bool ReadTour(int id_tour) { try { string sqlcommand = "SELECT * FROM TOURS WHERE ID_TOUR = :id_tour"; Conexion conn = new Conexion(sqlcommand); conn.Command.Parameters.Add("id_tour", id_tour); conn.Read(); while (conn.Reader.Read()) { Agente agente = new Agente(); agente.ReadAgente(conn.Reader.GetString(4)); IdTour = conn.Reader.GetInt32(0); ValorTotal = conn.Reader.GetInt32(1); Descripcion = conn.Reader.GetString(2); NumeroContrato = conn.Reader.GetInt32(3); Agente = agente; FechaCreacion = conn.Reader.GetDateTime(5); FechaInicio = conn.Reader.GetDateTime(6); return(true); } return(false); } catch (Exception) { throw; } }
public Tour(int idTour, int valortotal, string descripcion, int numeroContrato, Agente agente, DateTime fechaCreacion, DateTime fechaInicio) { IdTour = idTour; ValorTotal = valortotal; Descripcion = descripcion; NumeroContrato = numeroContrato; Agente = agente; FechaCreacion = fechaCreacion; FechaInicio = fechaInicio; }