コード例 #1
0
        public IHttpActionResult SaveItem(string storeId, Page page)
        {
            if (!string.IsNullOrEmpty(page.FileUrl))
            {
                using (var webClient = new WebClient())
                {
                    var byteContent = webClient.DownloadData(page.FileUrl);
                    page.ByteContent = byteContent;
                }
            }

            _pagesService.SavePage(storeId, page.ToCoreModel());
            return(Ok());
        }
コード例 #2
0
 private void UpdatePages(ICollection <coreModels.Page> original, ICollection <coreModels.Page> backup)
 {
     foreach (var item in backup)
     {
         _pagesService.SavePage(GetStoreIdForPage(item), item);
     }
 }
コード例 #3
0
        public IHttpActionResult SaveItem(string storeId, Page page)
        {
            base.CheckCurrentUserHasPermissionForObjects(ContentPredefinedPermissions.Update, new ContentScopeObject {
                StoreId = storeId
            });

            if (!string.IsNullOrEmpty(page.FileUrl))
            {
                using (var webClient = new WebClient())
                {
                    var byteContent = webClient.DownloadData(page.FileUrl);
                    page.ByteContent = byteContent;
                }
            }

            _pagesService.SavePage(storeId, page.ToCoreModel());
            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #4
0
        private void SavePages(VirtoData virtoData, ShopifyImportParams importParams, ShopifyImportNotification notification)
        {
            notification.Description = "Saving pages";
            _notifier.Upsert(notification);

            foreach (var page in virtoData.Pages)
            {
                _pagesService.SavePage(importParams.StoreId, page);

                notification.Progresses[PagesKey].ProcessedCount++;
                _notifier.Upsert(notification);
            }
        }