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

This commit is contained in:
John Jenko 2013-06-14 13:35:07 +00:00
parent 1cc722cb67
commit ca50815d38

View File

@ -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<int> cacheContentInfo = ContentInfo.CacheList;
List<int> cacheItemInfo = ItemInfo.CacheList;