Example #1
0
 /// <summary>
 /// Update the blog group.
 /// </summary>
 /// <param name="blogGroup">The group to insert.</param>
 /// <returns>The blog group id</returns>
 public abstract bool UpdateBlogGroup(BlogGroup blogGroup);
Example #2
0
        public static BlogGroup LoadBlogGroup(IDataReader reader)
        {
            BlogGroup group = new BlogGroup();

            group.Id = ReadInt32(reader, "Id");
            group.Title = ReadString(reader, "Title");
            group.Description = ReadString(reader, "Description");
            group.DisplayOrder = ReadInt32(reader, "DisplayOrder");
            group.IsActive = ReadBoolean(reader, "Active");
            return group;
        }
Example #3
0
 /// <summary>
 /// Inserts the blog group.
 /// </summary>
 /// <param name="blogGroup">The group to insert.</param>
 /// <returns>The blog group id</returns>
 public override bool UpdateBlogGroup(BlogGroup blogGroup)
 {
     return _procedures.UpdateBlogGroup(
         id: blogGroup.Id,
         title: blogGroup.Title,
         active: blogGroup.IsActive,
         description: blogGroup.Description.NullIfEmpty(),
         displayOrder: blogGroup.DisplayOrder.NullIfMinValue());
 }
Example #4
0
 /// <summary>
 /// Inserts the blog group.
 /// </summary>
 /// <param name="blogGroup">The group to insert.</param>
 /// <returns>The blog group id</returns>
 public abstract int InsertBlogGroup(BlogGroup blogGroup);
Example #5
0
 /// <summary>
 /// Inserts the blog group.
 /// </summary>
 /// <param name="blogGroup">The group to insert.</param>
 /// <returns>The blog group id</returns>
 public override int InsertBlogGroup(BlogGroup blogGroup)
 {
     return _procedures.InsertBlogGroup(
         title: blogGroup.Title,
         active: blogGroup.IsActive,
         displayOrder: blogGroup.DisplayOrder.NullIfMinValue(),
         description: blogGroup.Description.NullIfEmpty());
 }
Example #6
0
        void ToggleActive()
        {
            try
            {
                BlogGroup group = Repository.GetBlogGroup(GroupId, false);
                var blogGroup = new BlogGroup
                {
                    Id = GroupId,
                    Title = txtTitle.Text,
                    Description = txtDescription.Text,
                    IsActive = !IsActive,
                    DisplayOrder = group.DisplayOrder,
                };

                Repository.UpdateBlogGroup(blogGroup);
            }
            catch (BaseBlogConfigurationException e)
            {
                messagePanel.ShowError(e.Message);
            }

            BindList();
        }
Example #7
0
        // Saves a new blog group.  Any exceptions are propagated up to the caller.
        void SaveNewGroup()
        {
            int displayOrder;
            if (!Int32.TryParse(txtDisplayOrder.Text, out displayOrder))
            {
                displayOrder = NullValue.NullInt32;
            }

            var blogGroup = new BlogGroup
            {
                Title = txtTitle.Text,
                Description = txtDescription.Text,
                IsActive = true,
                DisplayOrder = displayOrder,
            };

            if (Repository.InsertBlogGroup(blogGroup) > 0)
            {
                messagePanel.ShowMessage(Resources.GroupsEditor_BlogGroupCreated);
            }
            else
            {
                messagePanel.ShowError(Resources.Message_UnexpectedError);
            }
        }
Example #8
0
        // Saves changes to a blog group.  Any exceptions are propagated up to the caller.
        void SaveGroupEdits()
        {
            int displayOrder;
            if (!Int32.TryParse(txtDisplayOrder.Text, out displayOrder))
            {
                displayOrder = NullValue.NullInt32;
            }

            var blogGroup = new BlogGroup
            {
                Id = GroupId,
                Title = txtTitle.Text,
                Description = txtDescription.Text,
                IsActive = Convert.ToBoolean(hfActive.Value),
                DisplayOrder = displayOrder,
            };

            if (Repository.UpdateBlogGroup(blogGroup))
            {
                messagePanel.ShowMessage(Resources.GroupsEditor_BlogGroupSaved);
            }
            else
            {
                messagePanel.ShowError(Resources.Message_UnexpectedError);
            }
        }
Example #9
0
 public void CanSetAndGetSimpleProperties()
 {
     var group = new BlogGroup();
     UnitTestHelper.AssertSimpleProperties(group);
 }