Exemple #1
0
        public IList<Gallery> Get()
        {
            IList<Gallery> galleries = new List<Gallery>();

            using (SprocWrapper db = new SprocWrapper())
            {
                using (IDataReader reader = db.Gallery_Get(null,"SortOrder ASC"))
                {
                    int total;
                    FillGalleryCollection(reader, galleries, 0, Int32.MaxValue, out total);
                }
            }

            return galleries;
        }
Exemple #2
0
        public Gallery GetGallery(int galleryID)
        {
            IList<Gallery> galleries = new List<Gallery>();

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

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