예제 #1
0
    /// <summary>
    /// Handles the Click event of the cmdRunTest 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 cmdStartProcess_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }

        using (new SessionScopeWrapper(true))
        {
            ThreadPoolHelper.QueueTask(OnStartImportProcess);
        }
        //string sourceFileName = ((ImportCSVReader)importManager.SourceReader).SourceFileName;
        //if (sourceFileName != null)
        //{
        //string targetFileName = String.Format("{0}{1}-{2}.csv", ImportService.GetImportCompletedPath(),
        //                                      importManager.ImportHistory.AlternateKeyPrefix,
        //                                      importManager.ImportHistory.AlternateKeySuffix);
        //    ImportService.MoveToPath(sourceFileName, targetFileName);
        //}
        //RemoveJob(importManager);


        //importManager.Dispose();
        //object objShutDown = Page.Session["SessionShutDown"];
        //if (Convert.ToBoolean(objShutDown))
        //{
        //    if (CanShutDown())
        //    {
        //        ApplicationContext.Shutdown();
        //        Page.Session.Abandon();
        //    }
        //}
    }
예제 #2
0
 /// <summary>
 /// Handles the OnClick event of the StartProcess 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 StartImportTest_OnClick(object sender, EventArgs e)
 {
     using (new SessionScopeWrapper(true))
     {
         ThreadPoolHelper.QueueTask(StartTestImport);
     }
 }
    private void LoadView()
    {
        if (Job != null)
        {
            if (String.IsNullOrEmpty(Job.JobId))
            {
                using (new SessionScopeWrapper(true))
                {
                    IDeDupJobProcess job = GetJob();
                    if (job != null)
                    {
                        if (string.IsNullOrEmpty(job.JobId))
                        {
                            IDeDupService srv   = ApplicationContext.Current.Services.Get <IDeDupService>();
                            string        jobId = srv.SubmitJob(job);
                            Page.Session["DeDupJobId"] = jobId;
                        }
                        ThreadPoolHelper.QueueTask(StartJobProcess);
                    }
                }
            }
            try
            {
                lnkJobNumber.Text = String.Format("{0}", Job.ProgressInfo.JobNumber);
                switch (Job.ProcessState)
                {
                case DeDupJobProcessState.Aborted:
                    break;

                case DeDupJobProcessState.Completed:
                {
                    cmdAbort.Visible         = false;
                    lblHeader.Text           = String.Format(GetLocalResourceObject("CompletedMsg").ToString());
                    Page.Session["DeDupJob"] = null;
                    RadProgressContext jobProgress = RadProgressContext.Current;
                    jobProgress["ProcessCompleted"]  = "True";
                    jobProgress["OperationComplete"] = "True";
                }
                break;

                default:
                    cmdAbort.Visible = true;
                    lblHeader.Text   = String.Format(GetLocalResourceObject("lblPrimary_Progress.Caption").ToString());
                    lblHeader2.Text  = String.Format(GetLocalResourceObject("ProcessingMsg").ToString());
                    break;
                }
            }
            catch (Exception)
            {
            }
        }
        else
        {
            RadProgressContext jobProgress = RadProgressContext.Current;
            jobProgress["OperationComplete"] = "True";
            GoToDeDupManager();
        }
    }
예제 #4
0
    /// <summary>
    /// Handles the Click event of the cmdRunTest 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 cmdStartProcess_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }

        using (new SessionScopeWrapper(true))
        {
            ThreadPoolHelper.QueueTask(OnStartImportProcess);
        }
    }
    /// <summary>
    /// Handles the Click event of the cmdRunTest 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 cmdRunTest_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        AssignMatchFilters();
        using (new SessionScopeWrapper(true))
        {
            ThreadPoolHelper.QueueTask(StartTestImport);
        }
    }
 /// <summary>
 /// Handles the FinishButtonClick event of the wzdImportLeads control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.WizardNavigationEventArgs"/> instance containing the event data.</param>
 protected void wzdImportLeads_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     frmManageDuplicates.AssignMatchFilters();
     using (new SessionScopeWrapper(true))
     {
         ImportManager importManager = Page.Session["importManager"] as ImportManager;
         if (importManager != null)
         {
             importManager.ImportHistory.Save(); //Save the import history
             Page.Session["importManager"]   = importManager;
             Page.Session["importHistoryId"] = importManager.ImportHistory.Id;
             ThreadPoolHelper.QueueTask(frmProcessRequest.StartImportProcess);
         }
     }
 }