Make Sure Connection is open when working with Local Context

This commit is contained in:
2026-09-15 08:06:53 -04:00
parent ac773b8ada
commit 5d4e5d9a1f
82 changed files with 249 additions and 0 deletions
@@ -521,6 +521,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), _MyConnection, _Name, _Title, _ShortName, myFormat, _ManualOrder, _Config, _DTS, _UsrID);
}
@@ -532,6 +533,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Update(cn, ref _FolderID, _ParentID, _DBID, _Name, _Title, _ShortName, myFormat != null ? (int?)myFormat.FormatID : (int?)null, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -546,6 +548,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Folder.Remove(cn, _FolderID);
}