Ejemplo n.º 1
0
 public static BlogCategory GetFakeBlogCategory(int blogConfigId, int blogUserId)
 {
     var blogCategory = new BlogCategory()
     {
         BlogConfigId = blogConfigId,
         CreateDate = DateTime.Now,
         CreatedById = blogUserId,
         Description = "Test",
         IsActive = true,
         Title = "test",
         LastUpdateDate = DateTime.Now
     };
     return blogCategory;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new BlogCategory object.
 /// </summary>
 /// <param name="blogCategoryId">Initial value of the BlogCategoryId property.</param>
 /// <param name="blogConfigId">Initial value of the BlogConfigId property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 /// <param name="createdById">Initial value of the CreatedById property.</param>
 /// <param name="lastUpdateDate">Initial value of the LastUpdateDate property.</param>
 /// <param name="lastUpdatedById">Initial value of the LastUpdatedById property.</param>
 public static BlogCategory CreateBlogCategory(global::System.Int32 blogCategoryId, global::System.Int32 blogConfigId, global::System.String title, global::System.DateTime createDate, global::System.Int32 createdById, global::System.DateTime lastUpdateDate, global::System.Int32 lastUpdatedById)
 {
     BlogCategory blogCategory = new BlogCategory();
     blogCategory.BlogCategoryId = blogCategoryId;
     blogCategory.BlogConfigId = blogConfigId;
     blogCategory.Title = title;
     blogCategory.CreateDate = createDate;
     blogCategory.CreatedById = createdById;
     blogCategory.LastUpdateDate = lastUpdateDate;
     blogCategory.LastUpdatedById = lastUpdatedById;
     return blogCategory;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BlogCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBlogCategories(BlogCategory blogCategory)
 {
     base.AddObject("BlogCategories", blogCategory);
 }
Ejemplo n.º 4
0
 public string GetCategoryLinkLineForEntry(BlogCategory[] categories)
 {
     StringBuilder sb = new StringBuilder();
     foreach (var category in categories)
     {
         sb.Append("<a href=\"" + this.Content("/Category/" + category.Title) + "\" title=\"" + category.Title + "\">" + category.Title + "</a>");
         //sb.Append("<a href=\"http://" + (
         //    CacheAccessor.GetBlogConfig().Host) + "/category/" + category.Title + "\" title=\"" + category.Title + "\">" + category.Title + "</a>");
         sb.Append(", ");
     }
     return (sb.ToString().Trim(' ').Trim(','));
 }
Ejemplo n.º 5
0
        public void SaveCategory()
        {
            BlogCategory category = null;

            //Create new audit record
            var newLog = new BlogLog()
            {
                BlogConfigId = this.blogConfig.BlogConfigId,
                CreateDate = DateTime.Now,
                EventLevel = "Audit",
                Logger = "CategoriesEditScreen"
            };

            if (this.BlogCategoryId.HasValue && this.BlogCategoryId > 0)
            {
                category = repo.GetBlogCategoryByCategoryId(this.blogConfig.BlogConfigId, this.BlogCategoryId.Value);

                newLog.Message = "Changing Category with ID = " + this.BlogCategoryId.Value +
                    "\nOld Title: " + category.Title + " \nNew Title: " + this.Title +
                    "\nOld Description: " + category.Description + " \nNew Desccription: " + this.Description +
                    "\nOld Active: " + category.IsActive + " \nNew Active: " + this.IsActive +
                    "\nBy user: "******"New Category "+
                    "\nNew Title: " + this.Title +
                    "\nNew Desccription: " + this.Description +
                    "\nNew Active: " + this.IsActive;

                category = new BlogCategory()
                {
                    BlogConfigId = this.blogConfig.BlogConfigId,
                    CreateDate = DateTime.Now,
                    CreatedById = SessionHandler.CurrentUserId,
                    Description = this.Description,
                    IsActive = this.IsActive,
                    Title = this.Title
                };
                repo.Add(category);
            }

            category.LastUpdateDate = DateTime.Now;
            category.LastUpdatedById = SessionHandler.CurrentUserId;
            repo.Add(newLog);

            repo.Save();
        }
Ejemplo n.º 6
0
 public void Add(BlogCategory blogCategory)
 {
     db.BlogCategories.AddObject(blogCategory);
 }
Ejemplo n.º 7
0
 public void Delete(BlogCategory blogCategory)
 {
     db.BlogCategories.DeleteObject(blogCategory);
 }