From 4531a04db1dd63c7e31cb9fb932072081f11e67d Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 5 Sep 2014 14:28:12 +0000 Subject: [PATCH] Added an error handler if getOwnersByVersionID does not exist in the database. --- .../Extension/MultiUserExt.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs index d81a8d84..5e6a2757 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs @@ -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(new GetByVersionIDCriteria(versionID)); - return tmp; + try + { + OwnerInfoList tmp = DataPortal.Fetch(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; }