예제 #1
0
파일: PagesService.cs 프로젝트: hmnzr/SCMS
        private Page CreatePage(string title, string content, string pageKey, int? parentPageId, bool isOverridden, int? rootPageId, string rootPageKey = null)
        {
            var page = new Page();

            page.Title = title;
            page.Content = content;
            page.RouteKey = pageKey;
            page.IsOverridden = isOverridden;

            if (parentPageId.HasValue)
                page.ParentPageId = parentPageId.Value;

            if (!String.IsNullOrWhiteSpace(rootPageKey))
            {
                page.RootPageKey = rootPageKey;
            }
            else if (rootPageId.HasValue)
            {
                var pagesRepository = _repositoryFactory.GetPagesRepository();
                rootPageKey = pagesRepository.GetById(rootPageId.Value).RouteKey;
                page.RootPageKey = rootPageKey;
            }

            return page;
        }
예제 #2
0
파일: PagesService.cs 프로젝트: hmnzr/SCMS
        private void SavePage(Page page)
        {
            var pagesRepository = _repositoryFactory.GetPagesRepository();

            using (new UnitOfWork(EntitiesContext.Current))
            {
                pagesRepository.Add(page);
            }
        }