// *** File Management *** private void OnCsvOneLoad(object sender, EventArgs e) { this.csvTable1 = LoadCsvTable(); if (this.csvTable1 != null) { this.csvTable1.MaxAdminLevels = 2; this.toolStripFileLabel1.Text = "CSV One: " + Utilities.TruncateString(this.csvTable1.FilePath, 70); this.admin1 = new AdminTree(this.csvTable1, country); if (this.appOptions.IncludeFacilities) { this.admin1.AddFacilityNodes(this.csvTable1); } this.admin1.BuildTreeView(this.treeView1); } }
private void OnLoadCsvTwo(object sender, EventArgs e) { this.csvTable2 = LoadCsvTable(); if (this.csvTable2 != null) { this.csvTable2.MaxAdminLevels = 2; this.displayManager.DisplayTextFile(this.csvTable2.CsvFile()); LoadHeaderComboBox(csvTable2.Headers); this.admin2 = new AdminTree(this.csvTable2, country); if (this.appOptions.IncludeFacilities) { this.admin2.AddFacilityNodes(this.csvTable2); } this.admin2.BuildTreeView(this.treeView2); this.toolStripFileLabel2.Text = "CSV Two: " + Utilities.TruncateString(this.csvTable2.FilePath, 70); } }
public MatchResultSet MatchAllFacilities(CsvTable csv1, CsvTable csv2) { List <string> results = new List <string>(); if (csv1 == null || csv2 == null) { return(null); } AdminTree admin1 = new AdminTree(csv1, applicationOptions.Country); admin1.AddFacilityNodes(csv1); AdminTree admin2 = new AdminTree(csv2, applicationOptions.Country); admin2.AddFacilityNodes(csv2); AdminIterator adminNodes = new AdminIterator(admin1); MatchResultSet resultsToReturn = new MatchResultSet(); foreach (AdminTreeNode node in adminNodes) { Console.WriteLine(node.Name); if (node.IsFacility) { string path = node.Path; NameSet facilitiesToMatch = admin2.GetFacilities(path); MatchResult result = facilitiesToMatch.FindBestMatch(node.Name); if (GoodMatch(node.Name, result)) { string resultString = path + "\\" + result.ToString(); results.Add(resultString); result.FullPath = path; resultsToReturn.Add(result); } } } displayManager.DisplayTextFile(results, 10000); return(resultsToReturn); }
public AdminIterator(AdminTree at) { adminTree = at; nodeStack = null; }