avoid Local Context
This commit is contained in:
@@ -316,7 +316,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
// if we're not dirty then don't update the database
|
||||
if (!this.IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
_LastChanged = Content.Add(cn, ref _ContentID, _Number, _Text, _Type, myFormat, _Config, _DTS, _UserID);
|
||||
@@ -328,7 +328,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
// if we're not dirty then don't update the database
|
||||
if (!this.IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
_LastChanged = Content.Update(cn, ref _ContentID, _Number, _Text, _Type, myFormat != null ? (int?)myFormat.FormatID : (int?)null, _Config, _DTS, _UserID, ref _LastChanged);
|
||||
@@ -343,7 +343,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!this.IsDirty) return;
|
||||
// if we're new then don't update the database
|
||||
if (this.IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
Content.Remove(cn, _ContentID);
|
||||
|
||||
Reference in New Issue
Block a user