Make Sure Connection is open when working with Local Context

This commit is contained in:
2026-09-15 08:06:53 -04:00
parent ac773b8ada
commit 5d4e5d9a1f
82 changed files with 249 additions and 0 deletions
@@ -645,6 +645,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -765,6 +766,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -813,6 +815,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Annotation.Add(cn, ref _AnnotationID, _MyItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID);
else
@@ -588,6 +588,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -699,6 +700,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -742,6 +744,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
AnnotationAudit.Add(cn, ref _AuditID, _AnnotationID, _ItemID, _TypeID, _RtfText, _SearchText, _Config, _DTS, _UserID, _DeleteStatus);
else
@@ -724,6 +724,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -837,6 +838,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -883,6 +885,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = AnnotationType.Add(cn, ref _TypeID, _Name, _Config, _DTS, _UserID);
else
@@ -397,6 +397,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Annotation.Add(cn, ref _AnnotationID, _MyItem, myAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID);
}
@@ -408,6 +409,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Annotation.Update(cn, ref _AnnotationID, _ItemID, myAnnotationType.TypeID, _RtfText, _SearchText, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -422,6 +424,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Annotation.Remove(cn, _AnnotationID);
}
@@ -703,6 +703,7 @@ namespace VEPROMS.CSLA.Library
_MyRole?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -824,6 +825,7 @@ namespace VEPROMS.CSLA.Library
_MyRole?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -872,6 +874,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID);
else
@@ -683,6 +683,7 @@ namespace VEPROMS.CSLA.Library
_MyROFst?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -799,6 +800,7 @@ namespace VEPROMS.CSLA.Library
_MyROFst?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -845,6 +847,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Association.Add(cn, ref _AssociationID, _MyDocVersion, _MyROFst, _Config, _DTS, _UserID);
else
@@ -602,6 +602,7 @@ namespace VEPROMS.CSLA.Library
_MyStage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -718,6 +719,7 @@ namespace VEPROMS.CSLA.Library
_MyStage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -764,6 +766,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Check.Add(cn, ref _CheckID, _MyRevision, _MyStage, _ConsistencyChecks, _DTS, _UserID);
else
@@ -738,6 +738,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -857,6 +858,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -906,6 +908,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Connection.Add(cn, ref _DBID, _Name, _Title, _ConnectionString, _ServerType, _Config, _DTS, _UsrID);
else
@@ -431,6 +431,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), myConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID);
}
@@ -442,6 +443,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Update(cn, ref _FolderID, _ParentID, myConnection.DBID, _Name, _Title, _ShortName, _FormatID, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -456,6 +458,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Folder.Remove(cn, _FolderID);
}
@@ -1071,6 +1071,7 @@ namespace VEPROMS.CSLA.Library
_MyFormat?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -1199,6 +1200,7 @@ namespace VEPROMS.CSLA.Library
_MyFormat?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -1257,6 +1259,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Content.Add(cn, ref _ContentID, _Number, _Text, _Type, _MyFormat, _Config, _DTS, _UserID);
else
@@ -602,6 +602,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -713,6 +714,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -756,6 +758,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
ContentAudit.Add(cn, ref _AuditID, _ContentID, _Number, _Text, _Type, _FormatID, _Config, _DTS, _UserID, _DeleteStatus);
else
@@ -377,6 +377,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID);
}
@@ -388,6 +389,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Detail.Update(cn, ref _DetailID, myContent.ContentID, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -402,6 +404,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Detail.Remove(cn, _DetailID);
}
@@ -256,6 +256,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID);
}
@@ -267,6 +268,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Item.Update(cn, ref _ItemID, _PreviousID, myContent.ContentID, _DTS, _UserID, ref _LastChanged);
}
@@ -281,6 +283,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Item.Remove(cn, _ItemID);
}
@@ -326,6 +326,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);
}
@@ -337,6 +338,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Part.Update(cn, myContent.ContentID, _FromType, _ItemID, _DTS, _UserID, ref _LastChanged);
}
@@ -350,6 +352,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Part.Remove(cn, myContent.ContentID, _FromType);
}
@@ -404,6 +404,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = RoUsage.Add(cn, ref _ROUsageID, myContent, _ROID, _Config, _DTS, _UserID, _MyRODb);
}
@@ -415,6 +416,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = RoUsage.Update(cn, ref _ROUsageID, myContent.ContentID, _ROID, _Config, _DTS, _UserID, ref _LastChanged, _RODbID);
}
@@ -429,6 +431,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
RoUsage.Remove(cn, _ROUsageID);
}
@@ -480,6 +480,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
string pattern = string.Format(@"<START\]\\v0([^#]*)\\v #Link:Transition(|Range):[0-9]* <CTID={0}>( [0-9]*){{1,2}}\[END>", _TransitionID);
Match m = Regex.Match(myContent.Text, pattern);
if (m.Groups.Count > 1 && m.Groups[1].Value.ToUpper().Contains("(PAGE ~)")) // B2020-089, check for upper case Page ~ in case step was upper cased
@@ -497,6 +498,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Transition.Update(cn, ref _TransitionID, myContent.ContentID, _ToID, _RangeID, _IsRange, _TranType, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -511,6 +513,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Transition.Remove(cn, _TransitionID);
}
@@ -645,6 +645,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -763,6 +764,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -810,6 +812,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = DROUsage.Add(cn, ref _DROUsageID, _MyDocument, _ROID, _Config, _DTS, _UserID, _MyRODb);
else
@@ -614,6 +614,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;
@@ -731,6 +732,7 @@ namespace VEPROMS.CSLA.Library
_MyContent?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -778,6 +780,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Detail.Add(cn, ref _DetailID, _MyContent, _ItemType, _Text, _Config, _DTS, _UserID);
else
@@ -768,6 +768,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -894,6 +895,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -945,6 +947,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID);
else
@@ -355,6 +355,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Association.Add(cn, ref _AssociationID, myDocVersion, _MyROFst, _Config, _DTS, _UserID);
}
@@ -366,6 +367,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Association.Update(cn, ref _AssociationID, myDocVersion.VersionID, _ROFstID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -380,6 +382,7 @@ namespace VEPROMS.CSLA.Library
if (this.IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Association.Remove(cn, _AssociationID);
}
@@ -775,6 +775,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -896,6 +897,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -947,6 +949,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Document.Add(cn, ref _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID, _FileExtension);
else
@@ -629,6 +629,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -742,6 +743,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -786,6 +788,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
DocumentAudit.Add(cn, ref _AuditID, _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID, _FileExtension, _DocPdf, _DeleteStatus);
else
@@ -412,6 +412,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DROUsage.Add(cn, ref _DROUsageID, myDocument, _ROID, _Config, _DTS, _UserID, _MyRODb);
}
@@ -423,6 +424,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DROUsage.Update(cn, ref _DROUsageID, myDocument.DocID, _ROID, _Config, _DTS, _UserID, ref _LastChanged, _RODbID);
}
@@ -437,6 +439,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
DROUsage.Remove(cn, _DROUsageID);
}
@@ -300,6 +300,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Entry.Add(cn, _MyEntry.MyContent, myDocument, _DTS, _UserID);
}
@@ -311,6 +312,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Entry.Update(cn, _ContentID, myDocument.DocID, _DTS, _UserID, ref _LastChanged);
}
@@ -325,6 +327,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Entry.Remove(cn, _ContentID);
}
@@ -304,6 +304,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Pdf.Add(cn, myDocument, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID);
}
@@ -315,6 +316,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Pdf.Update(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID, ref _LastChanged);
}
@@ -328,6 +330,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Pdf.Remove(cn, myDocument.DocID, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth);
}
@@ -559,6 +559,7 @@ namespace VEPROMS.CSLA.Library
_MyDocument?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -660,6 +661,7 @@ namespace VEPROMS.CSLA.Library
_MyDocument?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -704,6 +706,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Entry.Add(cn, content, MyDocument, _DTS, _UserID);
else
@@ -504,6 +504,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -607,6 +608,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -646,6 +648,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
EntryAudit.Add(cn, ref _AuditID, _ContentID, _DocID, _DTS, _UserID, _DeleteStatus);
else
@@ -709,6 +709,7 @@ namespace VEPROMS.CSLA.Library
_MyROImage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -825,6 +826,7 @@ namespace VEPROMS.CSLA.Library
_MyROImage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -871,6 +873,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Figure.Add(cn, ref _FigureID, _MyROFst, _MyROImage, _Config, _DTS, _UserID);
else
@@ -1018,6 +1018,7 @@ namespace VEPROMS.CSLA.Library
_MyFormat?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -1149,6 +1150,7 @@ namespace VEPROMS.CSLA.Library
_MyFormat?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -1205,6 +1207,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Folder.Add(cn, ref _FolderID, _MyParent, _MyConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID);
else
@@ -1226,6 +1229,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Folder.Remove(cn, _FolderID);
}
@@ -507,6 +507,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, _MyRole, myFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID);
}
@@ -518,6 +519,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Update(cn, ref _AID, _GID, _RID, myFolder.FolderID, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged);
}
@@ -532,6 +534,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Assignment.Remove(cn, _AID);
}
@@ -384,6 +384,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Add(cn, ref _VersionID, myFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID);
}
@@ -395,6 +396,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Update(cn, ref _VersionID, myFolder.FolderID, _VersionType, _Name, _Title, _ItemID, _FormatID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -409,6 +411,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
DocVersion.Remove(cn, _VersionID);
}
@@ -983,6 +983,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -1107,6 +1108,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -1160,6 +1162,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Format.Add(cn, ref _FormatID, _MyParent, _Name, _Description, _Data, _Config, _GenMac, _DTS, _UserID);
else
@@ -1182,6 +1185,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Format.Remove(cn, _FormatID);
}
@@ -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);
}
@@ -522,6 +522,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, myFormat, _Config, _DTS, _UserID);
}
@@ -533,6 +534,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Update(cn, ref _VersionID, _FolderID, _VersionType, _Name, _Title, _ItemID, myFormat != null ? (int?)myFormat.FormatID : (int?)null, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -547,6 +549,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
DocVersion.Remove(cn, _VersionID);
}
@@ -521,6 +521,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), _MyConnection, _Name, _Title, _ShortName, myFormat, _ManualOrder, _Config, _DTS, _UsrID);
}
@@ -532,6 +533,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Folder.Update(cn, ref _FolderID, _ParentID, _DBID, _Name, _Title, _ShortName, myFormat != null ? (int?)myFormat.FormatID : (int?)null, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -546,6 +548,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Folder.Remove(cn, _FolderID);
}
@@ -548,6 +548,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -650,6 +651,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -695,6 +697,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Grid.Add(cn, content, _Data, _Config, _DTS, _UserID);
else
@@ -591,6 +591,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -698,6 +699,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -739,6 +741,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
GridAudit.Add(cn, ref _AuditID, _ContentID, _Data, _Config, _DTS, _UserID, _DeleteStatus, _ContentAuditID);
else
@@ -757,6 +757,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -873,6 +874,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -921,6 +923,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Group.Add(cn, ref _GID, _GroupName, _GroupType, _Config, _DTS, _UsrID);
else
@@ -558,6 +558,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Add(cn, ref _AID, myGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID);
}
@@ -569,6 +570,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Update(cn, ref _AID, myGroup.GID, _RID, _FolderID, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged);
}
@@ -583,6 +585,7 @@ namespace VEPROMS.CSLA.Library
if (this.IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Assignment.Remove(cn, _AID);
}
@@ -531,6 +531,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Add(cn, ref _UGID, _MyUser, myGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
}
@@ -542,6 +543,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Update(cn, ref _UGID, _UID, myGroup.GID, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -556,6 +558,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Membership.Remove(cn, _UGID);
}
@@ -595,6 +595,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -701,6 +702,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -748,6 +750,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Image.Add(cn, content, _ImageType, _FileName, _Data, _Config, _DTS, _UserID);
else
@@ -583,6 +583,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -692,6 +693,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -734,6 +736,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
ImageAudit.Add(cn, ref _AuditID, _ContentID, _ImageType, _FileName, _Data, _Config, _DTS, _UserID, _DeleteStatus);
else
@@ -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);
}
@@ -394,6 +394,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Annotation.Add(cn, ref _AnnotationID, myItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID);
}
@@ -405,6 +406,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Annotation.Update(cn, ref _AnnotationID, myItem.ItemID, _TypeID, _RtfText, _SearchText, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -419,6 +421,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Annotation.Remove(cn, _AnnotationID);
}
@@ -531,6 +531,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -636,6 +637,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -676,6 +678,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
ItemAudit.Add(cn, ref _AuditID, _ItemID, _PreviousID, _ContentID, _DTS, _UserID, _DeleteStatus);
else
@@ -513,6 +513,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, myItem, _MyFormat, _Config, _DTS, _UserID);
}
@@ -524,6 +525,7 @@ namespace VEPROMS.CSLA.Library
if (!this.IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DocVersion.Update(cn, ref _VersionID, _FolderID, _VersionType, _Name, _Title, myItem != null ? (int?)myItem.ItemID : (int?)null, _FormatID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -538,6 +540,7 @@ namespace VEPROMS.CSLA.Library
if (this.IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
DocVersion.Remove(cn, _VersionID);
}
@@ -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);
}
@@ -467,6 +467,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, myItemRangeID, _IsRange, _TranType, _Config, _DTS, _UserID);
}
@@ -478,6 +479,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Transition.Update(cn, ref _TransitionID, _FromID, _ToID, myItemRangeID.ItemID, _IsRange, _TranType, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -492,6 +494,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Transition.Remove(cn, _TransitionID);
}
@@ -461,6 +461,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, myItemToID, _MyItemRangeID, _IsRange, _TranType, _Config, _DTS, _UserID);
}
@@ -472,6 +473,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Transition.Update(cn, ref _TransitionID, _FromID, myItemToID.ItemID, _RangeID, _IsRange, _TranType, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -486,6 +488,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Transition.Remove(cn, _TransitionID);
}
@@ -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
@@ -480,6 +480,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -592,6 +593,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -637,6 +639,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Owner.Add(cn, ref _OwnerID, _SessionID, _OwnerType, _OwnerItemID, _DTSStart);
else
@@ -567,6 +567,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -671,6 +672,7 @@ namespace VEPROMS.CSLA.Library
_MyItem?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -716,6 +718,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Part.Add(cn, _MyContent, _FromType, _MyItem, _DTS, _UserID);
else
@@ -524,6 +524,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -629,6 +630,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -669,6 +671,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
PartAudit.Add(cn, ref _AuditID, _ContentID, _FromType, _ItemID, _DTS, _UserID, _DeleteStatus);
else
@@ -659,6 +659,7 @@ namespace VEPROMS.CSLA.Library
_MyDocument?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -772,6 +773,7 @@ namespace VEPROMS.CSLA.Library
_MyDocument?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -822,6 +824,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Pdf.Add(cn, _MyDocument, _DebugStatus, _TopRow, _PageLength, _LeftMargin, _PageWidth, _PageCount, _DocPdf, _DTS, _UserID);
else
@@ -755,6 +755,7 @@ namespace VEPROMS.CSLA.Library
_MyRole?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -880,6 +881,7 @@ namespace VEPROMS.CSLA.Library
_MyRole?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -931,6 +933,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Permission.Add(cn, ref _PID, _MyRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
else
@@ -901,6 +901,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -1021,6 +1022,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -1072,6 +1074,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = RODb.Add(cn, ref _RODbID, _ROName, _FolderPath, _DBConnectionString, _Config, _DTS, _UserID);
else
@@ -411,6 +411,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DROUsage.Add(cn, ref _DROUsageID, _MyDocument, _ROID, _Config, _DTS, _UserID, myRODb);
}
@@ -422,6 +423,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = DROUsage.Update(cn, ref _DROUsageID, _DocID, _ROID, _Config, _DTS, _UserID, ref _LastChanged, myRODb.RODbID);
}
@@ -436,6 +438,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
DROUsage.Remove(cn, _DROUsageID);
}
@@ -267,6 +267,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = ROFst.Add(cn, ref _ROFstID, myRODb, _ROLookup, _Config, _DTS, _UserID);
}
@@ -278,6 +279,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = ROFst.Update(cn, ref _ROFstID, myRODb.RODbID, _ROLookup, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -292,6 +294,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
ROFst.Remove(cn, _ROFstID);
}
@@ -293,6 +293,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = ROImage.Add(cn, ref _ImageID, myRODb, _FileName, _Content, _Config, _DTS, _UserID);
}
@@ -304,6 +305,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = ROImage.Update(cn, ref _ImageID, myRODb.RODbID, _FileName, _Content, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -318,6 +320,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
ROImage.Remove(cn, _ImageID);
}
@@ -411,6 +411,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, myRODb);
}
@@ -422,6 +423,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = RoUsage.Update(cn, ref _ROUsageID, _ContentID, _ROID, _Config, _DTS, _UserID, ref _LastChanged, myRODb.RODbID);
}
@@ -436,6 +438,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
RoUsage.Remove(cn, _ROUsageID);
}
@@ -842,6 +842,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -974,6 +975,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -1026,6 +1028,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = ROFst.Add(cn, ref _ROFstID, _MyRODb, _ROLookup, _Config, _DTS, _UserID);
else
@@ -401,6 +401,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Association.Add(cn, ref _AssociationID, _MyDocVersion, myROFst, _Config, _DTS, _UserID);
}
@@ -412,6 +413,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Association.Update(cn, ref _AssociationID, _VersionID, myROFst.ROFstID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -426,6 +428,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Association.Remove(cn, _AssociationID);
}
@@ -368,6 +368,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Figure.Add(cn, ref _FigureID, myROFst, _MyROImage, _Config, _DTS, _UserID);
}
@@ -379,6 +380,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Figure.Update(cn, ref _FigureID, myROFst.ROFstID, _ImageID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -393,6 +395,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Figure.Remove(cn, _FigureID);
}
@@ -832,6 +832,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -950,6 +951,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -998,6 +1000,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = ROImage.Add(cn, ref _ImageID, _MyRODb, _FileName, _Content, _Config, _DTS, _UserID);
else
@@ -358,6 +358,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Figure.Add(cn, ref _FigureID, _MyROFst, myROImage, _Config, _DTS, _UserID);
}
@@ -369,6 +370,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Figure.Update(cn, ref _FigureID, _ROFstID, myROImage.ImageID, _Config, _DTS, _UserID, ref _LastChanged);
}
@@ -383,6 +385,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Figure.Remove(cn, _FigureID);
}
@@ -734,6 +734,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -856,6 +857,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -907,6 +909,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Revision.Add(cn, ref _RevisionID, _ItemID, _TypeID, _RevisionNumber, _RevisionDate, _Notes, _Config, _DTS, _UserID);
else
@@ -358,6 +358,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Check.Add(cn, ref _CheckID, myRevision, _MyStage, _ConsistencyChecks, _DTS, _UserID);
}
@@ -369,6 +370,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Check.Update(cn, ref _CheckID, myRevision.RevisionID, _StageID, _ConsistencyChecks, _DTS, _UserID, ref _LastChanged);
}
@@ -383,6 +385,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Check.Remove(cn, _CheckID);
}
@@ -391,6 +391,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Version.Add(cn, ref _VersionID, myRevision, _MyStage, _PDF, _SummaryPDF, _ApprovedXML, _DTS, _UserID);
}
@@ -402,6 +403,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Version.Update(cn, ref _VersionID, myRevision.RevisionID, _StageID, _PDF, _SummaryPDF, _ApprovedXML, _DTS, _UserID, ref _LastChanged);
}
@@ -416,6 +418,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Version.Remove(cn, _VersionID);
}
@@ -635,6 +635,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -753,6 +754,7 @@ namespace VEPROMS.CSLA.Library
_MyRODb?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -800,6 +802,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, _MyRODb);
else
@@ -732,6 +732,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -846,6 +847,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -893,6 +895,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Role.Add(cn, ref _RID, _Name, _Title, _DTS, _UsrID);
else
@@ -568,6 +568,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, myRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID);
}
@@ -579,6 +580,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Assignment.Update(cn, ref _AID, _GID, myRole.RID, _FolderID, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged);
}
@@ -593,6 +595,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Assignment.Remove(cn, _AID);
}
@@ -430,6 +430,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Permission.Add(cn, ref _PID, myRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
}
@@ -441,6 +442,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Permission.Update(cn, ref _PID, myRole.RID, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -455,6 +457,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Permission.Remove(cn, _PID);
}
@@ -558,6 +558,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -674,6 +675,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -721,6 +723,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Session.Add(cn, ref _SessionID, _UserID, _DTSDtart, _DTSEnd, _DTSActivity, _MachineName, _ProcessID);
else
@@ -665,6 +665,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -781,6 +782,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -829,6 +831,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Stage.Add(cn, ref _StageID, _Name, _Description, _IsApproved, _DTS, _UserID);
else
@@ -388,6 +388,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Check.Add(cn, ref _CheckID, _MyRevision, myStage, _ConsistencyChecks, _DTS, _UserID);
}
@@ -399,6 +400,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Check.Update(cn, ref _CheckID, _RevisionID, myStage.StageID, _ConsistencyChecks, _DTS, _UserID, ref _LastChanged);
}
@@ -413,6 +415,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Check.Remove(cn, _CheckID);
}
@@ -421,6 +421,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Version.Add(cn, ref _VersionID, _MyRevision, myStage, _PDF, _SummaryPDF, _ApprovedXML, _DTS, _UserID);
}
@@ -432,6 +433,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Version.Update(cn, ref _VersionID, _RevisionID, myStage.StageID, _PDF, _SummaryPDF, _ApprovedXML, _DTS, _UserID, ref _LastChanged);
}
@@ -446,6 +448,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Version.Remove(cn, _VersionID);
}
@@ -744,6 +744,7 @@ namespace VEPROMS.CSLA.Library
_MyItemToID?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -868,6 +869,7 @@ namespace VEPROMS.CSLA.Library
_MyItemToID?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -918,6 +920,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _IsRange, _TranType, _Config, _DTS, _UserID);
else
@@ -813,6 +813,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -944,6 +945,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -999,6 +1001,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = User.Add(cn, ref _UID, _UserID, _FirstName, _MiddleName, _LastName, _Suffix, _CourtesyTitle, _PhoneNumber, _CFGName, _UserLogin, _UserName, _Config, _DTS, _UsrID);
else
@@ -448,6 +448,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Add(cn, ref _UGID, myUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID);
}
@@ -459,6 +460,7 @@ namespace VEPROMS.CSLA.Library
if (!IsDirty) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
_LastChanged = Membership.Update(cn, ref _UGID, myUser.UID, _GID, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged);
}
@@ -473,6 +475,7 @@ namespace VEPROMS.CSLA.Library
if (IsNew) return;
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
Membership.Remove(cn, _UGID);
}
@@ -619,6 +619,7 @@ namespace VEPROMS.CSLA.Library
_MyStage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -739,6 +740,7 @@ namespace VEPROMS.CSLA.Library
_MyStage?.Update();
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -787,6 +789,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = Version.Add(cn, ref _VersionID, _MyRevision, _MyStage, _PDF, _SummaryPDF, _ApprovedXML, _DTS, _UserID);
else
@@ -448,6 +448,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -544,6 +545,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -586,6 +588,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = ZContent.Add(cn, content, _OldStepSequence);
else
@@ -445,6 +445,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
@@ -541,6 +542,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (base.IsDirty)
{
using (SqlCommand cm = cn.CreateCommand())
@@ -583,6 +585,7 @@ namespace VEPROMS.CSLA.Library
{
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
{
cn.Open();
if (IsNew)
_LastChanged = ZTransition.Add(cn, transition, _Oldto);
else