示例#1
0
 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));
        }
示例#3
0
 public PageTemplateManageModel()
 {
     _pageTemplateService = HostContainer.GetInstance <IPageTemplateService>();
     Content = EzCMSContants.RenderBody;
     Parents = _pageTemplateService.GetPossibleParents();
 }