Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -706,6 +706,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyUser?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -826,6 +827,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyUser?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -874,6 +876,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = Membership.Add(cn, ref _UGID, _MyUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user