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 PageManageModel(Page page) { _pageServices = HostContainer.GetInstance <IPageServices>(); var pageTemplateServices = HostContainer.GetInstance <IPageTemplateServices>(); var fileTemplateServices = HostContainer.GetInstance <IFileTemplateServices>(); int position; int relativePageId; var relativePages = _pageServices.GetRelativePages(out position, out relativePageId, page.Id, page.ParentId); Id = page.Id; Content = page.Content; Title = page.Title; FriendlyUrl = page.FriendlyUrl; Caption = page.Caption; Status = page.Status; StatusList = _pageServices.GetStatus(); ParentId = page.ParentId; Parents = _pageServices.GetPossibleParents(page.Id); FileTemplateId = page.FileTemplateId; FileTemplates = fileTemplateServices.GetFileTemplateSelectList(page.FileTemplateId); PageTemplateId = page.PageTemplateId; PageTemplates = pageTemplateServices.GetPageTemplateSelectList(page.PageTemplateId); Position = position; Positions = EnumUtilities.GetSelectListFromEnum <PageEnums.PositionEnums>(); RelativePageId = relativePageId; RelativePages = relativePages; IncludeInSiteNavigation = page.IncludeInSiteNavigation; Tags = page.PageTags.Select(t => t.TagId).ToList(); TagList = _pageServices.GetPageTags(page.Id); StartPublishingDate = page.StartPublishingDate; EndPublishingDate = page.EndPublishingDate; RecordOrder = page.RecordOrder; RecordActive = page.RecordActive; }
public PageManageModel(Page page) { _pageServices = HostContainer.GetInstance<IPageServices>(); var pageTemplateServices = HostContainer.GetInstance<IPageTemplateServices>(); var fileTemplateServices = HostContainer.GetInstance<IFileTemplateServices>(); int position; int relativePageId; var relativePages = _pageServices.GetRelativePages(out position, out relativePageId, page.Id, page.ParentId); Id = page.Id; Content = page.Content; Title = page.Title; FriendlyUrl = page.FriendlyUrl; Caption = page.Caption; Status = page.Status; StatusList = _pageServices.GetStatus(); ParentId = page.ParentId; Parents = _pageServices.GetPossibleParents(page.Id); FileTemplateId = page.FileTemplateId; FileTemplates = fileTemplateServices.GetFileTemplateSelectList(page.FileTemplateId); PageTemplateId = page.PageTemplateId; PageTemplates = pageTemplateServices.GetPageTemplateSelectList(page.PageTemplateId); Position = position; Positions = EnumUtilities.GetSelectListFromEnum<PageEnums.PositionEnums>(); RelativePageId = relativePageId; RelativePages = relativePages; IncludeInSiteNavigation = page.IncludeInSiteNavigation; Tags = page.PageTags.Select(t => t.TagId).ToList(); TagList = _pageServices.GetPageTags(page.Id); StartPublishingDate = page.StartPublishingDate; EndPublishingDate = page.EndPublishingDate; RecordOrder = page.RecordOrder; RecordActive = page.RecordActive; }
public PageManageModel() { _pageServices = HostContainer.GetInstance<IPageServices>(); var pageTemplateServices = HostContainer.GetInstance<IPageTemplateServices>(); var fileTemplateServices = HostContainer.GetInstance<IFileTemplateServices>(); int position; int relativePageId; var relativePages = _pageServices.GetRelativePages(out position, out relativePageId); StatusList = _pageServices.GetStatus(); Parents = _pageServices.GetPossibleParents(); PageTemplates = pageTemplateServices.GetPageTemplateSelectList(); FileTemplates = fileTemplateServices.GetFileTemplateSelectList(); Positions = EnumUtilities.GetSelectListFromEnum<PageEnums.PositionEnums>(); TagList = _pageServices.GetPageTags(); Position = position; RelativePageId = relativePageId; RelativePages = relativePages; IncludeInSiteNavigation = true; }
public PageManageModel() { _pageServices = HostContainer.GetInstance <IPageServices>(); var pageTemplateServices = HostContainer.GetInstance <IPageTemplateServices>(); var fileTemplateServices = HostContainer.GetInstance <IFileTemplateServices>(); int position; int relativePageId; var relativePages = _pageServices.GetRelativePages(out position, out relativePageId); StatusList = _pageServices.GetStatus(); Parents = _pageServices.GetPossibleParents(); PageTemplates = pageTemplateServices.GetPageTemplateSelectList(); FileTemplates = fileTemplateServices.GetFileTemplateSelectList(); Positions = EnumUtilities.GetSelectListFromEnum <PageEnums.PositionEnums>(); TagList = _pageServices.GetPageTags(); Position = position; RelativePageId = relativePageId; RelativePages = relativePages; IncludeInSiteNavigation = true; }