public ActionResult Create(PageManageModel model, SubmitTypeEnums submit) { if (ModelState.IsValid) { var response = _pageServices.SavePageManageModel(model); if (response.Success) { var pageId = (int)response.Data; SetSuccessMessage(response.Message); switch (submit) { case SubmitTypeEnums.Save: return(RedirectToAction("Index")); default: return(RedirectToAction("Edit", new { id = pageId })); } } SetErrorMessage(response.Message); } model.Parents = _pageTemplateServices.GetPossibleParents(); model.Positions = EnumUtilities.GetSelectListFromEnum <PageEnums.PositionEnums>(); model.RelativePages = _pageServices.GetRelativePages(model.Id, model.ParentId); model.StatusList = _pageServices.GetStatus(); model.PageTemplates = _pageTemplateServices.GetPageTemplateSelectList(model.PageTemplateId); return(View(model)); }
public PageTemplateManageModel(PageTemplate template) : this() { Id = template.Id; Name = template.Name; Content = template.Content; ParentId = template.ParentId; Parents = _pageTemplateServices.GetPossibleParents(template.Id); }
public JsonResult GetParents(int?id) { return(Json(_pageTemplateServices.GetPossibleParents(id), JsonRequestBehavior.AllowGet)); }
public PageTemplateManageModel() { _pageTemplateServices = HostContainer.GetInstance <IPageTemplateServices>(); Content = Configurations.RenderBody; Parents = _pageTemplateServices.GetPossibleParents(); }
public PageTemplateManageModel() { _pageTemplateServices = HostContainer.GetInstance<IPageTemplateServices>(); Content = Configurations.RenderBody; Parents = _pageTemplateServices.GetPossibleParents(); }