Example #1
0
 private CswNbtSdInspectionsDataModels.InspectionData _makeInspectionReturn()
 {
     CswNbtSdInspectionsDataModels.InspectionData Ret = new CswNbtSdInspectionsDataModels.InspectionData();
     if (null != _SystemView)
     {
         ICswNbtTree Tree = _CswNbtResources.Trees.getTreeFromView(_SystemView, true, false, false);
         Ret = _iterateTree(Tree);
     }
     return(Ret);
 }
Example #2
0
 public CswNbtInspectionGet()
 {
     Data = new CswNbtSdInspectionsDataModels.InspectionData();
 }
Example #3
0
        private CswNbtSdInspectionsDataModels.InspectionData _iterateTree(ICswNbtTree Tree, CswNbtSdInspectionsDataModels.InspectionData Ret = null)
        {
            Ret = Ret ?? new CswNbtSdInspectionsDataModels.InspectionData();
            Int32 ChildNodeCount = Tree.getChildNodeCount();

            if (ChildNodeCount > 0)
            {
                for (Int32 I = 0; I < ChildNodeCount; I += 1)
                {
                    Tree.goToNthChild(I);
                    if (false == Tree.getNodeLockedForCurrentPosition())
                    {
                        CswNbtNode NodeForCurrentPosition = Tree.getNodeForCurrentPosition();
                        if (NodeForCurrentPosition.ObjClass.ObjectClass.ObjectClass == _InspectionDesignOc.ObjectClass)
                        {
                            CswNbtSdInspectionsDataModels.InspectionData.CswNbtInspectionDesign Design = _addNodeTypeInspectionDesignToResponse(NodeForCurrentPosition);
                            if (null != Design)
                            {
                                Ret.Designs.Add(Design);
                            }
                            CswNbtSdInspectionsDataModels.InspectionData.CswNbtInspection Inspection = _addChecklistNodesToResponse(NodeForCurrentPosition);
                            if (null != Inspection)
                            {
                                Ret.Inspections.Add(Inspection);
                            }
                        }
                    }
                    if (Tree.getChildNodeCount() > 0)
                    {
                        _iterateTree(Tree, Ret);
                    }
                    Tree.goToParentNode();
                }
            }
            return(Ret);
        }