Make Sure Connection is open when working with Local Context

This commit is contained in:
mschill committed 2026-09-15 08:06:53 -04:00
1 parent ac773b8ada
commit 5d4e5d9a1f
82 files changed
+249

No files matched your search

@@ -326,6 +326,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Part.Add(cn, myContent, _FromType, _MyItem, _DTS, _UserID);
}
@@ -337,6 +338,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Part.Update(cn, myContent.ContentID, _FromType, _ItemID, _DTS, _UserID, ref _LastChanged);
}
@@ -350,6 +352,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Part.Remove(cn, myContent.ContentID, _FromType);
}