Exemple #1
0
        public Album getAlbum()
        {
            IAlbumGateway albumGateway = albumFinder.SelectId(5);
            Album         album        = new Album(albumGateway);

            return(album);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public Album(IAlbumGateway data)
 {
     this.data = data;
 }