Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -318,6 +318,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!this.IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
_LastChanged = Content.Add(cn, ref _ContentID, _Number, _Text, _Type, myFormat, _Config, _DTS, _UserID);
|
||||
}
|
||||
|
||||
@@ -329,6 +330,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!this.IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
_LastChanged = Content.Update(cn, ref _ContentID, _Number, _Text, _Type, myFormat != null ? (int?)myFormat.FormatID : (int?)null, _Config, _DTS, _UserID, ref _LastChanged);
|
||||
}
|
||||
|
||||
@@ -343,6 +345,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (this.IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
Content.Remove(cn, _ContentID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user