public PageLayout CreatePageLayout(PageLayout pageLayout)
        {
            var layout       = ConvertToLayout(pageLayout);
            var resultLayout = _layoutRepository.CreateLayout(layout);

            UpdatePageLayout(pageLayout.PageId, resultLayout.Id);
            var result = ConvertToPageLayout(resultLayout);

            return(result);
        }
Example #2
0
 public PageLayout CreatePageLayout(PageLayout pageLayout)
 {
     try
     {
         //Not necessary, since layout and content has been seperated
         //if (pageLayout.IsChanged)
         //{
         //    DeleteModulesAndContent(pageLayout);
         //    CreateElement(pageLayout.ContentItems, pageLayout.PageId);
         //}
         var layout       = ConvertToLayout(pageLayout);
         var resultLayout = _layoutRepository.CreateLayout(layout);
         UpdatePageLayout(pageLayout.PageId, resultLayout.Id);
         var result = ConvertToPageLayout(resultLayout);
         return(result);
     }
     catch (Exception ex)
     {
         _logger.LogError(string.Format("Error occured while creating a page layout, LayoutName: ", pageLayout.Name), ex);
     }
     return(null);
 }