/// <summary> /// Gets the import manager. /// </summary>we /// <returns></returns> private ImportManager GetImportManager() { ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null) { if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value)) { lblFileRequired.Visible = false; lblRequiredMsg.Visible = false; importManager = null; } } if (importManager == null) { try { LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider(); txtCreateGroupName.Text = DateTime.Now.ToString(); ImportService importService = new ImportService(); importManager = importService.CreateImportManager(typeof(ILead)); importManager.DuplicateProvider = duplicateProvider; importManager.MergeProvider = new ImportLeadMergeProvider(); importManager.ActionManager = GetActionManager(); } catch (Exception e) { divError.Style.Add(HtmlTextWriterStyle.Display, "inline"); divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none"); lblError.Text = (e.Message); (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false; } } return(importManager); }
/// <summary> /// Gets the import manager. /// </summary>we /// <returns></returns> private ImportManager GetImportManager() { ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null) { if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value)) { lblFileRequired.Visible = false; lblRequiredMsg.Visible = false; importManager = null; } } if (importManager == null) { try { LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider(); txtCreateGroupName.Text = DateTime.Now.ToString(); ImportService importService = new ImportService(); importManager = importService.CreateImportManager(typeof(ILead)); importProcessId.Value = importManager.ToString(); importManager.DuplicateProvider = duplicateProvider; importManager.MergeProvider = new ImportLeadMergeProvider(); importManager.ActionManager = GetActionManager(); } catch (Exception ex) { string sSlxErrorId = null; var sMsg = ErrorHelper.GetClientErrorHtmlMessage(ex, ref sSlxErrorId); if (!string.IsNullOrEmpty(sSlxErrorId)) { log.Error( ErrorHelper.AppendSlxErrorId("The call to StepSelectFile.GetImportManager() failed", sSlxErrorId), ex); } divError.Style.Add(HtmlTextWriterStyle.Display, "inline"); divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none"); lblError.Text = sMsg; (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false; } } return(importManager); }
/// <summary> /// Gets the import manager. /// </summary>we /// <returns></returns> private ImportManager GetImportManager() { ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null) { if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value)) { lblFileRequired.Visible = false; lblRequiredMsg.Visible = false; importManager = null; } } if (importManager == null) { try { LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider(); txtCreateGroupName.Text = DateTime.Now.ToString(); ImportService importService = new ImportService(); importManager = importService.CreateImportManager(typeof(ILead)); importManager.DuplicateProvider = duplicateProvider; importManager.MergeProvider = new ImportLeadMergeProvider(); importManager.ActionManager = GetActionManager(); } catch (Exception e) { divError.Style.Add(HtmlTextWriterStyle.Display, "inline"); divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none"); lblError.Text = (e.Message); (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false; } } return importManager; }
/// <summary> /// Gets the import manager. /// </summary>we /// <returns></returns> private ImportManager GetImportManager() { ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null) { if (importProcessId.Value != importManager.ToString() && String.IsNullOrEmpty(txtImportFile.Value)) { lblFileRequired.Visible = false; lblRequiredMsg.Visible = false; importManager = null; } } if (importManager == null) { try { LeadDuplicateProvider duplicateProvider = new LeadDuplicateProvider(); txtCreateGroupName.Text = DateTime.Now.ToString(); ImportService importService = new ImportService(); importManager = importService.CreateImportManager(typeof(ILead)); importProcessId.Value = importManager.ToString(); importManager.DuplicateProvider = duplicateProvider; importManager.MergeProvider = new ImportLeadMergeProvider(); importManager.ActionManager = GetActionManager(); } catch (Exception ex) { string sSlxErrorId = null; var sMsg = ErrorHelper.GetClientErrorHtmlMessage(ex, ref sSlxErrorId); if (!string.IsNullOrEmpty(sSlxErrorId)) { log.Error( ErrorHelper.AppendSlxErrorId("The call to StepSelectFile.GetImportManager() failed", sSlxErrorId), ex); } divError.Style.Add(HtmlTextWriterStyle.Display, "inline"); divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none"); lblError.Text = sMsg; (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false; } } return importManager; }