public void Execute(IJobExecutionContext context) { if (Trial.IsTrialEnabled) { return; } string strFileName = ExportFeed.GetModuleSetting("YandexMarket", "FileName"); string strPhysicalTargetFolder = SettingsGeneral.AbsolutePath; string strPhysicalFilePath = strPhysicalTargetFolder + strFileName; var exportFeedModule = new ExportFeedModuleYandex(); exportFeedModule.GetExportFeedString(strPhysicalFilePath); }
public void Execute(IJobExecutionContext context) { if (TrialService.IsTrialEnabled) { return; } if (!context.CanStart()) { return; } context.WriteLastRun(); string strFileName = ExportFeed.GetModuleSetting("GoogleBase", "FileName"); string strPhysicalTargetFolder = SettingsGeneral.AbsolutePath; string strPhysicalFilePath = strPhysicalTargetFolder + strFileName; var exportFeedModule = new ExportFeedModuleGoogleBase(); exportFeedModule.GetExportFeedString(strPhysicalFilePath); }
private static void MakeExportFile(object parameters) { var myParams = parameters as string[]; try { var moduleName = myParams[0]; var applicationPath = myParams[1]; var fileName = ExportFeed.GetModuleSetting(moduleName, "FileName"); var directory = applicationPath + "\\"; var filePath = directory + fileName; if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } if (File.Exists(filePath)) { File.Delete(filePath); } ExportFeedModule exportFeedModule = null; switch (moduleName) { case "YandexMarket": exportFeedModule = new ExportFeedModuleYandex(); break; case "GoogleBase": exportFeedModule = new ExportFeedModuleGoogleBase(); break; case "PriceGrabber": exportFeedModule = new ExportFeedModulePriceGrabber(); break; case "ShoppingCom": exportFeedModule = new ExportFeedModuleShoppingCom(); break; case "YahooShopping": exportFeedModule = new ExportFeedModuleYahooShopping(); break; case "Amazon": exportFeedModule = new ExportFeedModuleAmazon(); break; case "Shopzilla": exportFeedModule = new ExportFeedModuleShopzilla(); break; } if (exportFeedModule != null) { exportFeedModule.GetExportFeedString(filePath); } var fileInfo = new FileInfo(filePath); ExportFeedStatistic.FileName = SettingsMain.SiteUrl + "/" + fileInfo.Name; ExportFeedStatistic.FileSize = " (" + Math.Ceiling(Convert.ToDecimal(fileInfo.Length) / 1024) + " Kb)"; } catch (Exception ex) { AdvantShop.Diagnostics.Debug.LogError(ex, "on MakeExportFile in exportFeed"); } finally { ExportFeedStatistic.IsRun = false; } }
private static void MakeExportFile(string[] myParams) { try { var moduleName = myParams[0]; var applicationPath = myParams[1]; FileName = ExportFeed.GetModuleSetting(moduleName, "FileName"); var filePath = applicationPath + "/" + FileName; var directory = filePath.Substring(0, filePath.LastIndexOf('/')); if (directory != null && !Directory.Exists(directory)) { Directory.CreateDirectory(directory); } //if (File.Exists(filePath)) //{ // File.Delete(filePath); //} ExportFeedModule exportFeedModule = null; switch (moduleName) { case "YandexMarket": exportFeedModule = new ExportFeedModuleYandex(); break; case "GoogleBase": exportFeedModule = new ExportFeedModuleGoogleBase(); break; case "PriceGrabber": exportFeedModule = new ExportFeedModulePriceGrabber(); break; case "ShoppingCom": exportFeedModule = new ExportFeedModuleShoppingCom(); break; case "YahooShopping": exportFeedModule = new ExportFeedModuleYahooShopping(); break; case "Amazon": exportFeedModule = new ExportFeedModuleAmazon(); break; case "Shopzilla": exportFeedModule = new ExportFeedModuleShopzilla(); break; } if (exportFeedModule != null) { exportFeedModule.GetExportFeedString(filePath); } var fileInfo = new FileInfo(filePath); CommonStatistic.FileName = SettingsMain.SiteUrl + "/" + FileName; CommonStatistic.FileSize = " (" + Math.Ceiling(SQLDataHelper.GetDecimal(fileInfo.Length) / 1024) + " Kb)"; } catch (Exception ex) { AdvantShop.Diagnostics.Debug.LogError(ex, "on MakeExportFile in exportFeed"); } finally { CommonStatistic.IsRun = false; } }
private void LoadModuleSettings() { var moduleName = ModuleName; DatafeedTitleTextBox.Text = ExportFeed.GetModuleSetting(moduleName, "DatafeedTitle"); DatafeedDescriptionTextBox.Text = ExportFeed.GetModuleSetting(moduleName, "DatafeedDescription"); DescriptionSelectListBox.SelectedValue = ExportFeed.GetModuleSetting(ModuleName, "DescriptionSelection"); chbRemoveHTML.Checked = ExportFeed.GetModuleSetting(ModuleName, "RemoveHTML").TryParseBool(); var fileName = ExportFeed.GetModuleSetting(moduleName, "FileName"); if (fileName != null) { int dotIndex = fileName.LastIndexOf("."); FileNameTextBox.Text = dotIndex != -1 ? fileName.Substring(0, fileName.LastIndexOf(".")) : fileName; } string selectCurrency = ExportFeed.GetModuleSetting(moduleName, "Currency"); if (selectCurrency != null) { CurrencyListBox.SelectedValue = ExportFeed.GetModuleSetting(moduleName, "Currency"); } companyName1.Text = SettingsMain.ShopName; companyName2.Text = SettingsMain.ShopName; switch (moduleName) { case "YandexMarket": recomendationLiteral.InnerHtml = Resource.Admin_ExportFeed_YandexRecomendation; SalesNotes.Visible = true; Delivery.Visible = true; localDelivery.Visible = true; properties.Visible = true; TrYandexCompany.Visible = true; TrYandexShop.Visible = true; SalesNotesTextBox.Text = ExportFeed.GetModuleSetting(moduleName, "SalesNotes"); chbDelivery.Checked = ExportFeed.GetModuleSetting(moduleName, "Delivery").TryParseBool(); chbLocalDelivery.Checked = ExportFeed.GetModuleSetting(moduleName, "LocalDeliveryCost").TryParseBool(); cbProperties.Checked = ExportFeed.GetModuleSetting(moduleName, "Properties").TryParseBool(); var shopName = ExportFeed.GetModuleSetting(moduleName, "ShopName"); var companyName = ExportFeed.GetModuleSetting(moduleName, "CompanyName"); txtShopName.Text = string.IsNullOrEmpty(shopName) ? "#STORE_NAME#" : shopName; txtCompanyName.Text = string.IsNullOrEmpty(companyName) ? "#STORE_NAME#" : companyName; break; case "GoogleBase": datafeedDescRow.Visible = true; datafeedNameRow.Visible = true; GoogleProductCategoryTextBox.Text = ExportFeed.GetModuleSetting(moduleName, "GoogleProductCategory"); GoogleProductCategory.Visible = true; break; case "PriceGrabber": case "ShoppingCom": case "YahooShopping": case "Amazon": case "Shopzilla": currencyWarning.Visible = true; break; } recomendationLiteral.InnerHtml = Resource.Admin_ExportFeed_GoogleRecomendation; MainCurrencyLiteral.Text = Resource.Admin_ExportFeed_UsdCurrencyString; FileNameExtLiteral.Text = GetFileExtention(moduleName); lShopUrl.Text = string.Format("{0}/", SettingsMain.SiteUrl); }