Example #1
0
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBGallery.AddGalleryImage(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            //IndexHelper.IndexItem(this);

            return(result);
        }
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBHtmlContent.UpdateHtmlContent(
                this.itemID,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.lastModUtc,
                this.lastModUserGuid);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #3
0
 protected void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
Example #4
0
        private bool Update()
        {
            bool result = DBSharedFiles.UpdateSharedFile(
                this.itemID,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.folderGuid,
                this.userGuid,
                this.description);

            //IndexHelper.IndexItem(this);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #5
0
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBLinks.AddLink(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.url,
                this.viewOrder,
                this.description,
                this.createdDate,
                this.createdByUser,
                this.target,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #6
0
        public bool Delete(String sourcePath)
        {
            bool result = false;

            if (itemID == -1)
            {
                return(result);
            }

            if (sourcePath != null)
            {
                SharedFile sharedFile = new SharedFile(moduleID, itemID);
                String     filePath   = Path.Combine(sourcePath, Path.GetFileName(sharedFile.ServerFileName));
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }
            }

            //IndexHelper.RemoveIndexItem(moduleID, itemID);

            DBSharedFiles.DeleteHistoryByItemID(itemID);
            // this just deletes the entry from the db
            result = DBSharedFiles.DeleteSharedFile(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }


            return(result);
        }
Example #7
0
        /// <summary>
        /// Updates this instance.
        /// </summary>
        /// <returns></returns>
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBBlog.UpdateBlog(
                this.moduleID,
                this.itemID,
                this.userName,
                this.title,
                this.excerpt,
                this.description,
                this.startDate,
                this.isInNewsletter,
                this.includeInFeed,
                this.allowCommentsForDays,
                this.location,
                this.lastModUserGuid,
                this.lastModUtc,
                this.itemUrl,
                this.metaKeywords,
                this.metaDescription,
                this.compiledMeta,
                this.isPublished);

            //IndexHelper.IndexItem(this);
            ContentChangedEventArgs e = new ContentChangedEventArgs();

            OnContentChanged(e);

            return(result);
        }
        private bool Update()
        {
            this.lastModUtc = DateTime.UtcNow;

            bool result = DBEvents.UpdateCalendarEvent(
                this.itemID,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.lastModUtc,
                this.lastModUserGuid);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #9
0
        public bool DeletePost(int postId)
        {
            bool deleted = DBGroups.GroupPostDelete(postId);

            if (deleted)
            {
                Group.DecrementPostCount(this.groupID);
                if (this.totalReplies > 0)
                {
                    DBGroups.GroupTopicDecrementReplyStats(this.topicID);
                }
                Group group = new Group(this.groupID);

                this.moduleID = group.ModuleId;
                this.postID   = postId;

                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);

                int topicPostCount = GroupTopic.GetPostCount(this.topicID);
                if (topicPostCount == 0)
                {
                    GroupTopic.Delete(this.topicID);
                    Group.DecrementTopicCount(this.groupID);
                }

                ResetTopicSequences();
            }


            return(deleted);
        }
Example #10
0
        /// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            this.itemGuid = Guid.NewGuid();

            newID = DBHtmlContent.AddHtmlContent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.excerpt,
                this.body,
                this.moreLink,
                this.sortOrder,
                this.beginDate,
                this.endDate,
                this.createdDate,
                this.createdBy,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #11
0
 public void OnContentChanged(ContentChangedEventArgs e)
 {
     if (ContentChanged != null)
     {
         ContentChanged(this, e);
     }
 }
        public bool Save(HtmlContent content)
        {
            bool result = false;

            if (content == null)
            {
                return(result);
            }

            content.LastModUtc = DateTime.UtcNow;

            if (content.ItemId > -1)
            {
                result = DBHtmlContent.UpdateHtmlContent(
                    content.ItemId,
                    content.ModuleId,
                    content.Title,
                    content.Excerpt,
                    content.Body,
                    content.MoreLink,
                    content.SortOrder,
                    content.BeginDate,
                    content.EndDate,
                    content.LastModUtc,
                    content.LastModUserGuid);
            }
            else
            {
                content.ItemGuid = Guid.NewGuid();

                int newId = DBHtmlContent.AddHtmlContent(
                    content.ItemGuid,
                    content.ModuleGuid,
                    content.ModuleId,
                    content.Title,
                    content.Excerpt,
                    content.Body,
                    content.MoreLink,
                    content.SortOrder,
                    content.BeginDate,
                    content.EndDate,
                    content.CreatedDate,
                    content.CreatedBy,
                    content.UserGuid);

                content.ItemId = newId;

                result = (newId > -1);
            }

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                content.OnContentChanged(e);
            }

            return(result);
        }
Example #13
0
        public bool Delete()
        {
            bool result = DBHtmlContent.DeleteHtmlContent(this.itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
        public bool Delete()
        {
            //IndexHelper.RemoveIndexItem(moduleID, itemID);
            bool result = DBEvents.DeleteCalendarEvent(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
Example #15
0
        public bool Delete()
        {
            bool result = DBLinks.DeleteLink(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }


            return(result);
        }
Example #16
0
        public bool Delete()
        {
            bool result = false;

            result = DBGallery.DeleteGalleryImage(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
Example #17
0
        public bool Delete()
        {
            DBBlog.DeleteItemCategories(itemID);
            DBBlog.DeleteAllCommentsForBlog(itemID);
            DBBlog.UpdateCommentStats(this.moduleID);
            bool result = DBBlog.DeleteBlog(this.itemID);

            DBBlog.UpdateEntryStats(this.moduleID);

            ContentChangedEventArgs e = new ContentChangedEventArgs();

            e.IsDeleted = true;
            OnContentChanged(e);

            return(result);
        }
        public bool Delete(HtmlContent content)
        {
            if (content == null)
            {
                return(false);
            }

            bool result = DBHtmlContent.DeleteHtmlContent(content.ItemId);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                content.OnContentChanged(e);
            }

            return(result);
        }
Example #19
0
        private bool UpdatePost()
        {
            bool result = false;

            result = DBGroups.GroupPostUpdate(
                this.postID,
                this.postSubject,
                this.postMessage,
                this.sortOrder,
                this.isApproved);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #20
0
        /// <summary>
        /// Creates a new blog
        /// </summary>
        /// <returns>true if successful</returns>
        private bool Create()
        {
            int newID = 0;

            blogGuid   = Guid.NewGuid();
            createdUtc = DateTime.UtcNow;

            newID = DBBlog.AddBlog(
                this.blogGuid,
                this.moduleGuid,
                this.moduleID,
                this.userName,
                this.title,
                this.excerpt,
                this.description,
                this.startDate,
                this.isInNewsletter,
                this.includeInFeed,
                this.allowCommentsForDays,
                this.location,
                this.userGuid,
                this.createdUtc,
                this.itemUrl,
                this.metaKeywords,
                this.metaDescription,
                this.compiledMeta,
                this.isPublished);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #21
0
        private bool Update()
        {
            bool result = DBLinks.UpdateLink(
                this.itemID,
                this.moduleID,
                this.title,
                this.url,
                this.viewOrder,
                this.description,
                this.createdDate,
                this.target,
                this.createdByUser);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #22
0
        private bool Create()
        {
            int newID = 0;

            if (this.serverFileName.Length == 0)
            {
                this.serverFileName = System.Guid.NewGuid().ToString() + ".config";
            }

            this.itemGuid = Guid.NewGuid();

            newID = DBSharedFiles.AddSharedFile(
                this.itemGuid,
                this.moduleGuid,
                this.userGuid,
                this.folderGuid,
                this.moduleID,
                this.uploadUserID,
                this.friendlyName,
                this.originalFileName,
                this.serverFileName,
                this.sizeInKB,
                this.uploadDate,
                this.folderID,
                this.description);

            this.itemID = newID;

            bool result = (newID > 0);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #23
0
        private bool CreatePost()
        {
            int  newID    = -1;
            bool approved = false;

            if (
                (ConfigurationManager.AppSettings["PostsApprovedByDefault"] != null) &&
                (string.Equals(ConfigurationManager.AppSettings["PostsApprovedByDefault"], "true", StringComparison.InvariantCultureIgnoreCase))
                )
            {
                approved = true;
            }

            this.mostRecentPostDate = DateTime.UtcNow;
            newID = DBGroups.GroupPostCreate(
                this.topicID,
                this.postSubject,
                this.postMessage,
                approved,
                this.PostUserId,
                this.mostRecentPostDate);

            this.postID = newID;
            Group.IncrementPostCount(this.groupID, this.postUserID, this.mostRecentPostDate);
            SiteUser.IncrementTotalPosts(this.postUserID);
            //IndexHelper.IndexItem(this);

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Example #24
0
        private bool Update()
        {
            bool result = DBGallery.UpdateGalleryImage(
                this.itemID,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
        private bool Create()
        {
            int newID;

            this.itemGuid    = Guid.NewGuid();
            this.createdDate = DateTime.UtcNow;

            newID = DBEvents.AddCalendarEvent(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.title,
                this.description,
                this.imageName,
                this.eventDate,
                this.startTime,
                this.endTime,
                this.userID,
                this.userGuid,
                this.location,
                this.requiresTicket,
                this.ticketPrice,
                this.createdDate);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }