コード例 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ExportFeed.RefreshModuleSetting(ModuleName, "FileName", FileNameTextBox.Text + "." + GetFileExtention(ModuleName));
            ExportFeed.RefreshModuleSetting(ModuleName, "Currency", CurrencyListBox.SelectedValue);
            ExportFeed.RefreshModuleSetting(ModuleName, "DescriptionSelection", DescriptionSelectListBox.SelectedValue);
            ExportFeed.RefreshModuleSetting(ModuleName, "RemoveHTML", chbRemoveHTML.Checked.ToString());

            if (ModuleName == "YandexMarket")
            {
                ExportFeed.RefreshModuleSetting(ModuleName, "Delivery", chbDelivery.Checked.ToString());
                ExportFeed.RefreshModuleSetting(ModuleName, "LocalDeliveryCost", chbLocalDelivery.Checked.ToString());
                ExportFeed.RefreshModuleSetting(ModuleName, "Properties", cbProperties.Checked.ToString());
                ExportFeed.RefreshModuleSetting(ModuleName, "SalesNotes", SalesNotesTextBox.Text);
                ExportFeed.RefreshModuleSetting(ModuleName, "ShopName", txtShopName.Text);
                ExportFeed.RefreshModuleSetting(ModuleName, "CompanyName", txtCompanyName.Text);
            }

            if (ModuleName == "GoogleBase")
            {
                ExportFeed.RefreshModuleSetting(ModuleName, "DatafeedTitle", DatafeedTitleTextBox.Text);
                ExportFeed.RefreshModuleSetting(ModuleName, "DatafeedDescription", DatafeedDescriptionTextBox.Text);
                ExportFeed.RefreshModuleSetting(ModuleName, "GoogleProductCategory", GoogleProductCategoryTextBox.Text);
            }
            saveSuccess.Visible = true;
        }
コード例 #2
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);
        }
コード例 #3
0
    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);
    }
コード例 #4
0
ファイル: ExportFeedDet.aspx.cs プロジェクト: gkovalev/nastia
    protected void Unnamed12_Click(object sender, EventArgs e)
    {
        ExportFeed.RefreshModuleSetting(ModuleName, "FileName", FileNameTextBox.Text + "." + GetFileExtention(ModuleName));
        ExportFeed.RefreshModuleSetting(ModuleName, "SalesNotes", SalesNotesTextBox.Text);
        ExportFeed.RefreshModuleSetting(ModuleName, "Currency", CurrencyListBox.SelectedValue);
        ExportFeed.RefreshModuleSetting(ModuleName, "DescriptionSelection", DescriptionSelectListBox.SelectedValue);

        if (ModuleName == "YandexMarket")
        {
            ExportFeed.RefreshModuleSetting(ModuleName, "ShopName", txtShopName.Text);
            ExportFeed.RefreshModuleSetting(ModuleName, "CompanyName", txtCompanyName.Text);
        }

        if (ModuleName == "GoogleBase")
        {
            ExportFeed.RefreshModuleSetting(ModuleName, "DatafeedTitle", DatafeedTitleTextBox.Text);
            ExportFeed.RefreshModuleSetting(ModuleName, "DatafeedDescription", DatafeedDescriptionTextBox.Text);
        }
        saveSuccess.Visible = true;
    }
コード例 #5
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);

            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;
        }
    }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        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);
        }