/// <summary> /// /// </summary> /// <param name="tourID"></param> /// <returns></returns> public List <ToVisit> PointsOfInterestToVisit(int tourID) { List <ToVisit> pois = new List <ToVisit>(); ToVisit t; SqlCommand command; SqlParameter paramTourID = new SqlParameter("@IDPercurso", SqlDbType.Int); command = new SqlCommand("AtraccoesPercurso", this.connection); command.CommandType = CommandType.StoredProcedure; paramTourID.Value = tourID; command.Parameters.Add(paramTourID); this.reader = command.ExecuteReader(); while (this.reader.Read()) { t = new ToVisit(); t.id = Int32.Parse(reader["ID_ATRACAO"].ToString()); t.visited = Boolean.Parse(reader["VISITADO"].ToString()); t.ordering = Int32.Parse(reader["ORDEM"].ToString()); t.beginVisit = DateTime.Parse(reader["DATA_HORA_I"].ToString()); t.endVisit = DateTime.Parse(reader["DATA_HORA_F"].ToString()); pois.Add(t); } this.reader.Close(); return(pois); }
/// <summary> /// /// </summary> /// <param name="tourID"></param> /// <returns></returns> public List<ToVisit> PointsOfInterestToVisit(int tourID) { List<ToVisit> pois = new List<ToVisit>(); ToVisit t; SqlCommand command; SqlParameter paramTourID = new SqlParameter("@IDPercurso", SqlDbType.Int); command = new SqlCommand("AtraccoesPercurso", this.connection); command.CommandType = CommandType.StoredProcedure; paramTourID.Value = tourID; command.Parameters.Add(paramTourID); this.reader = command.ExecuteReader(); while (this.reader.Read()) { t = new ToVisit(); t.id = Int32.Parse(reader["ID_ATRACAO"].ToString()); t.visited = Boolean.Parse(reader["VISITADO"].ToString()); t.ordering = Int32.Parse(reader["ORDEM"].ToString()); t.beginVisit = DateTime.Parse(reader["DATA_HORA_I"].ToString()); t.endVisit = DateTime.Parse(reader["DATA_HORA_F"].ToString()); pois.Add(t); } this.reader.Close(); return pois; }