コード例 #1
0
        public static void GetBrokenRulesString(IBusinessObject currentObj,
                                                List <IBusinessObject> checkEntities,
                                                List <string> errorMessages,
                                                System.Data.Objects.DataClasses.EntityObject parent)
        {
            if (checkEntities.Contains(currentObj))
            {
                return;
            }

            checkEntities.Add(currentObj);

            if (parent == null)
            {
                errorMessages.Add(currentObj.GetCurrentBrokenRules());
            }
            else
            {
                errorMessages.Add(currentObj.GetCurrentBrokenRules());
            }

            if (IsNew(currentObj))
            {
                return;
            }

            foreach (Adage.EF.Interfaces.RelatedObject eachObj in currentObj.RelatedObjects)
            {
                IRelatedEnd childColl;
                if (eachObj.RelatedType == RelatedEnum.Many)
                {
                    childColl = eachObj.GetRelatedEnd((EntityObject)currentObj);
                    if (childColl == null || childColl.IsLoaded == false)
                    {
                        continue;
                    }
                }
                else
                {
                    if (eachObj.GetReference((EntityObject)currentObj).IsLoaded == false)
                    {
                        continue;
                    }

                    childColl = eachObj.GetRelatedEnd((EntityObject)currentObj);
                }

                foreach (Adage.EF.Interfaces.IBusinessObject eachChild in childColl)
                {
                    eachChild.FindBrokenRules(checkEntities,
                                              errorMessages, (EntityObject)currentObj);
                }
            }
        }
コード例 #2
0
        public static void GetBrokenRulesString(IBusinessObject currentObj,
                List<IBusinessObject> checkEntities,
                List<string> errorMessages,
                System.Data.Objects.DataClasses.EntityObject parent)
        {
            if (checkEntities.Contains(currentObj))
                return;

            checkEntities.Add(currentObj);

            if (parent == null)
                errorMessages.Add(currentObj.GetCurrentBrokenRules());
            else
                errorMessages.Add(currentObj.GetCurrentBrokenRules());

            if (IsNew(currentObj))
                return;

            foreach (Adage.EF.Interfaces.RelatedObject eachObj in currentObj.RelatedObjects)
            {
                IRelatedEnd childColl;
                if (eachObj.RelatedType == RelatedEnum.Many)
                {
                    childColl = eachObj.GetRelatedEnd((EntityObject)currentObj);
                    if (childColl == null || childColl.IsLoaded == false)
                    {
                        continue;
                    }
                }
                else
                {
                    if (eachObj.GetReference((EntityObject)currentObj).IsLoaded == false)
                    {
                        continue;
                    }

                    childColl = eachObj.GetRelatedEnd((EntityObject)currentObj);
                }

                foreach (Adage.EF.Interfaces.IBusinessObject eachChild in childColl)
                {
                    eachChild.FindBrokenRules(checkEntities,
                        errorMessages, (EntityObject)currentObj);
                }
            }
        }