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
@@ -304,6 +304,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Pdf.Add(cn, myDocument, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID);
}
@@ -315,6 +316,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Pdf.Update(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID, ref _LastChanged);
}
@@ -328,6 +330,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Pdf.Remove(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth);
}