From 5d4e5d9a1ffce500867c2fb611f65ce4e98d4e10 Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 15 Sep 2026 08:06:53 -0400 Subject: [PATCH] Make Sure Connection is open when working with Local Context --- PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/AnnotationAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs | 3 +++ .../Generated/AnnotationTypeAnnotation.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Association.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Check.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Content.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DROUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Document.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocumentAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocumentDROUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/DocumentPdf.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/EntryAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs | 4 ++++ PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Format.cs | 4 ++++ PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Grid.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/GridAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Group.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Image.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ImageAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Item.cs | 4 ++++ PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ItemAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs | 3 +++ .../VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Owner.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Part.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/PartAudit.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RODbDROUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Revision.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RevisionCheck.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RevisionVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Role.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Session.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Stage.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/StageCheck.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/StageVersion.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/User.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/Version.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs | 3 +++ PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs | 3 +++ 82 files changed, 249 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs index 00edd043..53b06365 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationAudit.cs index 13ade1ab..97540dfb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs index 4bc5429e..3c45fdc8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs index f946307c..a6392a50 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs index ea45b3c7..23bb37f3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs index ce9c4e76..37aac440 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Check.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Check.cs index dfc16883..c7734992 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Check.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Check.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs index 01fa680c..7ba63c09 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs index a22ce3e8..f3262a1c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs index a0c868d5..f51c038e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentAudit.cs index 13a70623..34d9b2fe 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs index a53cd836..8d045308 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs index 655fa86b..c8967c5e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs index 760fa542..a5bec94f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs index 99ce6a98..d26fe0a5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs index 1c705dc2..f6ad253b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs @@ -480,6 +480,7 @@ namespace VEPROMS.CSLA.Library if (!IsDirty) return; using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]) { + cn.Open(); string pattern = string.Format(@"( [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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DROUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DROUsage.cs index d709daaa..46c9f046 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DROUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DROUsage.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs index b557f7f3..8919a9cf 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs index c9b738ab..4b9f0635 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs index e55fa4f5..2da44d1e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs index 037fcb56..9b632000 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentAudit.cs index 95dabee1..894f50e7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentDROUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentDROUsage.cs index 139432bd..1727f3a3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentDROUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentDROUsage.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs index 97becf42..0c31376a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentPdf.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentPdf.cs index 92a9ae77..07167dd2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentPdf.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentPdf.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs index ed69344f..bbdfadff 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/EntryAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/EntryAudit.cs index caf6fd45..8e754644 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/EntryAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/EntryAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs index 84d7ddeb..78cef031 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs index 4e02c80b..b45916c8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs index 020fc778..fd516853 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs index aa6be6c3..167d8715 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs index 4cb5e0ae..9989d824 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs index da739339..2a43b4d3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs index de0aa07f..b095fa44 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs index 629ba0fc..6288a01e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Grid.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Grid.cs index 448b3810..7bb1de27 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Grid.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Grid.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GridAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GridAudit.cs index 8ae7ea55..183033f8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GridAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GridAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs index e37346bf..45b7c60b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs index 87316a3a..6a410671 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs index b72fd77e..d16639c1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Image.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Image.cs index a580ecff..fab4b6bb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Image.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Image.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ImageAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ImageAudit.cs index dcf42387..4180df96 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ImageAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ImageAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs index 4b6fc11c..2e0512da 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs index 75d1b997..ae0a35fd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAudit.cs index 27ccdca2..bb3b532b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs index 3b049d27..1059abb0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs index 43dc5a27..7d59ea8d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs index 397b27a1..bce122bb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs index ada64461..58e1945f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs index 18461f6d..490153fa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Owner.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Owner.cs index f3ed6829..344f1401 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Owner.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Owner.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs index 60e8a045..aaa1aefe 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/PartAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/PartAudit.cs index ae75c4bd..be439f7a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/PartAudit.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/PartAudit.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs index 4926ef2a..31332595 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs index 2fabe7ff..53912917 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs index 68ca2180..00af1922 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbDROUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbDROUsage.cs index 0702cf4a..30a0421e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbDROUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbDROUsage.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs index b27c542d..55e2a17c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs index 04b4003d..4980823f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs index b767c969..dabe060b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs index 2701066e..f7fbfbf2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs index ef1fadf6..0c14bad9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs index 9df23c2a..9916df12 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs index 753635e6..aa59c5dd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs index 13e1e1bd..91abc0c6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Revision.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Revision.cs index 873a72f2..72131c60 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Revision.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Revision.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionCheck.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionCheck.cs index 756c10bd..50d4c910 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionCheck.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionCheck.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionVersion.cs index 844b65b3..147b87a7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionVersion.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs index 585caddb..007f58d5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs index 7927a87d..e80c0606 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs index 9a81bb7c..99a8059d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs index 518c9a14..5ccd4412 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Session.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Session.cs index fe99f3d7..1529eade 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Session.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Session.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Stage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Stage.cs index 9096f7a3..5fe86a01 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Stage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Stage.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/StageCheck.cs b/PROMS/VEPROMS.CSLA.Library/Generated/StageCheck.cs index c4ab9e10..da3db42e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/StageCheck.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/StageCheck.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/StageVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/StageVersion.cs index 4d0559f8..eb515584 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/StageVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/StageVersion.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs index f641edb8..174c30cb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs index f8e69317..01cac725 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs index 47eb8c85..6127dfbc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs @@ -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); } diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Version.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Version.cs index 396b087e..f2bb2018 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Version.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Version.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs index eae45d97..c2cc83aa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs @@ -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 diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs index 03ea3008..e392cd92 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs @@ -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