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()); }
private void UpdatePages(ICollection <coreModels.Page> original, ICollection <coreModels.Page> backup) { foreach (var item in backup) { _pagesService.SavePage(GetStoreIdForPage(item), item); } }
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)); }
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); } }