public PageTemplateManageModel(PageTemplate template) : this() { Id = template.Id; Name = template.Name; Content = template.Content; IsDefaultTemplate = template.IsDefaultTemplate; ParentId = template.ParentId; Parents = _pageTemplateService.GetPossibleParents(template.Id); }
public ActionResult Create(PageTemplateManageModel model, SubmitType submit) { if (ModelState.IsValid) { var response = _pageTemplateService.SavePageTemplate(model); SetResponseMessage(response); if (response.Success) { var id = (int)response.Data; switch (submit) { case SubmitType.Save: return(RedirectToAction("Index")); default: return(RedirectToAction("Edit", new { id })); } } } model.Parents = _pageTemplateService.GetPossibleParents(); return(View(model)); }
public PageTemplateManageModel() { _pageTemplateService = HostContainer.GetInstance <IPageTemplateService>(); Content = EzCMSContants.RenderBody; Parents = _pageTemplateService.GetPossibleParents(); }