Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -377,6 +377,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
_LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID);
|
||||
}
|
||||
|
||||
@@ -388,6 +389,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
_LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged);
|
||||
}
|
||||
|
||||
@@ -402,6 +404,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
Detail.Remove(cn, _DetailID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user