예제 #1
0
        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));
        }
예제 #2
0
 public PageTemplateManageModel(PageTemplate template)
     : this()
 {
     Id       = template.Id;
     Name     = template.Name;
     Content  = template.Content;
     ParentId = template.ParentId;
     Parents  = _pageTemplateServices.GetPossibleParents(template.Id);
 }
예제 #3
0
 public JsonResult GetParents(int?id)
 {
     return(Json(_pageTemplateServices.GetPossibleParents(id), JsonRequestBehavior.AllowGet));
 }
예제 #4
0
 public PageTemplateManageModel()
 {
     _pageTemplateServices = HostContainer.GetInstance <IPageTemplateServices>();
     Content = Configurations.RenderBody;
     Parents = _pageTemplateServices.GetPossibleParents();
 }
예제 #5
0
 public PageTemplateManageModel()
 {
     _pageTemplateServices = HostContainer.GetInstance<IPageTemplateServices>();
     Content = Configurations.RenderBody;
     Parents = _pageTemplateServices.GetPossibleParents();
 }