From ca50815d38f0a105ef581762cd1cdc61b2030c33 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 14 Jun 2013 13:35:07 +0000 Subject: [PATCH] added check for existence of DBF file before trying to process the procedure. Added message to error log stating that the DBF file was not found --- PROMS/DataLoader/Procedures.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PROMS/DataLoader/Procedures.cs b/PROMS/DataLoader/Procedures.cs index 28944587..dcea6621 100644 --- a/PROMS/DataLoader/Procedures.cs +++ b/PROMS/DataLoader/Procedures.cs @@ -470,10 +470,17 @@ namespace DataLoader } // check for duplicate SET file data - jsj 2/11/10 - private bool OKtoProcessDBF(DataRow dr) + private bool OKtoProcessDBF(DataRow dr, string pth) { string pfn = dr["Entry"].ToString(); string pn = dr["Number"].ToString(); + FileInfo fi = new FileInfo(pth + "\\" + pfn + ".dbf"); + if (!fi.Exists) + { + _MyLog.WarnFormat("Data file does not exist {0}", fi.FullName); + frmMain.AddError("Data file does not exist {0}", fi.FullName); + return false; + } if (!dicSetfileEntries.ContainsValue(pfn) && !dicSetfileEntries.ContainsKey(pn)) { dicSetfileEntries.Add(pn, pfn); @@ -501,7 +508,7 @@ namespace DataLoader { if (++i > frmMain.SkipProcedures) { - if (OKtoProcessDBF(dr)) // look for duplicate SET file info - jsj 2/11/10 + if (OKtoProcessDBF(dr, pth)) // look for duplicate SET file info - jsj 2/11/10 { List cacheContentInfo = ContentInfo.CacheList; List cacheItemInfo = ItemInfo.CacheList;