public ManageImportList() { this.Visible = false; InitializeComponent(); tbxMaxRow.Text = "10"; this.lcContents.AllowCustomizationMenu = false; this.PopulateImportListView(); //this.PopulateImportProfilingView(); this.SetImportProfilingControls(false); this.SetProfileDataControls(false); this.SetImportListViewContextMenu(); this.SetImportRecordViewContextMenu(); this.Visible = true; m_oPackageQueue = new SSISPackageQueue(); m_oRepository = new UserTextNotificationRepository(); this.RegisterEvents(); }
public void StartFuzzyMatch() { try { this.Invoke(new MethodInvoker(delegate { lblProgressTitle.Text = "Initializing ..."; })); this.Invoke(new MethodInvoker(delegate { pbFuzzyMatch.Position = 0; pbFuzzyMatch.Properties.Maximum = AccountIds.Count; })); DataImportUtility.ClearFuzzyLookupAccountMatches(ImportListId, AccountIds, true); SSISPackageMessage _PackageMsg = new SSISPackageMessage() { PackageID = Guid.NewGuid().ToString(), PackageType = "Account", Fuzzy_Match_Field = FuzzyMatchField, UserID = UserSession.CurrentUser.UserId, ImportFileID = FuzzyMatchArgs.import_file_id, Country = FuzzyMatchArgs.country, Similarity = FuzzyMatchArgs.similarity, Confidence = FuzzyMatchArgs.confidence, SimilarityOperator = FuzzyMatchArgs.similarity_operator, ConfidenceOperator = FuzzyMatchArgs.confidence_operator, Validated = FuzzyMatchArgs.validated }; m_Repository = new UserTextNotificationRepository(); m_PackageQueue = new SSISPackageQueue(); m_PackageQueue.AddMessage(_PackageMsg); string _NotificationTitle = string.Empty; if (_PackageMsg.Fuzzy_Match_Field == SSISPackageMessage.Fuzzy_Company_Name) _NotificationTitle = "AccountNotification_FuzzyCompanyName"; System.Threading.Thread.Sleep(500); this.Invoke(new MethodInvoker(delegate { lblProgressTitle.Text = "Processing fuzzy matches ..."; })); System.Threading.Thread.Sleep(500); /** * we will loop until the ssis package returns a message */ while (true) { try { this.Invoke(new MethodInvoker(delegate { lblProgressTitle.Text = "Processing fuzzy matches ... Getting queue message ..."; })); System.Threading.Thread.Sleep(3000); UserTextNotification[] userToasts = m_Repository.GetNotificationsForUser(UserSession.CurrentUser.UserId.ToString()); if (userToasts != null && userToasts.Length > 0) { var data = ( from UserTextNotification toast in userToasts where toast.Title == _NotificationTitle orderby toast.Timestamp descending select toast ).ToArray(); if (data != null) { this.Invoke(new MethodInvoker(delegate { lblProgressTitle.Text = "Processing fuzzy matches ... Getting processed items ..."; })); if (data[0].MessageText.ToLower().Equals("success")) { while (true) { System.Threading.Thread.Sleep(1000); BrightVision.Model.CTProcessedFuzzyLookupAccount _FuzzyMatching = DataImportUtility.CheckProcessedFuzzyMatchesCompanies(ImportListId); this.Invoke(new MethodInvoker(delegate { pbFuzzyMatch.Position = (int)_FuzzyMatching.items_processed; pbFuzzyMatch.Update(); })); if (_FuzzyMatching.items_processed == _FuzzyMatching.total_items) break; } this.Invoke(new MethodInvoker(delegate { lblProgressTitle.Text = "Done fuzzy matching ..."; })); m_Repository.DeleteNotification(data[0]); //m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection); //this.PopulateFuzzyLookupAccountList(); this.Invoke(new MethodInvoker(delegate { msgPopupRegular.Show(this, "Bright Manager", "Fuzzy matching successfully finished ..."); })); break; } } } } catch { } } } catch { } }
public SSISPackage() { packageRepository = new UserTextNotificationRepository(); packageQueue = new SSISPackageQueue(); }