public ActionResult Create(Guid id, string type) { SiteMapItem parentSiteNode = GetSiteMapItem(id); var model = new ArticleCreateModel { DisplayOnSideMenu = true, IsActive = true, ParentTitle = parentSiteNode.Title, ParentUrl = parentSiteNode.Url, SortOrder = 500, Title = "Новая страница" }; return View(model); }
public ActionResult Create(Guid id, string type, ArticleCreateModel model) { SiteMapItem parentNode = GetSiteMapItem(id); model.ParentTitle = parentNode.Title; model.ParentUrl = parentNode.Url; if (!ModelState.IsValid) return View(model); string articleUrl = BusinessShell.RunWithResult( () => new AddArticleOperation(model.Abstract, User.Identity.Name, model.IsActive, id, model.Text, model.Title, model.DisplayOnMainMenu, true, model.SortOrder, _urlPatternFactory.GetUrlPatternFor(type.ToLower()))); return Redirect(articleUrl); }