Example #1
0
 public ActionResult EditContentItem(ContentItem model)
 {
     var ci = _context.ContentItem.Include("Content").First(c => c.Id == model.Id);
     ci.SortOrder = model.SortOrder;
     ci.Text = HttpUtility.HtmlDecode(model.Text);
     _context.SaveChanges();
     return RedirectToAction("SiteContent", "Home", new { area = "", id = ci.Content.Name });
 }
Example #2
0
        public ActionResult AddContentItem(int contentId, ContentItem model)
        {
            var content = _context.Content.First(c => c.Id == contentId);

            var ci = new ContentItem
                     {
                         SortOrder = model.SortOrder,
                         Text = HttpUtility.HtmlDecode(model.Text)
                     };
            content.ContentItems.Add(ci);
            _context.SaveChanges();
            return RedirectToAction("SiteContent", "Home", new { area="", id = content.Name });
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ContentItem EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContentItem(ContentItem contentItem)
 {
     base.AddObject("ContentItem", contentItem);
 }
Example #4
0
 /// <summary>
 /// Create a new ContentItem object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="sortOrder">Initial value of the SortOrder property.</param>
 /// <param name="contentId">Initial value of the ContentId property.</param>
 public static ContentItem CreateContentItem(global::System.Int32 id, global::System.Int32 sortOrder, global::System.Int32 contentId)
 {
     ContentItem contentItem = new ContentItem();
     contentItem.Id = id;
     contentItem.SortOrder = sortOrder;
     contentItem.ContentId = contentId;
     return contentItem;
 }
Example #5
0
        public ActionResult EditContentItem(ContentItem model)
        {
            var ci = _context.TechnologyItem.Include("Technology").First(c => c.Id == model.Id);
            ci.SortOrder = model.SortOrder;
            ci.Text = HttpUtility.HtmlDecode(model.Text);
            _context.SaveChanges();

            var parent = _context.Technology.Include("Parent").First(t => t.Id == ci.TechnologyId);

            string catId = "";
            string subCatId = "";
            if (parent.Parent != null)
            {
                catId = parent.Parent.Name;
                subCatId = parent.Name;
            }
            else
            {
                catId = parent.Name;
            }

            return RedirectToAction("Technologies", "Home", new { area = "", categoryId = catId, subCategoryId = subCatId });
        }