Make Sure Connection is open when working with Local Context
This commit is contained in:
1 parent
ac773b8ada
commit
5d4e5d9a1f
82 files changed
+249
No files matched your search
@@ -898,6 +898,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyContent?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -1097,6 +1098,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyContent?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -1148,6 +1150,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = Item.Add(cn, ref _ItemID, _MyPrevious, _MyContent, _DTS, _UserID);
|
||||
else
|
||||
@@ -1172,6 +1175,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
Item.Remove(cn, _ItemID);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user