Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -312,6 +312,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);
|
||||
}
|
||||
|
||||
@@ -323,6 +324,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
_LastChanged = Part.Update(cn, _ContentID, _FromType, myItem.ItemID, _DTS, _UserID, ref _LastChanged);
|
||||
}
|
||||
|
||||
@@ -337,6 +339,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
Part.Remove(cn, _ContentID, _FromType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user