public override void update()
 {
     CswNbtView ExpiringSDSView = _CswNbtSchemaModTrnsctn.restoreView( "SDS Expiring Next Month" );
     if( null != ExpiringSDSView )
     {
         ExpiringSDSView.Delete();
     }
 } // update()
 public override void update()
 {
     CswNbtView DoomedUoMView = _CswNbtSchemaModTrnsctn.restoreView( "Units of Measure" );
     if( null != DoomedUoMView )
     {
         DoomedUoMView.Delete();
     }
 }//Update()
        public override void update()
        {

            CswNbtMetaDataNodeType SiteNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Site" );
            if( null != SiteNT )
            {
                CswNbtMetaDataNodeTypeProp LocationNTP = SiteNT.getNodeTypePropByObjectClassProp( CswNbtObjClassLocation.PropertyName.Location );

                LocationNTP.ReadOnly = true;
                LocationNTP.removeFromAllLayouts();
                LocationNTP.Hidden = true;

                CswNbtView SitesView = _CswNbtSchemaModTrnsctn.makeNewView( "Sites Location Not Null", CswEnumNbtViewVisibility.Hidden );

                CswNbtViewRelationship parent = SitesView.AddViewRelationship( SiteNT, false );
                SitesView.AddViewPropertyAndFilter( parent, LocationNTP,
                                                    SubFieldName: CswEnumNbtSubFieldName.NodeID,
                                                    FilterMode: CswEnumNbtFilterMode.NotNull );

                ICswNbtTree tree = _CswNbtSchemaModTrnsctn.getTreeFromView( SitesView, true );
                for( int i = 0; i < tree.getChildNodeCount(); i++ )
                {
                    tree.goToNthChild( i );

                    CswNbtObjClassLocation SiteNode = tree.getNodeForCurrentPosition();
                    SiteNode.Location.SelectedNodeId = null;
                    SiteNode.Location.RefreshNodeName();
                    SiteNode.Location.SyncGestalt();
                    SiteNode.postChanges( false );

                    tree.goToParentNode();
                }

                SitesView.Delete();
            }

        } // update()
        public override void update()
        {
            //All existing suppliers should have a vendor type of 'Sales'
            CswNbtMetaDataObjectClass vendorOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.VendorClass );
            foreach( CswNbtObjClassVendor vendorNode in vendorOC.getNodes( false, false, false, true ) )
            {
                vendorNode.VendorType.Value = CswNbtObjClassVendor.VendorTypes.Sales;
                vendorNode.postChanges( false );
            }

            //Remove the view filter on Materials
            CswNbtMetaDataObjectClass materialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
            CswNbtMetaDataObjectClassProp supplierOCP = materialOC.getObjectClassProp( CswNbtObjClassMaterial.PropertyName.Supplier );

            bool updatedOCP = false;
            foreach( CswNbtMetaDataNodeType materialNT in materialOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp supplierNTP = materialNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.Supplier );
                CswNbtView oldSupplierView = _CswNbtSchemaModTrnsctn.ViewSelect.restoreView( supplierNTP.ViewId );
                if( null != oldSupplierView )
                {
                    oldSupplierView.Delete();
                }
                CswNbtView newSupplierView = _CswNbtSchemaModTrnsctn.makeNewView( "Supplier", NbtViewVisibility.Property );
                newSupplierView.AddViewRelationship( vendorOC, true );
                newSupplierView.save();

                supplierNTP.ViewId = newSupplierView.ViewId;

                if( false == updatedOCP )
                {
                    updatedOCP = true;
                    _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( supplierOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.viewxml, newSupplierView.ToString() );
                }
            }

        } //Update()
Beispiel #5
0
        /// <summary>
        /// Update logic
        /// </summary>
        public override void update()
        {

            #region PART 1 - Hide the settings tab on the Equipment/Assembly Schedule NT

            List<int> ntpIdsToHide = new List<int>();

            //get the props from the Settings tab and then delete the tab on Equipment Schedule
            CswNbtMetaDataNodeType equipmentScheduleNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Equipment Schedule" );
            if( null != equipmentScheduleNT )
            {
                foreach( CswNbtMetaDataNodeTypeTab tab in equipmentScheduleNT.getNodeTypeTabs() )
                {
                    if( tab.TabName.Equals( "Settings" ) )
                    {
                        foreach( CswNbtMetaDataNodeTypeProp ntp in tab.getNodeTypeProps() )
                        {
                            ntpIdsToHide.Add( ntp.PropId );
                        }
                        _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeTab( tab );
                    }
                }
            }

            //get the props from the Settings tab and then delete the tab on Assembly Schedule
            CswNbtMetaDataNodeType assemblyScheduleNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Assembly Schedule" );
            if( null != assemblyScheduleNT )
            {
                foreach( CswNbtMetaDataNodeTypeTab tab in assemblyScheduleNT.getNodeTypeTabs() )
                {
                    if( tab.TabName.Equals( "Settings" ) )
                    {
                        foreach( CswNbtMetaDataNodeTypeProp ntp in tab.getNodeTypeProps() )
                        {
                            ntpIdsToHide.Add( ntp.PropId );
                        }
                        _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeTab( tab );
                    }
                }
            }

            //hide the props
            foreach( int ntpId in ntpIdsToHide )
            {
                CswNbtMetaDataNodeTypeProp ntp = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeProp( ntpId );
                ntp.removeFromAllLayouts();
            }

            #endregion

            #region PART 2 - Delete the SI Configuration category and all the views in it

            //get the doomed view ids
            CswTableSelect node_viewsTS = _CswNbtSchemaModTrnsctn.makeCswTableSelect( "deleteSIViews_27780", "node_views" );
            CswCommaDelimitedString selectCols = new CswCommaDelimitedString();
            selectCols.FromString( "nodeviewid" );
            DataTable node_views = node_viewsTS.getTable( selectCols, "where category = 'SI Configuration'" );

            foreach( DataRow row in node_views.Rows )
            {
                int viewidInt = CswConvert.ToInt32( row["nodeviewid"] );
                CswNbtViewId viewid = new CswNbtViewId();
                viewid.set( viewidInt );
                if( viewid.isSet() )
                {
                    CswNbtView doomedView = _CswNbtSchemaModTrnsctn.ViewSelect.restoreView( viewid );
                    doomedView.Delete();
                }
            }

            #endregion

        }
Beispiel #6
0
        public override void update()
        {
            CswNbtMetaDataNodeType LabSafetyChecklist = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Lab Safety Checklist (demo)" );
            CswNbtMetaDataNodeType LabSafetyGroup = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Lab Safety Group (demo)" );
            CswNbtMetaDataNodeType LabSafetyTarget = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Lab Safety (demo)" );

            if( null != LabSafetyChecklist && null != LabSafetyGroup && null != LabSafetyTarget )
            {
                CswNbtMetaDataNodeTypeTab SchedulesTab = LabSafetyGroup.getNodeTypeTab( "Schedules" );
                if( null == SchedulesTab )
                {
                    CswNbtMetaDataNodeType GeneratorNt = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( CswNbtObjClassGenerator.InspectionGeneratorNodeTypeName );
                    if( null != GeneratorNt )
                    {
                        SchedulesTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( LabSafetyGroup, " Schedules", 2 );
                        CswNbtMetaDataNodeTypeProp SchedulesNtp = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( LabSafetyGroup, CswEnumNbtFieldType.Grid, "Schedules", SchedulesTab.TabId );
                        CswNbtView SchedulesView = _CswNbtSchemaModTrnsctn.makeSafeView( LabSafetyTarget.NodeTypeName + " Schedules", CswEnumNbtViewVisibility.Property );
                        SchedulesView.NbtViewMode = CswEnumNbtViewRenderingMode.Grid.ToString();

                        CswNbtViewRelationship Rel = SchedulesView.AddViewRelationship( LabSafetyGroup, IncludeDefaultFilters: true );
                        CswNbtViewRelationship SchedRel = SchedulesView.AddViewRelationship( Rel, CswEnumNbtViewPropOwnerType.Second, GeneratorNt.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.Owner ), IncludeDefaultFilters: true );
                        SchedulesView.AddViewProperty( SchedRel, GeneratorNt.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.Description ) );
                        SchedulesView.AddViewProperty( SchedRel, GeneratorNt.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.NextDueDate ) );
                        SchedulesView.AddViewProperty( SchedRel, GeneratorNt.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.RunStatus ) );
                        SchedulesView.AddViewProperty( SchedRel, GeneratorNt.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.RunTime ) );

                        SchedulesView.save();
                        SchedulesNtp.ViewId = SchedulesView.ViewId;
                        SchedulesNtp.removeFromLayout( CswEnumNbtLayoutType.Add );
                    }
                }
                CswNbtView GroupView = _CswNbtSchemaModTrnsctn.restoreView( "Groups, Lab Safety Checklist: Lab Safety (demo)" );
                if( null != GroupView )
                {
                    CswNbtView View = GroupView;
                    GroupView.Root.eachRelationship( Relationship =>
                    {
                        if( Relationship.SecondMetaDataDefinitionObject().UniqueId == LabSafetyTarget.NodeTypeId )
                        {
                            View.AddViewRelationship( Relationship, CswEnumNbtViewPropOwnerType.Second, LabSafetyChecklist.getNodeTypePropByObjectClassProp( CswNbtObjClassInspectionDesign.PropertyName.Target ), false );
                        }

                    }, null );  
                    GroupView.save();
                }

                CswNbtView DoomedView1 = _CswNbtSchemaModTrnsctn.restoreView( "Inspections, Lab Safety Checklist: Lab Safety (demo)" );
                if( null != DoomedView1 )
                {
                    DoomedView1.Delete();
                }
                
                CswNbtView DoomedView2 = _CswNbtSchemaModTrnsctn.restoreView( "Scheduling, Lab Safety Checklist: Lab Safety (demo)" );
                if( null != DoomedView2 )
                {
                    DoomedView2.Delete();
                }





            }
            

        } // update()