예제 #1
0
        public IList <Image> Get(int galleryID)
        {
            IList <Image> images = new List <Image>();

            using (SprocWrapper db = new SprocWrapper())
            {
                using (IDataReader reader = db.Image_Get("GalleryID=" + galleryID.ToString(), "SortOrder ASC"))
                {
                    int total;
                    FillImageCollection(reader, images, 0, Int32.MaxValue, out total);
                }
            }

            return(images);
        }
예제 #2
0
        public Image GetImage(int imageID)
        {
            IList <Image> images = new List <Image>();

            using (SprocWrapper db = new SprocWrapper())
            {
                using (IDataReader reader = db.Image_Get("ImageID=" + imageID.ToString(), null))
                {
                    int total;
                    FillImageCollection(reader, images, 0, Int32.MaxValue, out total);
                }
            }

            if (images.Count == 1)
            {
                return(images[0]);
            }
            else
            {
                return(null);
            }
        }