예제 #1
0
 public void EditPageContent(PageContent pageContent)
 {
     var pageContentToEdit = GetPageContent(pageContent.PageContentId);
     pageContentToEdit.OrderNumber = pageContent.OrderNumber;
     pageContentToEdit.YPlaceId = pageContent.YPlaceId;
     pageContentToEdit.XPlaceId = pageContent.XPlaceId;
     _db.SaveChanges();
 }
예제 #2
0
 private void SavePageContentOrder(PageContent pageContent, int pageContentId, int yPlaceId, int xPlaceId, int orderNumber, List<PageContent> pageContents)
 {
     var pageContentsToOrder = pageContents.Where(p => p.YPlaceId == yPlaceId && p.XPlaceId == xPlaceId && p.PageContentId != pageContentId).OrderBy(p => p.OrderNumber).ToList();
         var i = 1;
         var isPageUpdated = false;
         foreach (var p in pageContentsToOrder)
         {
             if (orderNumber == i && pageContent != null)
             {
                 _pageManager.EditPageContent(PreparePageContent(pageContent, orderNumber, yPlaceId, xPlaceId));
                 i++;
                 isPageUpdated = true;
             }
             p.OrderNumber = i++;
             _pageManager.EditPageContent(p);
         }
         if (!isPageUpdated && pageContent != null)
         {
             _pageManager.EditPageContent(PreparePageContent(pageContent, orderNumber, yPlaceId, xPlaceId));
         }
 }
예제 #3
0
 private PageContent PreparePageContent(PageContent pageContent, int orderNumber, int yPlaceId, int xPlaceId)
 {
     pageContent.OrderNumber = orderNumber;
     pageContent.YPlaceId = yPlaceId;
     pageContent.XPlaceId = xPlaceId;
     return pageContent;
 }
예제 #4
0
 public void EditPageContent(PageContent pageContent)
 {
     _pageRepository.EditPageContent(pageContent);
 }