Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        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;
        }