diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs index 5807d177..79d6ba80 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs @@ -279,11 +279,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirtyList(list)) || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } // TODO: Replace base Annotation.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs index 07f0e3c2..18d8adfc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs @@ -252,11 +252,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_AnnotationTypeAnnotations == null ? false : _AnnotationTypeAnnotations.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_AnnotationTypeAnnotations == null ? false : _AnnotationTypeAnnotations.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_AnnotationTypeAnnotations == null ? true : _AnnotationTypeAnnotations.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_AnnotationTypeAnnotations == null ? true : _AnnotationTypeAnnotations.IsValid); } // TODO: Replace base AnnotationType.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs index ccecb15c..deada463 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotation.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -256,11 +257,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotations.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotations.cs index b05ade0f..d0cab013 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotations.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeAnnotations.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (AnnotationTypeAnnotation item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (AnnotationTypeAnnotation child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (AnnotationTypeAnnotation child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs index ac944a23..aae1064d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs @@ -309,11 +309,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyRole == null ? false : _MyRole.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)) || (_MyGroup == null ? false : _MyGroup.IsDirtyList(list)) || (_MyRole == null ? false : _MyRole.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } // TODO: Replace base Assignment.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs index b8a09795..b7d771a1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs @@ -247,11 +247,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirty) || (_MyROFst == null ? false : _MyROFst.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirtyList(list)) || (_MyROFst == null ? false : _MyROFst.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } // TODO: Replace base Association.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ChildFolders.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ChildFolders.cs index 4fe873d8..dcb62478 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ChildFolders.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ChildFolders.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (Folder item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (Folder child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (Folder child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(string name) { foreach (Folder folder in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ChildFormats.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ChildFormats.cs index 3969d506..38697094 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ChildFormats.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ChildFormats.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (Format item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (Format child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (Format child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(string name) { foreach (Format format in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs index fd52ab44..5d70ce40 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs @@ -317,11 +317,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_ConnectionFolders == null ? false : _ConnectionFolders.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_ConnectionFolders == null ? false : _ConnectionFolders.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ConnectionFolders == null ? true : _ConnectionFolders.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ConnectionFolders == null ? true : _ConnectionFolders.IsValid); } // TODO: Replace base Connection.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs index 3dd79f9f..e2542367 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolder.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -290,11 +291,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolders.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolders.cs index 722fbc92..2082c4df 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolders.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionFolders.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ConnectionFolder item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ConnectionFolder child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ConnectionFolder child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs index edcedf9e..a5659ca7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs @@ -576,11 +576,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_ContentDetails == null ? false : _ContentDetails.IsDirty) || (_MyEntry == null ? false : _MyEntry.IsDirty) || (_ContentItems == null ? false : _ContentItems.IsDirty) || (_ContentParts == null ? false : _ContentParts.IsDirty) || (_ContentRoUsages == null ? false : _ContentRoUsages.IsDirty) || (_ContentTransitions == null ? false : _ContentTransitions.IsDirty) || (_MyZContent == null ? false : _MyZContent.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_ContentDetails == null ? false : _ContentDetails.IsDirtyList(list)) || (_MyEntry == null ? false : _MyEntry.IsDirtyList(list)) || (_ContentItems == null ? false : _ContentItems.IsDirtyList(list)) || (_ContentParts == null ? false : _ContentParts.IsDirtyList(list)) || (_ContentRoUsages == null ? false : _ContentRoUsages.IsDirtyList(list)) || (_ContentTransitions == null ? false : _ContentTransitions.IsDirtyList(list)) || (_MyZContent == null ? false : _MyZContent.IsDirtyList(list)) || (_MyFormat == null ? false : _MyFormat.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ContentDetails == null ? true : _ContentDetails.IsValid) && (_MyEntry == null ? true : _MyEntry.IsValid) && (_ContentItems == null ? true : _ContentItems.IsValid) && (_ContentParts == null ? true : _ContentParts.IsValid) && (_ContentRoUsages == null ? true : _ContentRoUsages.IsValid) && (_ContentTransitions == null ? true : _ContentTransitions.IsValid) && (_MyZContent == null ? true : _MyZContent.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ContentDetails == null ? true : _ContentDetails.IsValid) && (_MyEntry == null ? true : _MyEntry.IsValid) && (_ContentItems == null ? true : _ContentItems.IsValid) && (_ContentParts == null ? true : _ContentParts.IsValid) && (_ContentRoUsages == null ? true : _ContentRoUsages.IsValid) && (_ContentTransitions == null ? true : _ContentTransitions.IsValid) && (_MyZContent == null ? true : _MyZContent.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } // TODO: Replace base Content.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs index 00eda9e6..4a553207 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetail.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -181,6 +182,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetails.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetails.cs index 071c3bac..704949ae 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetails.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentDetails.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ContentDetail item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ContentDetail child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ContentDetail child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs index 13580ade..010fda54 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItem.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -152,6 +153,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItems.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItems.cs index d4069fc9..c3fd9702 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentItems.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentItems.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ContentItem item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ContentItem child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ContentItem child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs index 02f33bbe..b65509a3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentPart.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -180,11 +181,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentParts.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentParts.cs index 66bccb98..dfbca0a3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentParts.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentParts.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ContentPart item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ContentPart child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ContentPart child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs index 72b85434..4ca2d326 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsage.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -264,11 +265,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyRODb == null ? false : _MyRODb.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyRODb == null ? false : _MyRODb.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsages.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsages.cs index ecac510e..ede44f3d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsages.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentRoUsages.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ContentRoUsage item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ContentRoUsage child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ContentRoUsage child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs index a77c2086..e6f207a2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransition.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -309,11 +310,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyItemToID == null ? false : _MyItemToID.IsDirty) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyItemToID == null ? false : _MyItemToID.IsDirtyList(list)) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransitions.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransitions.cs index 0d8270e4..d6248a05 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransitions.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentTransitions.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ContentTransition item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ContentTransition child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ContentTransition child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs index d8330b0c..d44b9fd8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs @@ -245,11 +245,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } // TODO: Replace base Detail.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs index 0e01a189..73ba9168 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs @@ -387,11 +387,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_DocVersionAssociations == null ? false : _DocVersionAssociations.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_DocVersionAssociations == null ? false : _DocVersionAssociations.IsDirtyList(list)) || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)) || (_MyFormat == null ? false : _MyFormat.IsDirtyList(list)) || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); } public override bool IsValid { - get { return true;} // (IsNew && !IsDirty ? true : base.IsValid) && (_DocVersionAssociations == null ? true : _DocVersionAssociations.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_DocVersionAssociations == null ? true : _DocVersionAssociations.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } // TODO: Replace base DocVersion.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs index 14acb2d9..df989826 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociation.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -224,11 +225,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociations.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociations.cs index 18d8cac9..05bfb1f7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociations.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionAssociations.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (DocVersionAssociation item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (DocVersionAssociation child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (DocVersionAssociation child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(ROFst myROFst) { foreach (DocVersionAssociation association in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs index b4e013a8..b89297db 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs @@ -310,11 +310,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_DocumentEntries == null ? false : _DocumentEntries.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_DocumentEntries == null ? false : _DocumentEntries.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_DocumentEntries == null ? true : _DocumentEntries.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_DocumentEntries == null ? true : _DocumentEntries.IsValid); } // TODO: Replace base Document.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntries.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntries.cs index 4485f12d..355057b9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntries.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntries.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (DocumentEntry item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (DocumentEntry child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (DocumentEntry child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs index 8b50b21b..e9626ef1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentEntry.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -192,6 +193,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs index 11d99026..b79e1de6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs @@ -191,11 +191,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyDocument == null ? false : _MyDocument.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyDocument == null ? false : _MyDocument.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocument == null ? true : _MyDocument.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyDocument == null ? true : _MyDocument.IsValid); } // TODO: Replace base Entry.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs index 9849a97f..3738ecf2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs @@ -247,11 +247,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirty) || (_MyROImage == null ? false : _MyROImage.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirtyList(list)) || (_MyROImage == null ? false : _MyROImage.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid) && (_MyROImage == null ? true : _MyROImage.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid) && (_MyROImage == null ? true : _MyROImage.IsValid); } // TODO: Replace base Figure.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs index ee664a48..3145ab28 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs @@ -507,11 +507,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_FolderAssignments == null ? false : _FolderAssignments.IsDirty) || (_FolderDocVersions == null ? false : _FolderDocVersions.IsDirty) || (_ChildFolders == null ? false : _ChildFolders.IsDirty) || (_MyConnection == null ? false : _MyConnection.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_FolderAssignments == null ? false : _FolderAssignments.IsDirtyList(list)) || (_FolderDocVersions == null ? false : _FolderDocVersions.IsDirtyList(list)) || (_ChildFolders == null ? false : _ChildFolders.IsDirtyList(list)) || (_MyConnection == null ? false : _MyConnection.IsDirtyList(list)) || (_MyFormat == null ? false : _MyFormat.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_FolderAssignments == null ? true : _FolderAssignments.IsValid) && (_FolderDocVersions == null ? true : _FolderDocVersions.IsValid) && (_ChildFolders == null ? true : _ChildFolders.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_FolderAssignments == null ? true : _FolderAssignments.IsValid) && (_FolderDocVersions == null ? true : _FolderDocVersions.IsValid) && (_ChildFolders == null ? true : _ChildFolders.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } // TODO: Replace base Folder.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs index 871d654a..df5fdc06 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignment.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -335,11 +336,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyRole == null ? false : _MyRole.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirtyList(list)) || (_MyRole == null ? false : _MyRole.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignments.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignments.cs index 7184e3be..a3885d71 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignments.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderAssignments.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (FolderAssignment item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (FolderAssignment child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (FolderAssignment child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs index 2e99e6fe..aebdde96 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersion.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -271,6 +272,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersions.cs index 8bfbdd5c..9e4c6434 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersions.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderDocVersions.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (FolderDocVersion item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (FolderDocVersion child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (FolderDocVersion child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs index 4febed74..d7841c0b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs @@ -470,11 +470,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_FormatContents == null ? false : _FormatContents.IsDirty) || (_FormatDocVersions == null ? false : _FormatDocVersions.IsDirty) || (_FormatFolders == null ? false : _FormatFolders.IsDirty) || (_ChildFormats == null ? false : _ChildFormats.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_FormatContents == null ? false : _FormatContents.IsDirtyList(list)) || (_FormatDocVersions == null ? false : _FormatDocVersions.IsDirtyList(list)) || (_FormatFolders == null ? false : _FormatFolders.IsDirtyList(list)) || (_ChildFormats == null ? false : _ChildFormats.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_FormatContents == null ? true : _FormatContents.IsValid) && (_FormatDocVersions == null ? true : _FormatDocVersions.IsValid) && (_FormatFolders == null ? true : _FormatFolders.IsValid) && (_ChildFormats == null ? true : _ChildFormats.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_FormatContents == null ? true : _FormatContents.IsValid) && (_FormatDocVersions == null ? true : _FormatDocVersions.IsValid) && (_FormatFolders == null ? true : _FormatFolders.IsValid) && (_ChildFormats == null ? true : _ChildFormats.IsValid); } // TODO: Replace base Format.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs index 8f5fb7f4..d02f030e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContent.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -205,6 +206,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContents.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContents.cs index 9b957a92..d7c00536 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatContents.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatContents.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (FormatContent item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (FormatContent child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (FormatContent child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs index f2882383..95f8a587 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersion.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -372,11 +373,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersions.cs index d51663f1..94b515a4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersions.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatDocVersions.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (FormatDocVersion item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (FormatDocVersion child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (FormatDocVersion child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs index 7e62c32c..cf3096b1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolder.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -362,11 +363,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyConnection == null ? false : _MyConnection.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)) || (_MyConnection == null ? false : _MyConnection.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolders.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolders.cs index e7eae2c4..e55748bc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolders.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatFolders.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (FormatFolder item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (FormatFolder child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (FormatFolder child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs index d6750aa7..56ed22ce 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs @@ -322,11 +322,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_GroupAssignments == null ? false : _GroupAssignments.IsDirty) || (_GroupMemberships == null ? false : _GroupMemberships.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_GroupAssignments == null ? false : _GroupAssignments.IsDirtyList(list)) || (_GroupMemberships == null ? false : _GroupMemberships.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_GroupAssignments == null ? true : _GroupAssignments.IsValid) && (_GroupMemberships == null ? true : _GroupMemberships.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_GroupAssignments == null ? true : _GroupAssignments.IsValid) && (_GroupMemberships == null ? true : _GroupMemberships.IsValid); } // TODO: Replace base Group.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs index 67852bcf..9e289ff2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignment.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -385,11 +386,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirtyList(list)) || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignments.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignments.cs index 03944b15..e2a278cb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignments.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupAssignments.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (GroupAssignment item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (GroupAssignment child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (GroupAssignment child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs index eaf77f8e..0ead6062 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMembership.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -364,11 +365,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyUser == null ? false : _MyUser.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyUser == null ? false : _MyUser.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMemberships.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMemberships.cs index 8de03e73..ac9d3922 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupMemberships.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupMemberships.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (GroupMembership item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (GroupMembership child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (GroupMembership child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs index ab3b3979..9c4da833 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs @@ -510,11 +510,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_ItemAnnotations == null ? false : _ItemAnnotations.IsDirty) || (_ItemDocVersions == null ? false : _ItemDocVersions.IsDirty) || (_NextItems == null ? false : _NextItems.IsDirty) || (_ItemParts == null ? false : _ItemParts.IsDirty) || (_ItemTransitions_RangeID == null ? false : _ItemTransitions_RangeID.IsDirty) || (_ItemTransitions_ToID == null ? false : _ItemTransitions_ToID.IsDirty) || (_MyContent == null ? false : _MyContent.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_ItemAnnotations == null ? false : _ItemAnnotations.IsDirtyList(list)) || (_ItemDocVersions == null ? false : _ItemDocVersions.IsDirtyList(list)) || (_NextItems == null ? false : _NextItems.IsDirtyList(list)) || (_ItemParts == null ? false : _ItemParts.IsDirtyList(list)) || (_ItemTransitions_RangeID == null ? false : _ItemTransitions_RangeID.IsDirtyList(list)) || (_ItemTransitions_ToID == null ? false : _ItemTransitions_ToID.IsDirtyList(list)) || (_MyContent == null ? false : _MyContent.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ItemAnnotations == null ? true : _ItemAnnotations.IsValid) && (_ItemDocVersions == null ? true : _ItemDocVersions.IsValid) && (_NextItems == null ? true : _NextItems.IsValid) && (_ItemParts == null ? true : _ItemParts.IsValid) && (_ItemTransitions_RangeID == null ? true : _ItemTransitions_RangeID.IsValid) && (_ItemTransitions_ToID == null ? true : _ItemTransitions_ToID.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ItemAnnotations == null ? true : _ItemAnnotations.IsValid) && (_ItemDocVersions == null ? true : _ItemDocVersions.IsValid) && (_NextItems == null ? true : _NextItems.IsValid) && (_ItemParts == null ? true : _ItemParts.IsValid) && (_ItemTransitions_RangeID == null ? true : _ItemTransitions_RangeID.IsValid) && (_ItemTransitions_ToID == null ? true : _ItemTransitions_ToID.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } // TODO: Replace base Item.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs index 4c19f601..49a19e7c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotation.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -256,11 +257,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotations.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotations.cs index 6a595bc4..235fe424 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotations.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemAnnotations.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ItemAnnotation item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ItemAnnotation child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ItemAnnotation child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs index 7dbac35a..b809e99b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersion.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -372,11 +373,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersions.cs index bc9e6e1d..2e88d65c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersions.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemDocVersions.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ItemDocVersion item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ItemDocVersion child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ItemDocVersion child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs index 29796097..1fa2a343 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemPart.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -203,6 +204,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemParts.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemParts.cs index 69039767..7999ac57 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemParts.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemParts.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ItemPart item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ItemPart child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ItemPart child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs index 5f5195b1..2a6fda63 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_RangeID.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -302,11 +303,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs index 368f7bca..201b7ad9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransition_ToID.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -299,11 +300,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_RangeID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_RangeID.cs index d827f228..583d8df2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_RangeID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_RangeID.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ItemTransition_RangeID item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ItemTransition_RangeID child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ItemTransition_RangeID child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_ToID.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_ToID.cs index 2d92fffd..1a2a0449 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_ToID.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemTransitions_ToID.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ItemTransition_ToID item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ItemTransition_ToID child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ItemTransition_ToID child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs index c5fe3e86..4155f2ec 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs @@ -297,11 +297,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyUser == null ? false : _MyUser.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirtyList(list)) || (_MyUser == null ? false : _MyUser.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } // TODO: Replace base Membership.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/NextItems.cs b/PROMS/VEPROMS.CSLA.Library/Generated/NextItems.cs index 03cb1ee7..f3540d17 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/NextItems.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/NextItems.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (Item item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (Item child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (Item child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs index 01303193..d1c08815 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs @@ -203,11 +203,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)) || (_MyItem == null ? false : _MyItem.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } // TODO: Replace base Part.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs index 1764ec4b..51a69fc1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs @@ -356,11 +356,30 @@ namespace VEPROMS.CSLA.Library private byte[] _LastChanged = new byte[8];//timestamp public override bool IsDirty { - get { return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } // TODO: Replace base Permission.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs index 6f6d4bc0..d212c448 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs @@ -403,11 +403,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_RODbROFsts == null ? false : _RODbROFsts.IsDirty) || (_RODbROImages == null ? false : _RODbROImages.IsDirty) || (_RODbRoUsages == null ? false : _RODbRoUsages.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_RODbROFsts == null ? false : _RODbROFsts.IsDirtyList(list)) || (_RODbROImages == null ? false : _RODbROImages.IsDirtyList(list)) || (_RODbRoUsages == null ? false : _RODbRoUsages.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RODbROFsts == null ? true : _RODbROFsts.IsValid) && (_RODbROImages == null ? true : _RODbROImages.IsValid) && (_RODbRoUsages == null ? true : _RODbRoUsages.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_RODbROFsts == null ? true : _RODbROFsts.IsValid) && (_RODbROImages == null ? true : _RODbROImages.IsValid) && (_RODbRoUsages == null ? true : _RODbRoUsages.IsValid); } // TODO: Replace base RODb.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs index 45a5d43d..7d01f8bd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFst.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -160,6 +161,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFsts.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFsts.cs index b8123514..c9aee7c3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFsts.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROFsts.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (RODbROFst item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (RODbROFst child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (RODbROFst child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(DateTime dts) { foreach (RODbROFst rOFst in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs index 5258a070..0cc4543f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImage.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -181,6 +182,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImages.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImages.cs index 8b441259..d945a684 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImages.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbROImages.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (RODbROImage item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (RODbROImage child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (RODbROImage child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(string fileName, DateTime dts) { foreach (RODbROImage rOImage in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs index 252dc0fe..b0da6a3b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsage.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -268,11 +269,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsages.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsages.cs index 4e5a4c3b..147564d8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsages.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbRoUsages.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (RODbRoUsage item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (RODbRoUsage child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (RODbRoUsage child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs index 7d9b2075..6953aa30 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs @@ -334,11 +334,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty; } // || (_ROFstAssociations == null ? false : _ROFstAssociations.IsDirty) || (_ROFstFigures == null ? false : _ROFstFigures.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_ROFstAssociations == null ? false : _ROFstAssociations.IsDirtyList(list)) || (_ROFstFigures == null ? false : _ROFstFigures.IsDirtyList(list)) || (_MyRODb == null ? false : _MyRODb.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ROFstAssociations == null ? true : _ROFstAssociations.IsValid) && (_ROFstFigures == null ? true : _ROFstFigures.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ROFstAssociations == null ? true : _ROFstAssociations.IsValid) && (_ROFstFigures == null ? true : _ROFstFigures.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } // TODO: Replace base ROFst.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs index 17f0b416..607b8ec9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociation.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -267,11 +268,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirtyList(list)); } public override bool IsValid { - get { return true;} // (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociations.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociations.cs index 099b0032..217ef188 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociations.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstAssociations.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ROFstAssociation item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ROFstAssociation child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ROFstAssociation child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(DocVersion myDocVersion) { foreach (ROFstAssociation association in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs index f158c667..0bc8e982 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigure.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -234,11 +235,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyROImage == null ? false : _MyROImage.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyROImage == null ? false : _MyROImage.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyROImage == null ? true : _MyROImage.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyROImage == null ? true : _MyROImage.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigures.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigures.cs index f8b685db..49e5091c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigures.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstFigures.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ROFstFigure item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ROFstFigure child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ROFstFigure child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(ROImage myROImage) { foreach (ROFstFigure figure in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs index 3237f22f..d5aa5d25 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs @@ -305,11 +305,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_ROImageFigures == null ? false : _ROImageFigures.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_ROImageFigures == null ? false : _ROImageFigures.IsDirtyList(list)) || (_MyRODb == null ? false : _MyRODb.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ROImageFigures == null ? true : _ROImageFigures.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ROImageFigures == null ? true : _ROImageFigures.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } // TODO: Replace base ROImage.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs index 764e80e0..c51b3e07 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigure.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -224,11 +225,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigures.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigures.cs index 25a80944..b9ceb83e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigures.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageFigures.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -93,6 +94,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (ROImageFigure item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (ROImageFigure child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (ROImageFigure child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } public bool Contains(ROFst myROFst) { foreach (ROImageFigure figure in this) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs index 61f9ec90..6113e589 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs @@ -258,11 +258,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirtyList(list)) || (_MyRODb == null ? false : _MyRODb.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } // TODO: Replace base RoUsage.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs index a2bea19f..97b0a180 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs @@ -302,11 +302,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_RoleAssignments == null ? false : _RoleAssignments.IsDirty) || (_RolePermissions == null ? false : _RolePermissions.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_RoleAssignments == null ? false : _RoleAssignments.IsDirtyList(list)) || (_RolePermissions == null ? false : _RolePermissions.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RoleAssignments == null ? true : _RoleAssignments.IsValid) && (_RolePermissions == null ? true : _RolePermissions.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_RoleAssignments == null ? true : _RoleAssignments.IsValid) && (_RolePermissions == null ? true : _RolePermissions.IsValid); } // TODO: Replace base Role.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs index 85aad5eb..957aa596 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignment.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -395,11 +396,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirtyList(list)) || (_MyFolder == null ? false : _MyFolder.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignments.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignments.cs index c62cf51a..f74b1190 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignments.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoleAssignments.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (RoleAssignment item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (RoleAssignment child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (RoleAssignment child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs index 11cffa12..976c1883 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermission.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -292,6 +293,22 @@ namespace VEPROMS.CSLA.Library //{ // return base.ToString(); //} + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } + public override bool IsValid + { + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; + } #endregion #region ValidationRules [NonSerialized] diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermissions.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermissions.cs index 00e2aec8..a29dfb00 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RolePermissions.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RolePermissions.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (RolePermission item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (RolePermission child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (RolePermission child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs index 4a92be9d..380a1fd1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs @@ -321,11 +321,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_MyZTransition == null ? false : _MyZTransition.IsDirty) || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirty) || (_MyItemToID == null ? false : _MyItemToID.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyZTransition == null ? false : _MyZTransition.IsDirtyList(list)) || (_MyContent == null ? false : _MyContent.IsDirtyList(list)) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirtyList(list)) || (_MyItemToID == null ? false : _MyItemToID.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyZTransition == null ? true : _MyZTransition.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyZTransition == null ? true : _MyZTransition.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid); } // TODO: Replace base Transition.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs index 944cce72..3cc6621f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs @@ -431,11 +431,30 @@ namespace VEPROMS.CSLA.Library } public override bool IsDirty { - get { return base.IsDirty || (_UserMemberships == null ? false : _UserMemberships.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_UserMemberships == null ? false : _UserMemberships.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_UserMemberships == null ? true : _UserMemberships.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_UserMemberships == null ? true : _UserMemberships.IsValid); } // TODO: Replace base User.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs index 67304498..aa359f4e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/UserMembership.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -284,11 +285,30 @@ namespace VEPROMS.CSLA.Library //} public override bool IsDirty { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty); } + get + { + if ( base.IsDirty ) + return true; + return IsDirtyList(new List()); + } + } + public bool IsDirtyList(List list) + { + if (base.IsDirty || list.Contains(this)) + return base.IsDirty; + list.Add(this); + return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirtyList(list)); } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid); } + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + if(list.Contains(this)) + return (IsNew && !IsDirty) ? true : base.IsValid; + list.Add(this); + return ((IsNew && !IsDirty) ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid); } #endregion #region ValidationRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/UserMemberships.cs b/PROMS/VEPROMS.CSLA.Library/Generated/UserMemberships.cs index 3b80a2b0..a3ce2a51 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/UserMemberships.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/UserMemberships.cs @@ -16,6 +16,7 @@ using Csla.Data; using System.Configuration; using System.IO; using System.ComponentModel; +using System.Collections.Generic; using Csla.Validation; namespace VEPROMS.CSLA.Library { @@ -88,6 +89,37 @@ namespace VEPROMS.CSLA.Library return true; return false; } + public bool IsDirtyList(List list) + { + // any non-new deletions make us dirty + foreach (UserMembership item in DeletedList) + if (!item.IsNew) + return true; + // run through all the child objects + // and if any are dirty then then + // collection is dirty + foreach (UserMembership child in this) + if (child.IsDirtyList(list)) + return true; + return false; + } + public override bool IsValid + { + get { return IsValidList(new List()); } + } + public bool IsValidList(List list) + { + // run through all the child objects + // and if any are invalid then the + // collection is invalid + foreach (UserMembership child in this) + if (!child.IsValidList(list)) + { + //Console.WriteLine("Valid {0} Child {1} - {2}", child.IsValid, child.GetType().Name,child.ToString()); + return false; + } + return true; + } #endregion #region ValidationRules public IVEHasBrokenRules HasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs index cee1a28c..b4605cc9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs @@ -136,9 +136,21 @@ namespace VEPROMS.CSLA.Library } } private byte[] _LastChanged = new byte[8];//timestamp + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid); } + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; } // TODO: Replace base ZContent.ToString function as necessary /// diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs index de463d67..a00caeb0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs @@ -136,9 +136,21 @@ namespace VEPROMS.CSLA.Library } } private byte[] _LastChanged = new byte[8];//timestamp + public override bool IsDirty + { + get { return base.IsDirty; } + } + public bool IsDirtyList(List list) + { + return base.IsDirty; + } public override bool IsValid { - get { return (IsNew && !IsDirty ? true : base.IsValid); } + get { return (IsNew && !IsDirty) ? true : base.IsValid; } + } + public bool IsValidList(List list) + { + return (IsNew && !IsDirty) ? true : base.IsValid; } // TODO: Replace base ZTransition.ToString function as necessary ///