Beispiel #1
0
    protected void uxCustomerImportButton_Click(object sender, EventArgs e)
    {
        uxImportCustomerMessagePanel.Controls.Clear();
        string localFilePath = Server.MapPath("~/" + uxCustomerCsvFileNameText.Text.Trim());

        if (!File.Exists(localFilePath))
        {
            Label label = new Label();
            label.ForeColor = Color.Red;
            label.Text      = "File not found.";
            uxImportCustomerMessagePanel.Controls.Add(label);
            return;
        }

        CustomerImporter     importer = new CustomerImporter();
        CustomerImportStatus status   = new CustomerImportStatus();
        TimeSpan             timeDiff;

        switch (uxCustomerImportModeRadioList.SelectedValue)
        {
        case "Overwrite":
            status = importer.ImportCustomerOverWrite(
                "~/" + uxCustomerCsvFileNameText.Text.Trim(), out timeDiff);
            UpdateImportMessage(status, uxImportCustomerMessagePanel, true);
            UpdateTimeMessage(timeDiff, uxImportCustomerMessagePanel);
            break;

        default: break;
        }

        AdminUtilities.ClearAllCache();
    }
    protected void uxCategoryImportButton_Click(object sender, EventArgs e)
    {
        uxImportCategoryMessagePanel.Controls.Clear();
        string localFilePath = Server.MapPath("~/" + uxCategoryCsvFileNameText.Text.Trim());

        if (!File.Exists(localFilePath))
        {
            Label label = new Label();
            label.ForeColor = Color.Red;
            label.Text      = "File not found.";
            uxImportCategoryMessagePanel.Controls.Add(label);
            return;
        }

        Culture culture = DataAccessContext.CultureRepository.GetOne(uxLanguageDrop.SelectedValue);
        CategoryImportHelper       importer = new CategoryImportHelper(culture, "Category");
        CategoryImportHelperStatus status   = new CategoryImportHelperStatus("Category");
        TimeSpan timeDiff;

        switch (uxCategoryImportModeRadioList.SelectedValue)
        {
        case "Overwrite":
            status = importer.ImportCategoryOverWrite(
                "~/" + uxCategoryCsvFileNameText.Text.Trim(),
                CurrentStoreID,
                out timeDiff);
            UpdateImportMessage(status, uxImportCategoryMessagePanel, true);
            UpdateTimeMessage(timeDiff, uxImportCategoryMessagePanel);
            break;

        default: break;
        }

        AdminUtilities.ClearAllCache();
    }
Beispiel #3
0
    protected void uxUpdateConfigOnlyButton_Click(object sender, EventArgs e)
    {
        WidgetDirector widgetDirector = new WidgetDirector();

        SystemConfig.UpdateNewConfigValue(widgetDirector.WidgetConfigurationCollection);
        DatabaseConverter convert = new DatabaseConverter();

        convert.UpdateStoreConfigurations();
        AdminUtilities.ClearAllCache();
        uxMessageLabel.ForeColor = System.Drawing.Color.Green;
        uxMessageLabel.Text      = "<strong>Update Config Completed</storng>";
    }
Beispiel #4
0
    protected void uxExecuteButton_Click(object sender, EventArgs e)
    {
        string pathFile = uxFileNameText.Text;

        Culture culture = DataAccessContext.CultureRepository.GetOne(uxLanguageDrop.SelectedValue);
        // ProductImporter importer = new ProductImporter(culture, new FileManager());
        ProductImportStatus status;
        TimeSpan            timeDiff;
        string        storeID  = CurrentStoreID;
        LargeImporter importer = new LargeImporter(culture, new FileManager());

        switch (uxModeRadioList.SelectedValue)
        {
        case "Purge":
            DataAccessContextDeluxe.PromotionProductRepository.DeleteAll();
            DataAccessContextDeluxe.ProductSubscriptionRepository.DeleteAll();
            status = importer.ImportProductPurgeAll(
                "~/" + uxFileNameText.Text.Trim(),
                uxImageProcessCheck.Checked,
                uxSkipImageProcessingCheck.Checked,
                out timeDiff,
                storeID);

            UpdateMessage(status);
            UpdateTimeMessage(timeDiff);

            break;

        case "Overwrite":
            status = importer.ImportProductOverwrite(
                "~/" + uxFileNameText.Text.Trim(),
                uxImageProcessCheck.Checked,
                uxSkipImageProcessingCheck.Checked,
                out timeDiff, storeID,
                GetProductIDAndSku());

            UpdateMessage(status);
            UpdateTimeMessage(timeDiff);

            break;
        }

        AdminUtilities.ClearAllCache();
    }
    protected void uxImportButton_Click(object sender, EventArgs e)
    {
        uxMessagePanel.Controls.Clear();
        string localFilePath = Server.MapPath("~/" + uxFileNameText.Text.Trim());

        if (!File.Exists(localFilePath))
        {
            Label label = new Label();
            label.ForeColor = Color.Red;
            label.Text      = "File not found.";
            uxMessagePanel.Controls.Add(label);
            return;
        }

        Culture             culture  = DataAccessContext.CultureRepository.GetOne(uxLanguageDrop.SelectedValue);
        ProductImporter     importer = new ProductImporter(culture, new FileManager());
        ProductImportStatus status;
        TimeSpan            timeDiff;
        string storeID = CurrentStoreID;

        switch (uxModeRadioList.SelectedValue)
        {
        case "Purge":
            DataAccessContextDeluxe.PromotionProductRepository.DeleteAll();
            DataAccessContextDeluxe.ProductSubscriptionRepository.DeleteAll();
            status = importer.ImportProductPurgeAll(
                "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessCheck.Checked, out timeDiff, storeID);
            UpdateMessage(status);
            UpdateTimeMessage(timeDiff, uxMessagePanel);
            break;

        case "Overwrite":
            status = importer.ImportProductOverwrite(
                "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessCheck.Checked, out timeDiff, storeID);
            UpdateMessage(status);
            UpdateTimeMessage(timeDiff, uxMessagePanel);
            break;
        }

        AdminUtilities.ClearAllCache();
    }
Beispiel #6
0
 protected void uxDelButton_Click(object sender, EventArgs e)
 {
     DataAccessContext.ProductRepository.DeleteAll();
     AdminUtilities.ClearAllCache();
     uxMessageLabel.Text = "Delete all completed";
 }
 protected void uxClearCacheButton_Click(object sender, EventArgs e)
 {
     AdminUtilities.ClearAllCache();
     uxMessage.DisplayMessage("Cache data is cleared successfully");
 }