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

            return(album);
        }
예제 #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);
        }
예제 #3
0
파일: Album.cs 프로젝트: mrNoactiv/Pokusy
 public Album(IAlbumGateway data)
 {
     this.data = data;
 }