Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);

                CommonStatistic.FileName = SettingsMain.SiteUrl + "/" + fileInfo.Name;
                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;
            }
        }