public Album getAlbum() { IAlbumGateway albumGateway = albumFinder.SelectId(5); Album album = new Album(albumGateway); return(album); }
public IAlbumGateway SelectId(int id) { Database db = new Database(); db.Connect(); SqlCommand command = db.CreateCommand(albumSelectID); command.Parameters.Add(new SqlParameter("@id", SqlDbType.Int)); command.Parameters["@id"].Value = id; SqlDataReader reader = db.Select(command); Collection <IAlbumGateway> Alba = Read(reader); IAlbumGateway Album = null; if (Alba.Count == 1) { Album = Alba[0]; } reader.Close(); db.Close(); return(Album); }
public Album(IAlbumGateway data) { this.data = data; }