示例#1
0
 public GalleriesResult(string userId, string author, string title, GalleryStatus? status, 
     DateTime? initialDateCreated, DateTime? finalDateCreated,
     DateTime? initialDateModified, DateTime? finalDateModified)
 {
     this.userId = userId;
     this.author = author;
     this.title = title;
     this.status = status;
     this.initialDateCreated = initialDateCreated;
     this.finalDateCreated = finalDateCreated;
     this.initialDateModified = initialDateModified;
     this.finalDateModified = finalDateModified;
 }
示例#2
0
 public List<Guid> GetGalleryList(
     Guid? id,
     string author,
     bool? visible,
     string lastUpdatedBy,
     string title,
     GalleryStatus? status,
     int pageSize,
     int pageIndex,
     out int totalCount)
 {
     return GetGalleryList(id, author, null, null, null, visible, null, null, null, lastUpdatedBy,
         null, title, status, pageSize, pageIndex, out totalCount);
 }
示例#3
0
 public Gallery(Guid id, string caption, string orig, string thumb, DateTime pub,
                DateTime create, string origsize, string thumbsize, int order, GalleryStatus status)
 {
     this.Id           = id;
     this.Imagecaption = caption;
     this.Originalpath = orig;
     this.Thumbpath    = thumb;
     this.Publishtime  = pub;
     this.Createtime   = create;
     this.Originalsize = origsize;
     this.Thumbsize    = thumbsize;
     this.Order        = order;
     this.Status       = status;
 }
示例#4
0
 public abstract 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);
示例#5
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>();

            using (TransactionContext context = TransactionContextFactory.EnterContext(TransactionAffinity.NotSupported))
            {
                IDataSource dataSource = DataSourceFactory.GetDataSource("DbGalleryProvider");

                IDataCommand cmd = dataSource.GetCommand("GetGalleries");

                cmd.Parameters["applicationName"].Value = this.ApplicationName;

                if (id.HasValue && id.Value != Guid.Empty)
                    cmd.Parameters["id"].Value = id;
                if (!string.IsNullOrEmpty(author))
                    cmd.Parameters["author"].Value = author;
                if (initialDateCreated.HasValue && initialDateCreated.Value != DateTime.MinValue &&
                    finalDateCreated.HasValue && finalDateCreated.Value != DateTime.MinValue)
                {
                    cmd.Parameters["initialDateCreated"].Value = initialDateCreated;
                    cmd.Parameters["finalDateCreated"].Value = finalDateCreated;
                }
                if (!string.IsNullOrEmpty(description))
                    cmd.Parameters["description"].Value = description;
                if (!(HttpContext.Current != null && HttpContext.Current.User.IsInRole("Administrator")) &&
                    isVisible.HasValue)
                    cmd.Parameters["isVisible"].Value = isVisible;
                if (!string.IsNullOrEmpty(keywords))
                    cmd.Parameters["keywords"].Value = keywords;
                if (initialLastUpdated.HasValue && initialLastUpdated.Value != DateTime.MinValue &&
                    finalLastUpdated.HasValue && finalLastUpdated.Value != DateTime.MinValue)
                {
                    cmd.Parameters["initialLastUpdated"].Value = initialLastUpdated;
                    cmd.Parameters["finalLastUpdated"].Value = finalLastUpdated;
                }
                if (!string.IsNullOrEmpty(lastUpdatedBy))
                    cmd.Parameters["lastUpdatedBy"].Value = lastUpdatedBy;
                if (!string.IsNullOrEmpty(slug))
                    cmd.Parameters["slug"].Value = slug;
                if (!string.IsNullOrEmpty(title))
                    cmd.Parameters["title"].Value = title;
                if (status.HasValue)
                    cmd.Parameters["status"].Value = status.ToString();
                cmd.Parameters["firstIndex"].Value = pageIndex * pageSize;
                cmd.Parameters["lastIndex"].Value = (pageIndex * pageSize) + pageSize;

                IDataReader reader = cmd.ExecuteReader();

                try
                {
                    while (reader.Read())
                    {
                        list.Add(new Guid(reader["id"].ToString()));
                    }
                }
                finally
                {
                    if (!reader.IsClosed)
                        reader.Close();
                }

                totalCount = Convert.ToInt32(cmd.Parameters["totalCount"].Value);
            }

            return list;
        }
 public static 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)
 {
     return _defaultProvider.GetGalleryList(id, author, initialDateCreated, finalDateCreated, description,
         isVisible, keywords, initialLastUpdated, finalLastUpdated, lastUpdatedBy, slug, title, status,
         pageSize, pageIndex, out totalCount);
 }
 public static List<Guid> GetGalleryList(Guid? id, string author, bool? visible, string lastUpdatedBy, string title, GalleryStatus? status,
     int pageSize, int pageIndex, out int totalCount)
 {
     return _defaultProvider.GetGalleryList(id, author, visible, lastUpdatedBy, title, status, pageSize, pageIndex, out totalCount);
 }
示例#8
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;
        }