Added an error handler if getOwnersByVersionID does not exist in the database.

This commit is contained in:
Rich 2014-09-05 14:28:12 +00:00
parent 0b53f7ec7e
commit 4531a04db1

View File

@ -616,14 +616,23 @@ namespace VEPROMS.CSLA.Library
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
throw new DbCslaException("OwberInfoList.DataPortal_Fetch", ex);
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
}
this.RaiseListChangedEvents = true;
}
public static OwnerInfoList GetByVersionID(int versionID)
{
OwnerInfoList tmp = DataPortal.Fetch<OwnerInfoList>(new GetByVersionIDCriteria(versionID));
return tmp;
try
{
OwnerInfoList tmp = DataPortal.Fetch<OwnerInfoList>(new GetByVersionIDCriteria(versionID));
return tmp;
}
catch (Exception ex)
{
if (ex.Message.Contains("Could not find stored procedure"))
System.Windows.Forms.MessageBox.Show("Have your DBA run the latest version of PROMSFixes.SQL", "SQL code is not current", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
return null;
}
}
[Serializable()]
protected class GetByVersionIDCriteria
@ -660,7 +669,7 @@ namespace VEPROMS.CSLA.Library
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
throw new DbCslaException("OwberInfoList.DataPortal_Fetch", ex);
throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex);
}
this.RaiseListChangedEvents = true;
}