/// <summary>
    /// Handles the Click event of the cmdAssignImportHistory control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void cmdAssignImportHistory_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        WebPortalPage portalPage = Page as WebPortalPage;

        if (portalPage != null)
        {
            IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
            importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
            importHistory.ProcessedCount = 0;
            importHistory.Save();
            importManager.ImportHistory = importHistory;
            portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
            portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
        }
    }
Example #2
0
    /// <summary>
    /// Starts the import process inside its own thread.
    /// </summary>
    public void StartImportProcess()
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        try
        {
            SetImportSourceValue();
            AddJob(importManager);
            AddCrossReferenceMananager(importManager);

            WebPortalPage portalPage = Page as WebPortalPage;
            if (portalPage != null)
            {
                IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
                importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
                importHistory.ProcessedCount = 0;
                importHistory.Save();
                lblHeader.Text               = GetLocalResourceObject("lblHeader_ProcessStarted.Caption").ToString();
                lblImportNumber.Visible      = true;
                lnkImportHistoryCaption.Text = String.Format(" {0}-{1}", importHistory.Alternatekeyprefix, importHistory.Alternatekeysuffix);
                lnkImportHistory.HRef        = String.Format("..\\..\\ImportHistory.aspx?entityid='{0}'&modeid=Detail", importHistory.Id);
                lblImportLeadsWizard.Visible = true;
                importManager.ImportHistory  = importHistory;
                portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
                portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
            }
        }
        catch (Exception ex)
        {
            log.Error("The call to StepProcessRequest.StartImportProcess() failed", ex);
        }
    }