public override void update()
        {
            // Create the view
            CswNbtMetaDataPropertySet MaterialPS = _CswNbtSchemaModTrnsctn.MetaData.getPropertySet( CswEnumNbtPropertySetName.MaterialSet );

            CswNbtMetaDataObjectClass ManufacturerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ManufacturerClass );
            CswNbtMetaDataObjectClassProp MaterialOCP = ManufacturerOC.getObjectClassProp( CswNbtObjClassManufacturer.PropertyName.Material );
            CswNbtMetaDataObjectClassProp ManufacturingSiteOCP = ManufacturerOC.getObjectClassProp( CswNbtObjClassManufacturer.PropertyName.ManufacturingSite );
            CswNbtMetaDataObjectClassProp QualifiedOCP = ManufacturerOC.getObjectClassProp( CswNbtObjClassManufacturer.PropertyName.Qualified );

            CswNbtView ManufacturersView = _CswNbtSchemaModTrnsctn.makeSafeView( "ManufacturingSites", CswEnumNbtViewVisibility.Property );
            ManufacturersView.ViewName = "ManufacturingSites";
            ManufacturersView.ViewMode = CswEnumNbtViewRenderingMode.Grid;
            ManufacturersView.Root.ChildRelationships.Clear();

            CswNbtViewRelationship root = ManufacturersView.AddViewRelationship( MaterialPS, false );
            CswNbtViewRelationship relationship = ManufacturersView.AddViewRelationship( root, CswEnumNbtViewPropOwnerType.Second, MaterialOCP, true );

            ManufacturersView.AddViewProperty( relationship, ManufacturingSiteOCP );
            ManufacturersView.AddViewProperty( relationship, QualifiedOCP );

            ManufacturersView.save();

            foreach( CswNbtMetaDataObjectClass MaterialOC in MaterialPS.getObjectClasses() )
            {
                CswNbtMetaDataObjectClassProp GridOCP = MaterialOC.getObjectClassProp( CswNbtPropertySetMaterial.PropertyName.ManufacturingSites );
                _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( GridOCP, CswEnumNbtObjectClassPropAttributes.viewxml, ManufacturersView.ToString() );
            }

        } // update()
Ejemplo n.º 2
0
        public override void update()
        {

            CswNbtMetaDataObjectClass BiologicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.BiologicalClass );
           CswNbtMetaDataObjectClass SupplyOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.NonChemicalClass );

            foreach( CswNbtMetaDataObjectClass MaterialOC in new[] {BiologicalOC, SupplyOC} )
            {
                CswNbtMetaDataObjectClassProp OpenExpireOCP = MaterialOC.getObjectClassProp( CswNbtPropertySetMaterial.PropertyName.OpenExpireInterval );
                CswNbtMetaDataObjectClassProp ExpirationIntervalOCP = MaterialOC.getObjectClassProp( CswNbtPropertySetMaterial.PropertyName.ExpirationInterval );
                foreach( CswNbtMetaDataObjectClassProp OCP in new[] {OpenExpireOCP, ExpirationIntervalOCP} )
                {
                    foreach( CswNbtMetaDataNodeTypeProp NTP in OCP.getNodeTypeProps() )
                    {
                        CswNbtMetaDataNodeType NT = NTP.getNodeType();
                        NTP.updateLayout( CswEnumNbtLayoutType.Edit, true, NT.getFirstNodeTypeTab().TabId );
                    }
                }
            }
        } // update()
Ejemplo n.º 3
0
        /// <summary>
        /// The actual update call
        /// </summary>
        public override void update()
        {
            CswNbtMetaDataPropertySet MaterialSet = _CswNbtSchemaModTrnsctn.MetaData.getPropertySet(CswEnumNbtPropertySetName.MaterialSet);

            foreach (CswNbtMetaDataObjectClass MaterialOC in MaterialSet.getObjectClasses())
            {
                CswNbtMetaDataObjectClassProp ExpirationLockedOCP = MaterialOC.getObjectClassProp(CswNbtPropertySetMaterial.PropertyName.ContainerExpirationLocked);
                if (null == ExpirationLockedOCP)
                {
                    ExpirationLockedOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp(MaterialOC, new CswNbtWcfMetaDataModel.ObjectClassProp
                    {
                        PropName    = CswNbtPropertySetMaterial.PropertyName.ContainerExpirationLocked,
                        FieldType   = CswEnumNbtFieldType.Logical,
                        SetValOnAdd = false,
                        IsRequired  = true
                    });
                    _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue(ExpirationLockedOCP, CswEnumTristate.True, CswEnumNbtSubFieldName.Checked);
                }
            }
        }
Ejemplo n.º 4
0
        public override void update()
        {
            CswNbtMetaDataPropertySet MaterialPS = _CswNbtSchemaModTrnsctn.MetaData.getPropertySet( CswEnumNbtPropertySetName.MaterialSet );
            foreach( CswNbtMetaDataObjectClass MaterialOC in MaterialPS.getObjectClasses() )
            {
                // Set default value for Obsolete property on Materials to false
                // Remove obsolete from Add layout
                CswNbtMetaDataObjectClassProp ManufacturerSitesOCP = MaterialOC.getObjectClassProp( CswNbtPropertySetMaterial.PropertyName.ManufacturingSites );
                CswNbtView ManufacturersView = _CswNbtSchemaModTrnsctn.ViewSelect.restoreView( "ManufacturingSites", CswEnumNbtViewVisibility.Property );

                // Set view on nodetypes
                foreach( CswNbtMetaDataNodeType MaterialNT in MaterialOC.getNodeTypes() )
                {
                    CswNbtMetaDataNodeTypeProp ObsoleteNTP = MaterialNT.getNodeTypeProp( CswNbtPropertySetMaterial.PropertyName.Obsolete );
                    //ObsoleteNTP.getDefaultValue( true ).AsLogical.Checked = CswEnumTristate.False;
                    ObsoleteNTP.DesignNode.AttributeProperty[CswEnumNbtPropertyAttributeName.DefaultValue].AsLogical.Checked = CswEnumTristate.False;
                    ObsoleteNTP.removeFromLayout( CswEnumNbtLayoutType.Add );

                    CswNbtMetaDataNodeTypeProp GridNTP = MaterialNT.getNodeTypePropByObjectClassProp( CswNbtPropertySetMaterial.PropertyName.ManufacturingSites );
                    GridNTP.ViewId.set( ManufacturersView.ViewId.get() );
                }
            }

        } // update()