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
@@ -431,7 +431,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 = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), myConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID);
}
@@ -443,7 +443,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 = Folder.Update(cn, ref _FolderID, _ParentID, myConnection.DBID, _Name, _Title, _ShortName, _FormatID, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -458,7 +458,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();
Folder.Remove(cn, _FolderID);
}