Added code to replace the repetitive message box popups when an orphaned records are identified during the creation of a rofst with a single message box at the end of creating a rofst directing the user to a file that contains all of the orphaned records

This commit is contained in:
Rich
2015-02-05 03:47:04 +00:00
parent ef9e32b9d6
commit 3f945b04c5
2 changed files with 22 additions and 6 deletions

View File

@@ -1203,7 +1203,7 @@ namespace RODBInterface
// Note that this function is designed to be call for the
// root node (i.e. it gets all of group and RO data for a given
// database table)
public bool RODB_GetGroupAndSubgroups(VlnXmlElement node)
public bool RODB_GetGroupAndSubgroups(VlnXmlElement node, StringBuilder sb)
{
VlnStatusBar StatBar = new VlnStatusBar("Reading from the Database");
string tablename = node.GetAttribute("Table");
@@ -1236,8 +1236,15 @@ namespace RODBInterface
{
if (!dicGroups.Contains(ParID))
{
string strMBText = "The following record is being skipped. The parent for this RO is missing:\n\n RecID: " + RecID + "\n\n Table: " + tablename +"\n";
MessageBox.Show(strMBText, "Warning - Orphan RO Record");
if (sb.Length == 0)
{
sb.AppendLine("The following records were skipped.");
sb.AppendLine("The parent for these RO's was missing.");
sb.AppendLine();
}
string strMBText = "RecID: " + RecID + "\n\n Table: " + tablename +"\n";
sb.AppendLine(strMBText);
// MessageBox.Show(strMBText, "Warning - Orphan RO Record");
continue; // skip - no parent for this node
}
node = (VlnXmlElement)dicGroups[ParID];
@@ -1636,7 +1643,7 @@ namespace RODBInterface
{
DBE.Command(readstr);
DBE.Reader();
if (recid == null)
DBE.Read(); // skip the first parentID record of 00000000