Exemplo n.º 1
0
        private CswNbtView _getSiInspectionUserView(bool ReInit)
        {
            CswNbtView Ret = _getSystemView(CswEnumNbtSystemViewName.SIInspectionsbyUser);

            if (null == Ret)
            {
                CswNbtNode ChemSwAdminRoleNode = _CswNbtResources.Nodes.makeRoleNodeFromRoleName(CswNbtObjClassRole.ChemSWAdminRoleName);
                Ret = new CswNbtView(_CswNbtResources);
                Ret.saveNew(CswEnumNbtSystemViewName.SIInspectionsbyUser.ToString(), CswEnumNbtViewVisibility.Role, ChemSwAdminRoleNode.NodeId);
                Ret.Category = SiViewCategory;
                Ret.ViewMode = CswEnumNbtViewRenderingMode.List;
                ReInit       = true;
            }
            if (ReInit)
            {
                Ret.Root.ChildRelationships.Clear();
                CswNbtMetaDataObjectClass InspectionDesignOc = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.InspectionDesignClass);
                CswNbtViewRelationship    InspectionDesignVr = Ret.AddViewRelationship(InspectionDesignOc, true);

                _addDefaultInspectionDesignViewPropsAndFilters(Ret, InspectionDesignVr, InspectionDesignOc);

                CswNbtMetaDataObjectClassProp InspectorOcp = InspectionDesignOc.getObjectClassProp(CswNbtObjClassInspectionDesign.PropertyName.Inspector);
                Ret.AddViewPropertyAndFilter(InspectionDesignVr, InspectorOcp, "me");

                Ret.save();
            }
            return(Ret);
        }