public override void update() { // Add Regulatory List and Chemical to the add layout of RegulatoryListMember CswNbtMetaDataObjectClass RegListMemberOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.RegulatoryListMemberClass ); foreach( CswNbtMetaDataNodeType RegListMemberNT in RegListMemberOC.getNodeTypes() ) { foreach( CswNbtMetaDataNodeTypeProp PropNTP in RegListMemberNT.getNodeTypeProps().Where( p => Int32.MinValue != p.ObjectClassPropId ) ) { switch( PropNTP.getObjectClassPropName() ) { case CswNbtObjClassRegulatoryListMember.PropertyName.RegulatoryList: PropNTP.updateLayout( CswEnumNbtLayoutType.Add, true, DisplayRow: 1, DisplayColumn: 1 ); break; case CswNbtObjClassRegulatoryListMember.PropertyName.Chemical: PropNTP.updateLayout( CswEnumNbtLayoutType.Add, true, DisplayRow: 2, DisplayColumn: 1 ); break; } } } // Remove ability to add Regulatory List Members from Chemicals tab on Regulatory List CswNbtMetaDataObjectClass RegListMemOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.RegulatoryListMemberClass ); CswNbtMetaDataObjectClass RegListOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.RegulatoryListClass ); foreach( CswNbtMetaDataNodeType Nodetype in RegListOC.getNodeTypes() ) { CswNbtMetaDataNodeTypeProp ChemicalsNTP = Nodetype.getNodeTypePropByObjectClassProp( CswNbtObjClassRegulatoryList.PropertyName.Chemicals ); CswNbtView ChemicalsView = _CswNbtSchemaModTrnsctn.restoreView( ChemicalsNTP.ViewId ); CswNbtViewRoot.forEachRelationship EachRelationship = delegate( CswNbtViewRelationship Relationship ) { if( Relationship.SecondId == RegListMemOC.ObjectClassId ) { Relationship.AllowAdd = false; } }; ChemicalsView.Root.eachRelationship( EachRelationship, null ); ChemicalsView.save(); } } // update()
public override void update() { CswNbtMetaDataObjectClass LocationOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass); foreach (CswNbtMetaDataNodeType LocationNT in LocationOC.getNodeTypes()) { // Object class props first Int32 FirstTabId = LocationNT.getFirstNodeTypeTab().TabId; foreach (CswNbtMetaDataNodeTypeProp PropNTP in LocationNT.getNodeTypeProps().Where(p => Int32.MinValue != p.ObjectClassPropId)) { switch (PropNTP.getObjectClassPropName()) { case CswNbtObjClassLocation.PropertyName.Barcode: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 1, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 1, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.Name: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 2, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 2, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.Location: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 3, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 3, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.Order: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 4, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 4, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.LocationCode: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 5, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 5, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.AllowInventory: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 6, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 6, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.InventoryGroup: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 7, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 7, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.StorageCompatibility: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 8, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 8, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.ControlZone: PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: 9, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: 9, DisplayColumn: 1); break; case CswNbtObjClassLocation.PropertyName.Containers: // fine as is break; case CswNbtObjClassLocation.PropertyName.InventoryLevels: // fine as is break; case CswNbtObjClassLocation.PropertyName.Responsible: PropNTP.removeFromAllLayouts(); break; case CswNbtObjClassLocation.PropertyName.LocationTemplate: PropNTP.removeFromAllLayouts(); break; case CswNbtObjClassLocation.PropertyName.ChildLocationType: PropNTP.removeFromAllLayouts(); break; case CswNbtObjClassLocation.PropertyName.Rows: PropNTP.removeFromAllLayouts(); break; case CswNbtObjClassLocation.PropertyName.Columns: PropNTP.removeFromAllLayouts(); break; } } // NodeTypeProps next Int32 r = 10; foreach (CswNbtMetaDataNodeTypeProp PropNTP in LocationNT.getNodeTypeProps().Where(p => Int32.MinValue == p.ObjectClassPropId)) { if (PropNTP.PropName != "Legacy Id") { PropNTP.updateLayout(CswEnumNbtLayoutType.Add, true, DisplayRow: r, DisplayColumn: 1); PropNTP.updateLayout(CswEnumNbtLayoutType.Edit, true, FirstTabId, DisplayRow: r, DisplayColumn: 1); r++; } } } } // update()