Exemplo n.º 1
0
        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,
                this.excludeFromRecentContent);

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

            return(result);
        }
Exemplo n.º 2
0
        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,
                    content.ExcludeFromRecentContent);
            }
            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.ExcludeFromRecentContent);

                content.ItemId = newId;

                result = (newId > -1);
            }

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

            return(result);
        }