public ActionResult CreatePost(Models.HTMLContent x) { if(ModelState.IsValid) { var newPost = new Post(); newPost.Content = x.HtmlContent; newPost.Title = x.Title; newPost.IsApproved = false; newPost.DatePosted = DateTime.Now; var manager = new BlogManager(); var response = manager.AddPost(newPost); return View("Pending"); } else { return View("NewAdminPost"); } }
public ActionResult CreatePost(HTMLContent x) { var newPost = new Domain.Post(); newPost.Content = x.HtmlContent; newPost.Title = x.Title; newPost.IsApproved = true; newPost.DatePosted = DateTime.Now; if (ModelState.IsValid) { var manager = new BlogManager(); var response = manager.AddPost(newPost); return RedirectToAction("Index"); } else { return View("OwnerAddPost"); } }