Ejemplo n.º 1
0
        public override void update()
        {
            CswNbtMetaDataObjectClass ChemicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswEnumNbtObjectClass.ChemicalClass);

            foreach (CswNbtMetaDataNodeType ChemicalNT in ChemicalOC.getNodeTypes())
            {
                CswNbtMetaDataNodeTypeProp GHSNTP = ChemicalNT.getNodeTypePropByObjectClassProp(CswNbtObjClassChemical.PropertyName.Jurisdiction);
                if (null != GHSNTP)
                {
                    GHSNTP.updateLayout(CswEnumNbtLayoutType.Preview, true);
                }
            }
            CswNbtMetaDataObjectClass GHSOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswEnumNbtObjectClass.GHSClass);

            foreach (CswNbtMetaDataNodeType GHSNT in GHSOC.getNodeTypes())
            {
                CswNbtMetaDataNodeTypeProp PictosNTP = GHSNT.getNodeTypePropByObjectClassProp(CswNbtObjClassGHS.PropertyName.Pictograms);
                foreach (CswNbtMetaDataNodeTypeProp GHSNTP in GHSNT.getNodeTypeProps())
                {
                    if (null != PictosNTP && GHSNTP.PropId == PictosNTP.PropId)
                    {
                        GHSNTP.updateLayout(CswEnumNbtLayoutType.Preview, true);
                    }
                    else
                    {
                        GHSNTP.removeFromLayout(CswEnumNbtLayoutType.Preview);
                    }
                }
            }
        }
        public override void update()
        {
            // For each Location Node type that isn't Site, the Full Path should be Path + > + Name
            // and for Sites, the Full Path should be Name.

            CswNbtMetaDataObjectClass LocationOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass);

            foreach (CswNbtMetaDataNodeType LocationNT in LocationOC.getNodeTypes())
            {
                CswNbtMetaDataNodeTypeProp FullPathNTP = LocationNT.getNodeTypePropByObjectClassProp(CswNbtObjClassLocation.PropertyName.FullPath);
                CswNbtMetaDataNodeTypeProp LocationNTP = LocationNT.getNodeTypePropByObjectClassProp(CswNbtObjClassLocation.PropertyName.Location);
                CswNbtMetaDataNodeTypeProp NameNTP     = LocationNT.getNodeTypePropByObjectClassProp(CswNbtObjClassLocation.PropertyName.Name);
                if (null != FullPathNTP)
                {
                    // Set the value of the property
                    if (LocationNT.NodeTypeName != "Site")
                    {
                        FullPathNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleComposite.AttributeName.Template].AsText.Text = "{" + LocationNTP.PropId + "} > " + "{" + NameNTP.PropId + "}";
                    }
                    else
                    {
                        FullPathNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleComposite.AttributeName.Template].AsText.Text = "{" + NameNTP.PropId + "}";
                    }

                    // Set the layout position and remove from the add layout
                    FullPathNTP.removeFromLayout(CswEnumNbtLayoutType.Add);
                    FullPathNTP.updateLayout(CswEnumNbtLayoutType.Edit, LocationNTP, true);
                }
            }

            _setLocationsPendingUpdate();
        }
Ejemplo n.º 3
0
        public override void update()
        {

            CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MailReportClass );
            foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )
            {
                // remove 'Nodes to Report' from all layouts
                CswNbtMetaDataNodeTypeProp NodesToReportNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.NodesToReport );
                _CswNbtSchemaModTrnsctn.MetaData.NodeTypeLayout.removePropFromAllLayouts( NodesToReportNTP );

                // remove Run Status from Add layout
                CswNbtMetaDataNodeTypeProp RunStatusNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.RunStatus );
                RunStatusNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );

                // set Target Type and Event to be conditional on Type = View
                CswNbtMetaDataNodeTypeProp TypeNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Type );
                CswNbtMetaDataNodeTypeProp TargetTypeNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.TargetType );
                CswNbtMetaDataNodeTypeProp EventNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Event );
                TargetTypeNTP.setFilter( TypeNTP, TypeNTP.getFieldTypeRule().SubFields.Default, CswNbtPropFilterSql.PropertyFilterMode.Equals, CswNbtObjClassMailReport.TypeOptionView );
                EventNTP.setFilter( TypeNTP, TypeNTP.getFieldTypeRule().SubFields.Default, CswNbtPropFilterSql.PropertyFilterMode.Equals, CswNbtObjClassMailReport.TypeOptionView );

                // add help text to Report View
                CswNbtMetaDataNodeTypeProp ReportViewNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.ReportView );
                ReportViewNTP.HelpText = "For 'Exists' events, a report is generated if the view returns any results that match the Target Type.  For 'Edit' events, a report is only generated if one of the properties in the view was modified.";

                // set target type and event for existing mail reports
                foreach( CswNbtObjClassMailReport MailReportNode in MailReportNT.getNodes( false, true ) )
                {
                    if( CswNbtObjClassMailReport.TypeOptionView == MailReportNode.Type.Value &&
                        0 == MailReportNode.TargetType.SelectedNodeTypeIds.Count )
                    {
                        CswNbtView View = _CswNbtSchemaModTrnsctn.restoreView( MailReportNode.ReportView.ViewId );
                        if( View.Root.ChildRelationships.Count > 0 )
                        {
                            CswNbtViewRelationship RootRel = View.Root.ChildRelationships[0];
                            if( RootRel.SecondType == NbtViewRelatedIdType.NodeTypeId )
                            {
                                MailReportNode.TargetType.SelectedNodeTypeIds.Add( RootRel.SecondId.ToString() );
                            }
                            else
                            {
                                CswNbtMetaDataObjectClass RootOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( RootRel.SecondId.ToString() );
                                if( null != RootOC.FirstNodeType )
                                {
                                    MailReportNode.TargetType.SelectedNodeTypeIds.Add( RootOC.FirstNodeType.NodeTypeId.ToString() );
                                }
                            }
                        }
                    }

                    if( MailReportNode.Event.Empty )
                    {
                        MailReportNode.Event.Value = CswNbtObjClassMailReport.EventOption.Exists.ToString();
                    }
                    MailReportNode.postChanges( false );

                } // foreach( CswNbtObjClassMailReport MailReportNode in MailReportNT.getNodes( false, true ) )
            } // foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )

        }//Update()
        private void _createNewSDSDocNT()
        {
            CswEnumNbtNodeTypePermission[] NTPermissions = 
            { 
                CswEnumNbtNodeTypePermission.View, 
                CswEnumNbtNodeTypePermission.Create, 
                CswEnumNbtNodeTypePermission.Edit, 
                CswEnumNbtNodeTypePermission.Delete 
            };

            //New Document NT
            CswNbtMetaDataObjectClass ChemicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ChemicalClass );
            CswNbtMetaDataObjectClass DocumentOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.SDSDocumentClass );
            CswNbtMetaDataNodeType SDSNT = _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeType( DocumentOC.ObjectClassId, "SDS Document", "Materials" );
            _CswNbtSchemaModTrnsctn.createModuleNodeTypeJunction( CswEnumNbtModuleName.SDS, SDSNT.NodeTypeId );
            //Default Title
            CswNbtMetaDataNodeTypeProp TitleNTP = SDSNT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Title );
            TitleNTP.DefaultValue.AsText.Text = "Safety Data Sheet";
            TitleNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
            //Set Owner FK to Material OC (This needs to be done explicitly for the NTP - see Case 26605)
            CswNbtMetaDataNodeTypeProp OwnerNTP = SDSNT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Owner );
            OwnerNTP.PropName = "Material";
            OwnerNTP.SetFK( CswEnumNbtViewRelatedIdType.ObjectClassId.ToString(), ChemicalOC.ObjectClassId );
            //NT Permission
            CswNbtObjClassRole RoleNode = _CswNbtSchemaModTrnsctn.Nodes.makeRoleNodeFromRoleName( "CISPro_Admin" );
            if( null != RoleNode )
            {
                _CswNbtSchemaModTrnsctn.Permit.set( NTPermissions, SDSNT, RoleNode, true );
            }
        }
Ejemplo n.º 5
0
        public override void update()
        {
            _CswNbtSchemaModTrnsctn.createAction( CswEnumNbtActionName.Container_Expiration_Lock, false, String.Empty, "Containers" );
            _CswNbtSchemaModTrnsctn.createModuleActionJunction( CswEnumNbtModuleName.Containers, CswEnumNbtActionName.Container_Expiration_Lock );

            CswNbtMetaDataObjectClass RoleOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.RoleClass );
            foreach( CswNbtObjClassRole RoleNode in RoleOC.getNodes( false, true ) )
            {
                _CswNbtSchemaModTrnsctn.Permit.set( CswEnumNbtActionName.Container_Expiration_Lock, RoleNode.Node, RoleNode.Administrator.Checked == CswEnumTristate.True );
            }

            CswNbtMetaDataPropertySet MaterialSet = _CswNbtSchemaModTrnsctn.MetaData.getPropertySet( CswEnumNbtPropertySetName.MaterialSet );
            foreach( CswNbtMetaDataObjectClass MaterialOC in MaterialSet.getObjectClasses() )
            {
                foreach( CswNbtMetaDataNodeType MaterialNT in MaterialOC.getNodeTypes() )
                {
                    CswNbtMetaDataNodeTypeProp ExpirationLockedNTP = MaterialNT.getNodeTypePropByObjectClassProp( CswNbtPropertySetMaterial.PropertyName.ContainerExpirationLocked );
                    ExpirationLockedNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
                }
                foreach( CswNbtPropertySetMaterial MaterialNode in MaterialOC.getNodes( false, false ) )
                {
                    MaterialNode.ContainerExpirationLocked.Checked = CswEnumTristate.True;
                    MaterialNode.postChanges( false );
                }
            }
        } // update()
 public override void update()
 {
     CswNbtMetaDataObjectClass MaterialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
     foreach( CswNbtMetaDataNodeType MaterialNT in MaterialOC.getNodeTypes() )
     {
         if( MaterialNT.NodeTypeName == "Biological" )
         {
             CswNbtMetaDataNodeTypeProp PictureNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeProp( MaterialNT.NodeTypeId, "Picture" );
             if( null != PictureNTP )
             {
                 PictureNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
             }
             CswNbtMetaDataNodeTypeProp RefNoNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeProp( MaterialNT.NodeTypeId, "Reference Number" );
             if( null != RefNoNTP )
             {
                 RefNoNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true );
             }
             CswNbtMetaDataNodeTypeProp TypeNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeProp( MaterialNT.NodeTypeId, "Type" );
             if( null != TypeNTP )
             {
                 TypeNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true );
             }
         }
         else if( MaterialNT.NodeTypeName == "Chemical" )
         {
             CswNbtMetaDataNodeTypeProp CasNoNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( MaterialNT.NodeTypeId, CswNbtObjClassMaterial.PropertyName.CasNo );
             CasNoNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true );
         }
     }
 }//Update()
 public override void update()
 {
     //New Document NT
     CswNbtMetaDataObjectClass ReceiptLotOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ReceiptLotClass );
     CswNbtMetaDataObjectClass CofADocOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.CofADocumentClass );
     CswNbtMetaDataNodeType CofANT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "C of A Document" ) ??
          _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeTypeDeprecated( CofADocOC.ObjectClassId, "C of A Document", "Materials" );
     _CswNbtSchemaModTrnsctn.createModuleNodeTypeJunction( CswEnumNbtModuleName.CofA, CofANT.NodeTypeId );
     //Default Title
     CswNbtMetaDataNodeTypeProp TitleNTP = CofANT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Title );
     TitleNTP.DefaultValue.AsText.Text = "Certificate of Analysis";
     TitleNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
     //Set Owner FK to ReceiptLot OC (This needs to be done explicitly for the NTP - see Case 26605)
     CswNbtMetaDataNodeTypeProp OwnerNTP = CofANT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Owner );
     OwnerNTP.PropName = "Receipt Lot";
     OwnerNTP.SetFK( CswEnumNbtViewRelatedIdType.ObjectClassId.ToString(), ReceiptLotOC.ObjectClassId );
     //Set Prop Filters (This needs to be done explicitly for the NTP - see Case 26605)
     CswNbtMetaDataNodeTypeProp FileTypeNTP = CofANT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.FileType );
     CswNbtMetaDataNodeTypeProp FileNTP = CofANT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.File );
     FileNTP.setFilter( FileTypeNTP, FileTypeNTP.getFieldTypeRule().SubFields.Default, CswEnumNbtFilterMode.Equals, CswNbtPropertySetDocument.CswEnumDocumentFileTypes.File );
     CswNbtMetaDataNodeTypeProp LinkNTP = CofANT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Link );
     LinkNTP.setFilter( FileTypeNTP, FileTypeNTP.getFieldTypeRule().SubFields.Default, CswEnumNbtFilterMode.Equals, CswNbtPropertySetDocument.CswEnumDocumentFileTypes.Link );
     //NT Permission
     CswNbtObjClassRole RoleNode = _CswNbtSchemaModTrnsctn.Nodes.makeRoleNodeFromRoleName( "CISPro_Admin" );
     if( null != RoleNode )
     {
         _CswNbtSchemaModTrnsctn.Permit.set( NTPermissions, CofANT, RoleNode, true );
     }
 } // update()
 private void _setEditLayout( string PropName, int ColNum, int RowNum, string TabGroup = "", bool RemoveFromAdd = true )
 {
     CswNbtMetaDataNodeTypeProp FireClassExemptAmountNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( FireClassExemptAmountNT.NodeTypeId, PropName );
     if( RemoveFromAdd )
         FireClassExemptAmountNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
     FireClassExemptAmountNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, FireClassExemptAmountNT.getFirstNodeTypeTab().TabId, RowNum, ColNum, TabGroup );
 }
 public override void update()
 {
     CswNbtMetaDataObjectClass ContDispTransOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ContainerDispenseTransactionClass );
     foreach( CswNbtMetaDataNodeType ContDispTransNT in ContDispTransOC.getNodeTypes() )
     {
         CswNbtMetaDataNodeTypeProp DispenserNTP = ContDispTransNT.getNodeTypePropByObjectClassProp( CswNbtObjClassContainerDispenseTransaction.PropertyName.Dispenser );
         DispenserNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
     }
 } // update()
        public override void update()
        {
            CswNbtMetaDataObjectClass GeneratorOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.GeneratorClass );
            CswNbtMetaDataObjectClassProp TargetTypeOcp = GeneratorOc.getObjectClassProp( CswNbtObjClassGenerator.PropertyName.TargetType );

            foreach( CswNbtMetaDataNodeType GeneratorNt in GeneratorOc.getLatestVersionNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp TargetType = GeneratorNt.getNodeTypePropByObjectClassProp( TargetTypeOcp.ObjectClassPropId );
                TargetType.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }
        } //Update()
        public override void update()
        {
            // Yes, this is NT and NTP specific logic, but there are 5 NTs under the DocumentOC and we needed to work specifically with the SDS Document NT.
            CswNbtMetaDataNodeType SDSDocumentNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "SDS Document" );
            if( null != SDSDocumentNT )
            {
                CswNbtMetaDataNodeTypeProp TitleOCP = SDSDocumentNT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.Title );
                TitleOCP.DefaultValue.AsText.Text = "SDS";
                TitleOCP.removeFromLayout( CswEnumNbtLayoutType.Add );
            }

        } // update()
        /// <summary>
        /// Update logic
        /// </summary>
        public override void update()
        {

            CswNbtMetaDataObjectClass problemOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.ProblemClass );
            CswNbtMetaDataObjectClassProp closedOCP = problemOC.getObjectClassProp( CswNbtObjClassProblem.PropertyName.Closed );
            foreach( CswNbtMetaDataNodeType problemNT in problemOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp closedNTP = problemNT.getNodeTypePropByObjectClassProp( closedOCP.ObjectClassPropId );
                closedNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }

        }
Ejemplo n.º 13
0
        public override void update()
        {
            CswNbtMetaDataObjectClass ContainerOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.ContainerClass );

            //This block is needed in the event of a full SchemaUpdate reset to ensure that the RequestDispense button only exists on the Requests tab
            foreach( CswNbtMetaDataNodeType ContainerNt in ContainerOc.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp RequestNtp = ContainerNt.getNodeTypePropByObjectClassProp( CswNbtObjClassContainer.RequestPropertyName );
                foreach( CswNbtMetaDataNodeTypeTab ContainerNodeTypeTab in _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeTabs( ContainerNt.NodeTypeId ) )
                {
                    RequestNtp.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, TabId: ContainerNodeTypeTab.TabId );
                }

                CswNbtMetaDataNodeTypeTab RequestsTab = ContainerNt.getNodeTypeTab( "Requests" );
                if( null == RequestsTab )
                {
                    RequestsTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( ContainerNt, "Requests", ContainerNt.getNodeTypeTabIds().Count );
                }
                RequestNtp.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, ContainerNt.getFirstNodeTypeTab().TabId );
                RequestNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, RequestsTab.TabId, 1, 1 );
                RequestNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Table, true, RequestsTab.TabId, 1, 1 );
            }
        }//Update()
Ejemplo n.º 14
0
        /// <summary>
        /// Remove a property from the tab of a specific layout or from all tabs of a layout if the current tab is null.
        /// </summary>
        public void removeProp(string PropName, CswEnumNbtLayoutType LayoutType = null)
        {
            CswNbtSchemaUpdateLayoutMgr.LayoutProp Prop = _vetLayoutOp(PropName, true, LayoutType);

            foreach (CswNbtMetaDataNodeType NodeType in _LayoutMgr.LatestVersionNodeTypes)
            {
                CswNbtMetaDataNodeTypeTab Tab = _getTab(_LayoutMgr.SchemaModTrnsctn, NodeType);
                if (null != Tab)
                {
                    CswNbtMetaDataNodeTypeProp Ntp = NodeType.getNodeTypePropByObjectClassProp(Prop.Prop);
                    Ntp.removeFromLayout(Prop.Layout, Tab.TabId);
                }
            }
        }
 public override void update()
 {
     // moved from RunBeforeEveryExecutionOfUpdater_01OC
     CswNbtMetaDataObjectClass requestItemOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtDoomedObjectClasses.RequestItemClass );
     CswNbtMetaDataNodeType requestItemNT = requestItemOC.FirstNodeType;
     if( null != requestItemNT )
     {
         CswNbtMetaDataNodeTypeProp reqItemRequestorNTP = requestItemNT.getNodeTypePropByObjectClassProp( CswNbtObjClassRequestItem.PropertyName.Requestor );
         if( null != reqItemRequestorNTP )
         {
             reqItemRequestorNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
         }
     }
 }//Update()
Ejemplo n.º 16
0
        public override void update()
        {
            #region PART ONE
            //Remove Part Number (chemical, biological and supply NTPs) from Add layout, so it doesn't show up twice while creating a material
            CswNbtMetaDataNodeType chemicalNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Chemical" );
            if( null != chemicalNT )
            {
                CswNbtMetaDataNodeTypeProp chemPartNoNTP = chemicalNT.getNodeTypeProp( CswNbtObjClassMaterial.PartNumberPropertyName );
                if( null != chemPartNoNTP )
                {
                    chemPartNoNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }
            }

            CswNbtMetaDataNodeType bioNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Biological" );
            if( null != bioNT )
            {
                CswNbtMetaDataNodeTypeProp bioPartNoNTP = bioNT.getNodeTypeProp( CswNbtObjClassMaterial.PartNumberPropertyName );
                if( null != bioPartNoNTP )
                {
                    bioPartNoNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }
            }

            CswNbtMetaDataNodeType supplyNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Supply" );
            if( null != supplyNT )
            {
                CswNbtMetaDataNodeTypeProp supplyPartNoNTP = supplyNT.getNodeTypeProp( CswNbtObjClassMaterial.PartNumberPropertyName );
                if( null != supplyPartNoNTP )
                {
                    supplyPartNoNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }
            }
            #endregion

            #region PART FIVE
            //Remove 'Supplier'from add layout so it doesn' show up in Create Materials Wizard
            CswNbtMetaDataNodeType sizeNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Size" );
            if( null != sizeNT )
            {
                CswNbtMetaDataNodeTypeProp supplierNTP = sizeNT.getNodeTypeProp("Supplier");
                if (null != supplierNTP)
                {
                    supplierNTP.removeFromLayout(CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add);
                }
            }

            #endregion

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

            CswNbtMetaDataNodeType biologicalNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Biological" );
            if( null != biologicalNT )
            {
                CswNbtMetaDataNodeTypeTab tab = _getTab( biologicalNT, "Biosafety", 2 );
                CswNbtMetaDataNodeTypeProp storageConditionsNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( biologicalNT, CswNbtMetaDataFieldType.NbtFieldType.List, "Storage Conditions", tab.TabId );
                if( null != storageConditionsNTP )
                {
                    storageConditionsNTP.ListOptions = "37C,25C,5C,-20C,-80C";
                    storageConditionsNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }
            }

        }//Update()
Ejemplo n.º 18
0
        public override void update()
        {
            CswNbtMetaDataObjectClass RequestItemOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.RequestItemClass );
            _CswNbtSchemaModTrnsctn.createObjectClassProp( new CswNbtWcfMetaDataModel.ObjectClassProp( RequestItemOc )
                {
                    PropName = CswNbtObjClassRequestItem.PropertyName.TotalDispensed,
                    FieldType = CswNbtMetaDataFieldType.NbtFieldType.Quantity,
                    ServerManaged = true
                } );

            foreach( CswNbtMetaDataNodeType ItemNt in RequestItemOc.getLatestVersionNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp OrderNoNtp = ItemNt.getNodeTypePropByObjectClassProp( CswNbtObjClassRequestItem.PropertyName.ExternalOrderNumber );
                OrderNoNtp.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }

        }//Update()
        public override void update()
        {
            CswPrimaryKey HMISTotalsReportId = null;
            CswPrimaryKey HMISMaterialsReportId = null;

            CswNbtMetaDataObjectClass ReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ReportClass );

            CswNbtSearch FindReport = _CswNbtSchemaModTrnsctn.CswNbtSearch;
            FindReport.addFilter( ReportOC, false );
            FindReport.SearchType = CswEnumSqlLikeMode.Begins;
            FindReport.SearchTerm = "HMIS";
            ICswNbtTree SearchResults = FindReport.Results();
            for( Int32 r = 0; r < SearchResults.getChildNodeCount(); r++ )
            {
                SearchResults.goToNthChild( r );
                string ReportName = SearchResults.getNodeNameForCurrentPosition();
                if( ReportName == "HMIS Totals" )
                {
                    HMISTotalsReportId = SearchResults.getNodeIdForCurrentPosition();
                }
                if( ReportName == "HMIS Materials" )
                {
                    HMISMaterialsReportId = SearchResults.getNodeIdForCurrentPosition();
                }
                SearchResults.goToParentNode();
            } // for( Int32 r = 0; r < SearchResults.getChildNodeCount(); r++ )

            CswNbtMetaDataObjectClass ControlZoneOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ControlZoneClass );
            foreach( CswNbtMetaDataNodeType ControlZoneNT in ControlZoneOC.getNodeTypes() )
            {
                if( CswTools.IsPrimaryKey( HMISTotalsReportId ) )
                {
                    CswNbtMetaDataNodeTypeProp HMISTotalsNTP = ControlZoneNT.getNodeTypePropByObjectClassProp( CswNbtObjClassControlZone.PropertyName.HMISTotals );
                    HMISTotalsNTP.SetFK( "nodeid", HMISTotalsReportId.PrimaryKey );
                    HMISTotalsNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
                }
                if( CswTools.IsPrimaryKey( HMISMaterialsReportId ) )
                {
                    CswNbtMetaDataNodeTypeProp HMISMaterialsNTP = ControlZoneNT.getNodeTypePropByObjectClassProp( CswNbtObjClassControlZone.PropertyName.HMISMaterials );
                    HMISMaterialsNTP.SetFK( "nodeid", HMISMaterialsReportId.PrimaryKey );
                    HMISMaterialsNTP.removeFromLayout( CswEnumNbtLayoutType.Add );
                }
            } // foreach( CswNbtMetaDataNodeType ControlZoneNT in ControlZoneOC.getNodeTypes() )

        } // update()
        public override void update()
        {

            CswNbtMetaDataObjectClass MaterialSynonymsOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialSynonymClass );
            foreach( CswNbtMetaDataNodeType MaterialSynonymOCNT in MaterialSynonymsOC.getNodeTypes() )
            {

                /* Remove the Language and Type props from the add layout AND set the list options */
                CswNbtMetaDataNodeTypeProp TypeNTP = MaterialSynonymOCNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterialSynonym.PropertyName.Type );
                if( null != TypeNTP )
                {
                    TypeNTP.ListOptions = "Tradename," +
                                          "Synonym," +
                                          "IUPAC," +
                                          "EINECS";
                    TypeNTP.DefaultValue.AsList.Value = "Synonym";
                    TypeNTP.removeFromLayout( LayoutType: CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }

                CswNbtMetaDataNodeTypeProp LanguageNTP = MaterialSynonymOCNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterialSynonym.PropertyName.Language );
                if( null != LanguageNTP )
                {
                    LanguageNTP.ListOptions = "English";
                    LanguageNTP.DefaultValue.AsList.Value = "English";
                    LanguageNTP.removeFromLayout( LayoutType: CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }

                /* For pre-existing nodes, set the new properties to the default value */
                foreach( CswNbtObjClassMaterialSynonym MaterialSynonymNode in MaterialSynonymOCNT.getNodes( false, true ) )
                {
                    if( MaterialSynonymNode.Type.Empty )
                    {
                        MaterialSynonymNode.Type.Value = "Synonym";
                        MaterialSynonymNode.postChanges( false );
                    }

                    if( MaterialSynonymNode.Language.Empty )
                    {
                        MaterialSynonymNode.Language.Value = "English";
                        MaterialSynonymNode.postChanges( false );
                    }
                }
            }

        } //Update()
Ejemplo n.º 21
0
        public override void update()
        {
            // Remove the UN Code property from the add layout for all Material types
            CswNbtMetaDataObjectClass MaterialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
            if( null != MaterialOC )
            {
                foreach( CswNbtMetaDataNodeType MaterialNT in MaterialOC.getNodeTypes() )
                {
                    CswNbtMetaDataNodeTypeProp UNCodeNTP = MaterialNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMaterial.PropertyName.UNCode );
                    if( null != UNCodeNTP )
                    {
                        UNCodeNTP.removeFromLayout( LayoutType: CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                    }
                }
            }


        } //Update()
Ejemplo n.º 22
0
        /// <summary>
        /// Update logic
        /// </summary>
        public override void update()
        {

            CswNbtMetaDataObjectClass sizeOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.SizeClass );
            CswNbtMetaDataObjectClassProp materialOCP = sizeOC.getObjectClassProp( CswNbtObjClassSize.PropertyName.Material );

            //make this server managed
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( materialOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.servermanaged, true );

            CswNbtMetaDataNodeType sizeNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Size" );
            if( null != sizeNT )
            {
                CswNbtMetaDataNodeTypeProp materialNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( sizeNT.NodeTypeId, materialOCP.PropId );
                materialNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }


        }//Update()
        public override void update()
        {
            CswNbtMetaDataObjectClass InventoryLevelOc = _CswNbtSchemaModTrnsctn.createObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.InventoryLevelClass, "docs.gif", true, false );
            _CswNbtSchemaModTrnsctn.createObjectClassProp( InventoryLevelOc, new CswNbtWcfMetaDataModel.ObjectClassProp
            {
                FieldType = CswNbtMetaDataFieldType.NbtFieldType.Quantity,
                PropName = CswNbtObjClassInventoryLevel.PropertyName.CurrentQuantity,
                ServerManaged = true
            } );

            _CswNbtSchemaModTrnsctn.createObjectClassProp( InventoryLevelOc, new CswNbtWcfMetaDataModel.ObjectClassProp
            {
                FieldType = CswNbtMetaDataFieldType.NbtFieldType.Comments,
                PropName = CswNbtObjClassInventoryLevel.PropertyName.CurrentQuantityLog,
                ServerManaged = true
            } );

            foreach( CswNbtMetaDataNodeType LocationLevelNt in InventoryLevelOc.getLatestVersionNodeTypes() )
            {
                CswNbtMetaDataNodeTypeTab LogTab = LocationLevelNt.getNodeTypeTab( "Log" );
                if( null == LogTab )
                {
                    LogTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( LocationLevelNt, "Log", Int32.MinValue );
                }
                CswNbtMetaDataNodeTypeProp QuantityLogNtp = LocationLevelNt.getNodeTypePropByObjectClassProp( CswNbtObjClassInventoryLevel.PropertyName.CurrentQuantityLog );
                QuantityLogNtp.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, LogTab.TabId );
                QuantityLogNtp.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                CswNbtMetaDataNodeTypeProp QuantityNtp = LocationLevelNt.getNodeTypePropByObjectClassProp( CswNbtObjClassInventoryLevel.PropertyName.CurrentQuantity );
                QuantityNtp.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }

            CswNbtMetaDataObjectClass SizeOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.SizeClass );
            foreach( CswNbtMetaDataNodeType SizeNt in SizeOc.getLatestVersionNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp Capacity = SizeNt.getNodeTypePropByObjectClassProp( CswNbtObjClassSize.InitialQuantityPropertyName );
                SizeNt.setNameTemplateText( "" );
                SizeNt.addNameTemplateText( Capacity.PropName );
            }

        }//Update()
        public override void update()
        {
            CswNbtMetaDataObjectClass ContainerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.ContainerClass );
            CswNbtMetaDataObjectClassProp StorageTemperatureOCP = ContainerOC.getObjectClassProp( CswNbtObjClassContainer.PropertyName.StorageTemperature );
            _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue( StorageTemperatureOCP, string.Empty );
            CswNbtMetaDataObjectClassProp StoragePressureOCP = ContainerOC.getObjectClassProp( CswNbtObjClassContainer.PropertyName.StoragePressure );
            _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue( StoragePressureOCP, string.Empty );
            CswNbtMetaDataObjectClassProp UseTypeOCP = ContainerOC.getObjectClassProp( CswNbtObjClassContainer.PropertyName.UseType );
            _CswNbtSchemaModTrnsctn.MetaData.SetObjectClassPropDefaultValue( UseTypeOCP, string.Empty );

            foreach( CswNbtMetaDataNodeType ContainerNT  in ContainerOC.getNodeTypes())
            {
                CswNbtMetaDataNodeTypeProp StorageTemperatureNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( ContainerNT.NodeTypeId, CswNbtObjClassContainer.PropertyName.StorageTemperature );
                StorageTemperatureNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                CswNbtMetaDataNodeTypeProp StoragePressureNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( ContainerNT.NodeTypeId, CswNbtObjClassContainer.PropertyName.StoragePressure );
                StoragePressureNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                CswNbtMetaDataNodeTypeProp UseTypeNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( ContainerNT.NodeTypeId, CswNbtObjClassContainer.PropertyName.UseType );
                UseTypeNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                CswNbtMetaDataNodeTypeProp ContainerGroupNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( ContainerNT.NodeTypeId, CswNbtObjClassContainer.PropertyName.ContainerGroup );
                ContainerGroupNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }
        }//Update()
 public override void update()
 {
     CswNbtMetaDataNodeType InspectionScheduleNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypeFirstVersion( CswNbtObjClassGenerator.InspectionGeneratorNodeTypeName );
     if( null != InspectionScheduleNT )
     {
         CswNbtMetaDataNodeTypeTab SettingsTab = InspectionScheduleNT.getNodeTypeTab( "Settings" );
         if( null != SettingsTab )
         {
             _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeTab( SettingsTab );
         }
         CswNbtMetaDataNodeTypeProp SummaryNTP = InspectionScheduleNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.Summary );
         SummaryNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, InspectionScheduleNT.getIdentityTab().TabId );
         CswNbtMetaDataNodeTypeProp InspectionGroupNTP = InspectionScheduleNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.Owner );
         InspectionGroupNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, InspectionScheduleNT.getFirstNodeTypeTab().TabId, 1, 2 );
         CswNbtMetaDataNodeTypeProp InspectionTypeNTP = InspectionScheduleNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.TargetType );
         InspectionTypeNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, InspectionScheduleNT.getFirstNodeTypeTab().TabId, 2, 2 );             
         CswNbtMetaDataNodeTypeProp InspectionTargetTypeNTP = InspectionScheduleNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.ParentType );
         InspectionTargetTypeNTP.removeFromAllLayouts();
         CswNbtMetaDataNodeTypeProp InspectionTargetViewNTP = InspectionScheduleNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGenerator.PropertyName.ParentView );
         InspectionTargetViewNTP.removeFromAllLayouts();
     }
 } //Update()
        public override void update()
        {
            // Part 1: Set the sequence for the barcode property
            CswNbtMetaDataObjectClass UserOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.UserClass );

            foreach( CswNbtMetaDataNodeType UserOCNT in UserOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp barcodeNTP = UserOCNT.getNodeTypePropByObjectClassProp( CswNbtObjClassUser.PropertyName.Barcode );
                if( null != barcodeNTP )
                {
                    barcodeNTP.ReadOnly = true;

                    if( Int32.MinValue == barcodeNTP.SequenceId )
                    {
                        int userOCBarcodeSequenceId = _CswNbtSchemaModTrnsctn.makeSequence( new CswSequenceName( "User Barcode" ), "U", "", 6, 0 );
                        barcodeNTP.setSequence( userOCBarcodeSequenceId );
                    }

                    barcodeNTP.removeFromLayout( LayoutType: CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                }
            }

        } //Update()
        public override void update()
        {
            //Add an image prop to Inspection Designs
            CswNbtMetaDataObjectClass inspectionDesignOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.InspectionDesignClass );
            foreach( CswNbtMetaDataNodeType inspectionDesignNT in inspectionDesignOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeTab picturesTab = inspectionDesignNT.getNodeTypeTab( "Pictures" ) ??
                    _CswNbtSchemaModTrnsctn.MetaData.makeNewTabDeprecated( inspectionDesignNT, "Pictures", inspectionDesignNT.getMaximumTabOrder() + 1 );

                CswNbtMetaDataNodeTypeProp picturesProp = inspectionDesignNT.getNodeTypeProp( CswNbtObjClassInspectionDesign.PropertyName.Pictures );
                if( null == picturesProp )
                {
                    picturesProp = _CswNbtSchemaModTrnsctn.MetaData.makeNewPropDeprecated( inspectionDesignNT, CswEnumNbtFieldType.Image, CswNbtObjClassInspectionDesign.PropertyName.Pictures, picturesTab.TabId );
                }
                else
                {
                    _CswNbtSchemaModTrnsctn.MetaData.NodeTypeLayout.updatePropLayout( CswEnumNbtLayoutType.Edit, inspectionDesignNT.NodeTypeId, picturesProp, true, picturesTab.TabId );
                }

                picturesProp.MaxValue = 15;
                picturesProp.removeFromLayout( CswEnumNbtLayoutType.Add );
            }

        } // update()
Ejemplo n.º 28
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()
        public override void update()
        {
            // Jurisdiction Nodes
            CswNbtMetaDataObjectClass JurisdictionOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.JurisdictionClass );
            CswNbtMetaDataNodeType JurisdictionNT = JurisdictionOC.FirstNodeType;
            if( null != JurisdictionNT )
            {
                StringCollection Jurisdictions = new StringCollection { "North America", "China", "Europe", "Japan" };
                foreach( string j in Jurisdictions )
                {
                    CswNbtObjClassJurisdiction jNode = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( JurisdictionNT.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode );
                    jNode.Name.Text = j;
                    jNode.postChanges( false );
                }
            }


            //CswNbtMetaDataObjectClass GhsOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.GHSClass );
            //CswNbtMetaDataObjectClassProp GhsMaterialOCP = GhsOC.getObjectClassProp( CswNbtObjClassGHS.PropertyName.Material );
            //CswNbtMetaDataObjectClassProp GhsJurisdictionOCP = GhsOC.getObjectClassProp( CswNbtObjClassGHS.PropertyName.Jurisdiction );
            //CswNbtMetaDataObjectClassProp GhsLabelCodesOCP = GhsOC.getObjectClassProp( CswNbtObjClassGHS.PropertyName.LabelCodes );
            //CswNbtMetaDataObjectClassProp GhsSignalWordOCP = GhsOC.getObjectClassProp( CswNbtObjClassGHS.PropertyName.SignalWord );

            // Chemical GHS tab
            CswNbtMetaDataNodeType ChemicalNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Chemical" );
            if( null != ChemicalNT )
            {
                //CswNbtMetaDataNodeTypeTab ChemicalGhsTab = ChemicalNT.getNodeTypeTab( "GHS" ) ?? _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( ChemicalNT, "GHS", 3 );

                // Clear out old GHS tab
                _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeProp( ChemicalNT.getNodeTypeProp( "GHS Classification" ) );
                _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeProp( ChemicalNT.getNodeTypeProp( "GHS Class Codes" ) );
                _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeProp( ChemicalNT.getNodeTypeProp( "GHS Signal Word" ) );
                _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeProp( ChemicalNT.getNodeTypeProp( "GHS Label Codes" ) );
                _CswNbtSchemaModTrnsctn.MetaData.DeleteNodeTypeProp( ChemicalNT.getNodeTypeProp( "GHS Pictos" ) );

                //// Add a new grid
                //CswNbtMetaDataNodeTypeProp ChemicalGhsGridNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.Grid ), "GHS" ) );
                //CswNbtView ChemicalGhsGridView = _CswNbtSchemaModTrnsctn.restoreView( ChemicalGhsGridNTP.ViewId );
                //ChemicalGhsGridView.Root.ChildRelationships.Clear();
                //CswNbtViewRelationship ChemRel = ChemicalGhsGridView.AddViewRelationship( ChemicalNT, false );
                //CswNbtViewRelationship GhsRel = ChemicalGhsGridView.AddViewRelationship( ChemRel, NbtViewPropOwnerType.Second, GhsMaterialOCP, true );
                //CswNbtViewProperty JurisVP = ChemicalGhsGridView.AddViewProperty( GhsRel, GhsJurisdictionOCP );
                //CswNbtViewProperty SignalVP = ChemicalGhsGridView.AddViewProperty( GhsRel, GhsSignalWordOCP );
                //CswNbtViewProperty LabelVP = ChemicalGhsGridView.AddViewProperty( GhsRel, GhsLabelCodesOCP );
                //JurisVP.Order = 1;
                //SignalVP.Order = 2;
                //LabelVP.Order = 3;
                //ChemicalGhsGridView.save();

                //ChemicalGhsGridNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, ChemicalGhsTab.TabId );

            } // if(null != ChemicalNT)

            CswNbtMetaDataNodeType GhsNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "GHS" );
            if( null != GhsNT )
            {
                // Tabs
                CswNbtMetaDataNodeTypeTab GhsGhsTab = GhsNT.getNodeTypeTab( "GHS" ) ?? _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( GhsNT, "GHS", 1 );


                // Properties
                CswNbtMetaDataNodeTypeProp GhsJurisdictionNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.Jurisdiction );
                CswNbtMetaDataNodeTypeProp GhsMaterialNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.Material );
                CswNbtMetaDataNodeTypeProp GhsSignalWordNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.SignalWord );
                CswNbtMetaDataNodeTypeProp GhsLabelCodesNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.LabelCodes );
                CswNbtMetaDataNodeTypeProp GhsClassCodesNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.ClassCodes );
                CswNbtMetaDataNodeTypeProp GhsLabelCodesGridNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.LabelCodesGrid );
                CswNbtMetaDataNodeTypeProp GhsClassCodesGridNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.ClassCodesGrid );
                CswNbtMetaDataNodeTypeProp GhsPictogramsNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GhsNT, _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.ImageList ), "Pictograms" ) );
                CswNbtMetaDataNodeTypeProp GhsClassificationNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GhsNT, _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.List ), "Classification" ) );


                // Property Configuration
                GhsSignalWordNTP.ListOptions = "Danger,Warning";
                GhsSignalWordNTP.IsRequired = true;

                GhsMaterialNTP.IsRequired = true;
                GhsMaterialNTP.ReadOnly = true;
                
                GhsPictogramsNTP.Extended = "true";
                GhsPictogramsNTP.TextAreaColumns = 77;
                GhsPictogramsNTP.TextAreaRows = 77;
                CswDelimitedString PictoNames = new CswDelimitedString( '\n' ) { 
                    "Oxidizer",
                    "Flammable",
                    "Explosive",
                    "Acute Toxicity (severe)",
                    "Corrosive",
                    "Gases Under Pressure",
                    "Target Organ Toxicity",
                    "Environmental Toxicity",
                    "Irritant"
                };
                CswDelimitedString PictoPaths = new CswDelimitedString( '\n' ) { 
                    "Images/cispro/ghs/rondflam.jpg",
                    "Images/cispro/ghs/flamme.jpg",
                    "Images/cispro/ghs/explos.jpg",
                    "Images/cispro/ghs/skull.jpg",
                    "Images/cispro/ghs/acid.jpg",
                    "Images/cispro/ghs/bottle.jpg",
                    "Images/cispro/ghs/silhouet.jpg",
                    "Images/cispro/ghs/pollut.jpg",
                    "Images/cispro/ghs/exclam.jpg"
                };
                GhsPictogramsNTP.ListOptions = PictoNames.ToString();
                GhsPictogramsNTP.ValueOptions = PictoPaths.ToString();

                GhsLabelCodesGridNTP.Extended = CswNbtNodePropGrid.GridPropMode.Small.ToString();
                GhsLabelCodesGridNTP.MaxValue = 10;

                GhsClassCodesGridNTP.Extended = CswNbtNodePropGrid.GridPropMode.Small.ToString();
                GhsClassCodesGridNTP.MaxValue = 10;

                const string LabelingTabGroup = "Labeling";
                const string ClassificationTabGroup = "Classification";


                // Add Layout
                GhsMaterialNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 1, DisplayColumn: 1 );
                GhsJurisdictionNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 2, DisplayColumn: 1 );
                GhsSignalWordNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 3, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsPictogramsNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 4, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsLabelCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 5, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsClassificationNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 6, DisplayColumn: 1, TabGroup: ClassificationTabGroup );
                GhsClassCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add, true, DisplayRow: 7, DisplayColumn: 1, TabGroup: ClassificationTabGroup );
                GhsLabelCodesGridNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                GhsClassCodesGridNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );


                // Preview Layout
                GhsJurisdictionNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Preview, true, DisplayRow: 1, DisplayColumn: 1 );
                GhsSignalWordNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Preview, true, DisplayRow: 2, DisplayColumn: 1 );
                GhsPictogramsNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Preview, true, DisplayRow: 3, DisplayColumn: 1 );
                GhsLabelCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Preview, true, DisplayRow: 4, DisplayColumn: 1 );


                // Edit Layout
                GhsMaterialNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 1, DisplayColumn: 1 );
                GhsJurisdictionNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 2, DisplayColumn: 1 );
                GhsSignalWordNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 3, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsPictogramsNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 4, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsLabelCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 5, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsLabelCodesGridNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 6, DisplayColumn: 1, TabGroup: LabelingTabGroup );
                GhsClassificationNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 7, DisplayColumn: 1, TabGroup: ClassificationTabGroup );
                GhsClassCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 8, DisplayColumn: 1, TabGroup: ClassificationTabGroup );
                GhsClassCodesGridNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GhsGhsTab.TabId, DisplayRow: 9, DisplayColumn: 1, TabGroup: ClassificationTabGroup );


            } // if( null != GhsNT )



            //CswNbtMetaDataNodeType GhsPhraseNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "GHS Phrase" );
            //if( null != GhsPhraseNT )
            //{
            //    CswNbtMetaDataNodeTypeProp GhsPhraseCodeNTP = GhsPhraseNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHSPhrase.PropertyName.Code );
            //    CswNbtMetaDataNodeTypeProp GhsPhraseEnglishNTP = GhsPhraseNT.getNodeTypeProp( "English" );

            //    string NameTemplate = CswNbtMetaData.MakeTemplateEntry( GhsPhraseCodeNTP.PropName ) + " ";
            //    if(null != GhsPhraseEnglishNTP)
            //    {
            //        NameTemplate += CswNbtMetaData.MakeTemplateEntry( GhsPhraseEnglishNTP.PropName );
            //    }
            //    GhsPhraseNT.setNameTemplateText( NameTemplate );

            //    foreach(CswNbtNode Node in GhsPhraseNT.getNodes( false, false ))
            //    {
            //        Node.postChanges( true );
            //    }

            //} // if( null != GhsPhraseNT )

        } //Update()
Ejemplo n.º 30
0
        /// <summary>
        /// Update logic
        /// </summary>
        public override void update()
        {
            CswNbtMetaDataObjectClass requestItemOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtDoomedObjectClasses.RequestItemClass );
            CswNbtMetaDataNodeType requestItemNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Request Item" );

            #region PART 1 - BUTTON NAMING AND LIST OPTIONS

            //change materials Request button to a menu button
            CswNbtMetaDataObjectClass materialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MaterialClass );
            CswNbtMetaDataObjectClassProp requestOCP = materialOC.getObjectClassProp( CswNbtObjClassMaterial.PropertyName.Request );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( requestOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.extended, CswNbtNodePropButton.ButtonMode.menu );

            //change Material "request" prop on all material nodes to have the request by list options
            string opts = CswNbtObjClassRequestItem.RequestsBy.Options.ToString();
            foreach( CswNbtObjClassMaterial materialNode in materialOC.getNodes( false, false ) )
            {
                materialNode.Request.MenuOptions = opts;
                materialNode.Request.State = CswNbtObjClassRequestItem.RequestsBy.Size;
                materialNode.postChanges( false );
            }

            CswNbtMetaDataObjectClass containerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.ContainerClass );
            string fulFillOpts = CswNbtObjClassRequestItem.FulfillMenu.Options.ToString();
            foreach( CswNbtObjClassContainer containerNode in containerOC.getNodes( false, false ) )
            {
                containerNode.updateRequestMenu();
                containerNode.postChanges( false );
            }

            //change Request Items "Request By" prop to use the newly named list options
            CswNbtMetaDataObjectClassProp requestByOCP = requestItemOC.getObjectClassProp( CswNbtObjClassRequestItem.PropertyName.RequestBy );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( requestByOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.listoptions, opts );

            //make Request Items "request by" server managed
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( requestByOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.servermanaged, true );

            //remove the filters on "Count," "Size," and "Quantity" - these will now show/hide based on Materials "Request" button click
            CswNbtMetaDataObjectClassProp countOCP = requestItemOC.getObjectClassProp( CswNbtObjClassRequestItem.PropertyName.Count );
            CswNbtMetaDataObjectClassProp sizeOCP = requestItemOC.getObjectClassProp( CswNbtObjClassRequestItem.PropertyName.Size );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( countOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filter, "" );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( countOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filterpropid, "" );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( sizeOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filter, "" );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( sizeOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filterpropid, "" );

            CswNbtMetaDataObjectClassProp quantityOCP = requestItemOC.getObjectClassProp( CswNbtObjClassRequestItem.PropertyName.Quantity );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( quantityOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filter, "" );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( quantityOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filterpropid, "" );

            #endregion

            #region PART 2 - ADD NAME PROPERTY TO REQUEST ITEM

            // moved to RunBeforeEveryExecutionOfUpdater_01OC
            //CswNbtMetaDataObjectClassProp nameOCP = _CswNbtSchemaModTrnsctn.createObjectClassProp( new CswNbtWcfMetaDataModel.ObjectClassProp( requestItemOC )
            //{
            //    PropName = "Name",
            //    FieldType = CswNbtMetaDataFieldType.NbtFieldType.Text,
            //    ServerManaged = true
            //} );
            
            CswNbtMetaDataObjectClassProp nameOCP = requestItemOC.getObjectClassProp( CswNbtObjClassRequestItem.PropertyName.Name );

            string newNameTemplate = CswNbtMetaData.MakeTemplateEntry( CswNbtObjClassRequestItem.PropertyName.Name );
            if( null != requestItemNT )
            {
                requestItemNT.setNameTemplateText( newNameTemplate );
                CswNbtMetaDataNodeTypeProp nameNTP = _CswNbtSchemaModTrnsctn.MetaData.getNodeTypePropByObjectClassProp( requestItemNT.NodeTypeId, nameOCP.ObjectClassPropId );
                nameNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
            }

            #endregion

        }