Ejemplo n.º 1
0
 private static LineUp CreateLineUp(DbDataReader reader)
 {
     LineUp lineup = new LineUp();
     lineup.ID = Convert.ToString(reader["lineup_id"]);
     lineup.Date = Convert.ToDateTime(reader["lineup_date"]).ToShortDateString();
     lineup.From = reader["lineup_from"].ToString();
     lineup.Until = reader["lineup_until"].ToString() ;
     //lineup.Stage = //een methode die de stage name ophaalt -> enkel name (string) is genoeg
     lineup.band = BandRepository.GetBandByID(Convert.ToInt32(reader["lineup_band"]));
     return lineup;
 }
Ejemplo n.º 2
0
        public static LineUp GetLineUpByID(int id)
        {
            LineUp gevondenLineUp = new LineUp();
            DbParameter paramid = Database.AddParameter("@ID", id);
            string sql = "SELECT * FROM lineup WHERE lineup_id = @ID";
            DbDataReader reader = Database.GetData(sql, paramid);
            while (reader.Read())
            {
                gevondenLineUp = CreateLineUp(reader);
            }

            return gevondenLineUp;
        }