Пример #1
0
        public override List<Guid> GetGalleryList(
                    Guid? id,
                    string author,
                    DateTime? initialDateCreated,
                    DateTime? finalDateCreated,
                    string description,
                    bool? isVisible,
                    string keywords,
                    DateTime? initialLastUpdated,
                    DateTime? finalLastUpdated,
                    string lastUpdatedBy,
                    string slug,
                    string title,
                    GalleryStatus? status,
                    int pageSize,
                    int pageIndex,
                    out int totalCount)
        {
            totalCount = 0;

            List<Guid> list = new List<Guid>();

            int? _totalCount = null;

            GalleryDataContext db = new GalleryDataContext(ConfigurationManager.ConnectionStrings[this.ConnectionStringName].ConnectionString);

            var query =
                db.GetGalleries(this.ApplicationName, id, author, initialDateCreated, finalDateCreated, description, isVisible, keywords,
                initialLastUpdated, finalLastUpdated, lastUpdatedBy, slug, title, status.HasValue ? status.ToString() : null,
                pageIndex * pageSize, (pageIndex * pageSize) + pageSize, ref _totalCount);

            foreach (GetGalleriesResult item in query)
                list.Add(item.ID);

            if (_totalCount.HasValue)
                totalCount = _totalCount.Value;

            return list;
        }