//-------------------------------------- //-------------------------------------- public BlogEntry BlogEntryCreate(string title, string summary, string content) { ContentTransfer contentXfer = new ContentTransfer { Content = content, Path = BlogEntry.PathMake(), Summary = summary, Title = title }; return(new BlogEntry(NodeCreate(contentXfer))); }
//-------------------------------------- //-------------------------------------- public bool BlogEntryTodayExistsTest() { try { if (repository.NodeExistsTest(BlogEntry.PathMake())) { return(true); } } catch (Exception ex) { // Replace this with a call to the logger. Debug.Print(ex.Message); } return(false); }
//------------------------- // Create a new blog entry. // Called by NodeDisplayFormProcess. //------------------------- private ActionResult BlogEntryCreate() { if (contentManager.BlogEntryTodayExistsTest()) { return(RedirectToAction("Index")); } NodeEditViewModel model = new NodeEditViewModel { Content = "[content]", Create = true, Id = 0, Path = BlogEntry.PathMake(), Summary = "[summary]", Title = "Blog Entry " + DateTime.Now.ToString("yyyy/MM/dd"), Type = "Blog" }; ViewBag.Title = "New Entry: " + model.Path; return(View("NodeEdit", model)); }