Check if connection state is closed before opening

This commit is contained in:
2026-09-15 08:21:18 -04:00
parent 5d4e5d9a1f
commit 7c95b115e4
84 changed files with 291 additions and 291 deletions
@@ -358,7 +358,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
_LastChanged = Check.Add(cn, ref _CheckID, myRevision, _MyStage, _ConsistencyChecks, _DTS, _UserID);
}
@@ -370,7 +370,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
_LastChanged = Check.Update(cn, ref _CheckID, myRevision.RevisionID, _StageID, _ConsistencyChecks, _DTS, _UserID, ref _LastChanged);
}
@@ -385,7 +385,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
Check.Remove(cn, _CheckID);
}