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
@@ -531,6 +531,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Add(cn, ref _UGID, _MyUser, myGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
}
@@ -542,6 +543,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Update(cn, ref _UGID, _UID, myGroup.GID, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -556,6 +558,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Membership.Remove(cn, _UGID);
}