Пример #1
0
        private string _makeRealKey(string InKey)
        {
            CswDelimitedString RealKey = new CswDelimitedString('_');

            RealKey.Add(InKey);
            RealKey.Add(_SessionId);
            return(RealKey.ToString());
        }
Пример #2
0
            public override string ToString()
            {
                CswDelimitedString DelimStr = new CswDelimitedString(_Delimiter);

                DelimStr.Add(Role.Name.Text);
                DelimStr.Add(NodeType.NodeTypeName);
                return(DelimStr.ToString());
            }
Пример #3
0
        public static string makeId(string Prefix, string ID, string Suffix)
        {
            CswDelimitedString ElementId = new CswDelimitedString(_Delimiter)
            {
                { Prefix, false }, { ID, false }, { Suffix, false }
            };

            return(ElementId.ToString(false));
        }
Пример #4
0
        public override string ToString()
        {
            CswDelimitedString delimstr = new CswDelimitedString(_delimiter);

            if (isSet())
            {
                delimstr[0] = _StringPrefix;
                delimstr[1] = _ViewId.ToString();
            }
            return(delimstr.ToString());
        }
Пример #5
0
 void _NodeCountPath_OnChange()
 {
     if (null != _NodeCountPath)
     {
         _DelimitedString[7] = _NodeCountPath.ToString();
     }
     else
     {
         _DelimitedString[7] = String.Empty;
     }
 }
Пример #6
0
        } // _runTreeNodesRecursive()

        public JObject getNode(string NodeId)
        {
            CswDelimitedString NodeStr = new CswDelimitedString('_');

            NodeStr.FromString(NodeId);
            if (NodeStr[0] == "nodeid")
            {
                NodeStr.RemoveAt(0);
            }
            string  NodePk = NodeStr.ToString();
            JObject Ret    = new JObject();

            Ret.Add(_getNode(NodePk, true));
            return(Ret);
        }
        public override void update()
        {
            CswNbtMetaDataObjectClass GhsOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.GHSClass );
            foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp GhsPictogramsNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.Pictograms );

                CswDelimitedString PictoPaths = new CswDelimitedString( '\n' )
                    {
                        "Images/cispro/ghs/512/rondflam.jpg",
                        "Images/cispro/ghs/512/flamme.jpg",
                        "Images/cispro/ghs/512/explos.jpg",
                        "Images/cispro/ghs/512/skull.jpg",
                        "Images/cispro/ghs/512/acid.jpg",
                        "Images/cispro/ghs/512/bottle.jpg",
                        "Images/cispro/ghs/512/silhouet.jpg",
                        "Images/cispro/ghs/512/pollut.jpg",
                        "Images/cispro/ghs/512/exclam.jpg"
                    };
                GhsPictogramsNTP.ValueOptions = PictoPaths.ToString();

                foreach( CswNbtObjClassGHS GhsNode in GhsNT.getNodes( false, true ) )
                {
                    if( GhsNode.Pictograms.Value.Contains( "/ghs/600/" ) )
                    {
                        GhsNode.Pictograms.Value.Replace( "/ghs/600/", "/ghs/512/" );
                    }
                    else
                    {
                        GhsNode.Pictograms.Value.Replace( "/ghs/", "/ghs/512/" );
                    }
                    GhsNode.postChanges( false );
                }
            } // foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )

        } // update()
Пример #8
0
        public static void getDemoDataGrid(ICswResources CswResources, CswNbtDemoDataReturn Return, object Request)
        {
            CswNbtResources CswNbtResources = (CswNbtResources)CswResources;



            //Build table infrastructure
            DataTable GridTable = new DataTable("demodatatable");

            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.NodeId, typeof(Int32));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.Name, typeof(string));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.Type, typeof(string));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.IsUsedBy, typeof(int));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.IsRequiredBy, typeof(int));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.ConvertToNonDemo, typeof(Boolean));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.Delete, typeof(Boolean));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.MenuOptions, typeof(string));


            _ColumnTypeOverrides.Clear();
            _ColumnTypeOverrides.Add(CswNbtDemoDataReturn.ColumnNames.IsUsedBy.ToString(), typeof(sbyte));
            _ColumnTypeOverrides.Add(CswNbtDemoDataReturn.ColumnNames.IsRequiredBy.ToString(), typeof(sbyte));

            //*****************************
            //Populate views
            string ViewQuery = @"select v.viewname, v.nodeviewid
                                  from node_views v
                                 where isdemo = '1'
                                   and visibility <> 'Property'
                                   and visibility <> 'Hidden'
                                 order by lower(viewname)";

            CswArbitrarySelect ArbitraryViewsSelect = CswNbtResources.makeCswArbitrarySelect("select_demo_nodes", ViewQuery);
            DataTable          DemoViewsTable       = ArbitraryViewsSelect.getTable();

            foreach (DataRow CurrentDemoViewRow in DemoViewsTable.Rows)
            {
                DataRow NewGridRowOfDemoViews = GridTable.NewRow();
                GridTable.Rows.Add(NewGridRowOfDemoViews);
                NewGridRowOfDemoViews[CswNbtDemoDataReturn.ColumnNames.NodeId]       = CurrentDemoViewRow["nodeviewid"].ToString();
                NewGridRowOfDemoViews[CswNbtDemoDataReturn.ColumnNames.Name]         = CurrentDemoViewRow["viewname"].ToString();
                NewGridRowOfDemoViews[CswNbtDemoDataReturn.ColumnNames.Type]         = "View";
                NewGridRowOfDemoViews[CswNbtDemoDataReturn.ColumnNames.IsUsedBy]     = 0;
                NewGridRowOfDemoViews[CswNbtDemoDataReturn.ColumnNames.IsRequiredBy] = 0;
            } //iterate demo views rows


            //*****************************
            //Populate views
            string NodesQuery = @"select n." + CswNbtDemoDataReturn.ColumnNames.NodeId + @",n.nodename,t.nodetypename, t.enabled
                                                from nodes n 
                                                join nodetypes t on (n.nodetypeid=t.nodetypeid )
                                                where n.isdemo = '1'
                                                order by lower( n.nodename ), lower( t.nodetypename )";



            CswArbitrarySelect ArbitraryNodesSelect = CswNbtResources.makeCswArbitrarySelect("select_demo_nodes", NodesQuery);
            DataTable          DemoNodesTable       = ArbitraryNodesSelect.getTable();

            foreach (DataRow CurrentDemoNodeRow in DemoNodesTable.Rows)
            {
                bool   NodeEnabled   = CswConvert.ToBoolean(CurrentDemoNodeRow["enabled"].ToString());
                String DisabledLabel = NodeEnabled ? "" : "(Disabled) ";

                DataRow NewGridRowOfNodes = GridTable.NewRow();
                GridTable.Rows.Add(NewGridRowOfNodes);
                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.NodeId] = CurrentDemoNodeRow["nodeid"].ToString();
                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.Name]   = CurrentDemoNodeRow["nodename"].ToString();
                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.Type]   = DisabledLabel + CurrentDemoNodeRow["nodetypename"].ToString();

                CswDelimitedString UsedByNodeIds = new CswDelimitedString(',');
                Int32 UsedByCount = 0;

                CswDelimitedString RequiredByNodeIds = new CswDelimitedString(',');
                Int32 RequiredByCount = 0;


                string nodeid             = CurrentDemoNodeRow["nodeid"].ToString();
                string node_used_by_query = @"select n." + CswNbtDemoDataReturn.ColumnNames.NodeId + @", n.nodename,t.nodetypename,n.isdemo, p.isrequired 
                                                from jct_nodes_props j 
                                                join nodetype_props p on (j.nodetypepropid=p.nodetypepropid)
                                                join field_types f on ( p.fieldtypeid = f.fieldtypeid )
                                                join nodes n on (j.nodeid=n.nodeid) 
                                                join nodetypes t on (n.nodetypeid=t.nodetypeid)
                                                where ( f.fieldtype='Relationship' or f.fieldtype='Location' )
                                                and j.field1_fk='" + nodeid + "'";

                CswArbitrarySelect ArbitraryUsedBySelect = CswNbtResources.makeCswArbitrarySelect("select_nodesusedby_nodeid_" + nodeid, node_used_by_query);
                DataTable          NodesUsedByTable      = ArbitraryUsedBySelect.getTable();


                foreach (DataRow CurrentUsedByRow in NodesUsedByTable.Rows)
                {
                    string CurrentNodeId = CurrentUsedByRow["nodeid"].ToString();
                    if (true == CswConvert.ToBoolean(CurrentUsedByRow["isrequired"].ToString()))
                    {
                        RequiredByNodeIds.Add(CurrentNodeId);
                        RequiredByCount++;
                    }
                    else
                    {
                        UsedByNodeIds.Add(CurrentNodeId);
                        UsedByCount++;
                    } //if-else it's required
                }     //iterate nodes used by rows


                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.MenuOptions]  = "{ \"requiredby\" : [" + RequiredByNodeIds.ToString() + "],\"usedby\" :[" + UsedByNodeIds.ToString() + "], \"nodename\": \" " + CurrentDemoNodeRow["nodename"].ToString() + "\" }";
                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.IsUsedBy]     = UsedByCount;
                NewGridRowOfNodes[CswNbtDemoDataReturn.ColumnNames.IsRequiredBy] = RequiredByCount;
            } //iterate node rows



            CswNbtGrid Grid = new CswNbtGrid(CswNbtResources);

            Return.Data.Grid = Grid.DataTableToGrid(GridTable, IncludeEditFields: false, ColumnTypeOverrides: _ColumnTypeOverrides);
        } //getDemoDataGrid()
Пример #9
0
        }//ToXml()

        public override string ToString()
        {
            return(_RootString.ToString());
        }
Пример #10
0
        public override void update()
        {
            // Add graphics to storage compatibility property on Materials.
            CswNbtMetaDataObjectClass MaterialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MaterialClass );
            CswNbtMetaDataObjectClassProp StorCompatOCP = MaterialOC.getObjectClassProp( CswNbtObjClassMaterial.StorageCompatibilityPropertyName );

            CswDelimitedString ImageNames = new CswDelimitedString( '\n' ) {
                "0 - None",
		        "1 - Inorganic Acids",
		        "2 - Organic Acids",
		        "3 - Bases",
		        "4 - Oxidizing Inorganic Acids",
		        "5 - Oxidizers",
		        "6 - Toxics",
		        "7 - Flammables"
            };

            CswDelimitedString ImageUrls = new CswDelimitedString( '\n' ) {
                "/NbtWebApp/Images/cispro/0w.gif",
                "/NbtWebApp/Images/cispro/1o.gif",
                "/NbtWebApp/Images/cispro/2y.gif",
                "/NbtWebApp/Images/cispro/3g.gif",
                "/NbtWebApp/Images/cispro/4b.gif",
                "/NbtWebApp/Images/cispro/5l.gif",
                "/NbtWebApp/Images/cispro/6p.gif",
                "/NbtWebApp/Images/cispro/7r.gif"
            };

            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( StorCompatOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.listoptions, ImageNames.ToString() );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( StorCompatOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.valueoptions, ImageUrls.ToString() );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( StorCompatOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.textarearows, 50 );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( StorCompatOCP, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.textareacols, 50 );

        }//Update()
Пример #11
0
        public override void update()
        {
            CswNbtMetaDataObjectClass GenericOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.GenericClass );
            CswNbtMetaDataObjectClass MaterialOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MaterialClass );

            CswNbtMetaDataFieldType TextFT = _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.Text );
            CswNbtMetaDataFieldType ListFT = _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.List );
            CswNbtMetaDataFieldType GridFT = _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.Grid );
            CswNbtMetaDataFieldType ImageListFT = _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.ImageList );
            CswNbtMetaDataFieldType RelationshipFT = _CswNbtSchemaModTrnsctn.MetaData.getFieldType( CswNbtMetaDataFieldType.NbtFieldType.Relationship );


            //// Jurisdiction NodeType
            //CswNbtMetaDataNodeType JurisdictionNT = _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeType( new CswNbtWcfMetaDataModel.NodeType( GenericOC )
            //{
            //    NodeTypeName = "Jurisdiction",
            //    Category = "System",
            //    IconFileName = "globe.gif"
            //} );
            //CswNbtMetaDataNodeTypeProp JurisdictionNameNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( JurisdictionNT, TextFT, "Name" ) );
            //JurisdictionNT.setNameTemplateText( CswNbtMetaData.MakeTemplateEntry( "Name" ) );

            //// Default Jurisdictions
            //CswNbtNode JurisNorthAmericaNode = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( JurisdictionNT.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode );
            //JurisNorthAmericaNode.Properties[JurisdictionNameNTP].AsText.Text = "North America";
            //JurisNorthAmericaNode.postChanges( false );

            //CswNbtNode JurisEuropeNode = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( JurisdictionNT.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode );
            //JurisEuropeNode.Properties[JurisdictionNameNTP].AsText.Text = "Europe";
            //JurisEuropeNode.postChanges( false );


            // GHS Phrase NodeType
            CswNbtMetaDataNodeType GHSPhraseNT = _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeType( new CswNbtWcfMetaDataModel.NodeType( GenericOC )
            {
                NodeTypeName = "GHS Phrase",
                Category = "System",
                IconFileName = "group.gif"
            } );
            CswNbtMetaDataNodeTypeProp GHSPhraseCodeNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "Code" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseCategoryNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, ListFT, "Category" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseEnglishNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "English" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseChineseNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "Chinese" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseDanishNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "Danish" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseDutchNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "Dutch" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseFrenchNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "French" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseGermanNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "German" ) );
            CswNbtMetaDataNodeTypeProp GHSPhraseSpanishNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSPhraseNT, TextFT, "Spanish" ) );
            GHSPhraseCategoryNTP.ListOptions = "Physical,Health,Environmental";
            GHSPhraseNT.setNameTemplateText( CswNbtMetaData.MakeTemplateEntry( "Code" ) );
            
            _CswNbtSchemaModTrnsctn.createModuleNodeTypeJunction( CswNbtResources.CswNbtModule.CISPro, GHSPhraseNT.NodeTypeId );
            
            // GHS NodeType
            CswNbtMetaDataNodeType GHSNT = _CswNbtSchemaModTrnsctn.MetaData.makeNewNodeType( new CswNbtWcfMetaDataModel.NodeType( GenericOC )
            {
                NodeTypeName = "GHS",
                Category = "Materials",
                IconFileName = "ball_redS.gif"
            } );
            CswNbtMetaDataNodeTypeProp GHSTypeNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSNT, ListFT, "Type" ) { IsRequired = true } );
            CswNbtMetaDataNodeTypeProp GHSMaterialNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSNT, RelationshipFT, "Material" ) { IsRequired = true } );
            CswNbtMetaDataNodeTypeProp GHSGHSPhraseNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSNT, RelationshipFT, "GHS Phrase" ) { IsRequired = true } );
            //CswNbtMetaDataNodeTypeProp GHSJurisdictionNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSNT, RelationshipFT, "Jurisdiction" ) { IsRequired = true } );
            CswNbtMetaDataNodeTypeProp GHSJurisdictionNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( GHSNT, ListFT, "Jurisdiction" ) { IsRequired = true } );

            GHSTypeNTP.ListOptions = "Class Code, Label Code";
            GHSMaterialNTP.SetFK( NbtViewRelatedIdType.ObjectClassId.ToString(), MaterialOC.ObjectClassId );
            GHSGHSPhraseNTP.SetFK( NbtViewRelatedIdType.NodeTypeId.ToString(), GHSPhraseNT.NodeTypeId );
            //GHSJurisdictionNTP.SetFK( NbtViewRelatedIdType.NodeTypeId.ToString(), JurisdictionNT.NodeTypeId );
            GHSJurisdictionNTP.ListOptions = "North America, China, Europe, Japan";
            
            _CswNbtSchemaModTrnsctn.createModuleNodeTypeJunction( CswNbtResources.CswNbtModule.CISPro, GHSNT.NodeTypeId );

            // Chemical GHS Tab
            CswNbtMetaDataNodeType ChemicalNT = _CswNbtSchemaModTrnsctn.MetaData.getNodeType( "Chemical" );
            if( null != ChemicalNT )
            {
                foreach( CswNbtMetaDataNodeTypeTab Tab in ChemicalNT.getNodeTypeTabs() )
                {
                    if( Tab.TabOrder >= 3 )
                        Tab.TabOrder += 1;
                }
                CswNbtMetaDataNodeTypeTab GHSTab = ChemicalNT.getNodeTypeTab( "GHS" );
                if( null == GHSTab )
                {
                    GHSTab = _CswNbtSchemaModTrnsctn.MetaData.makeNewTab( ChemicalNT, "GHS", 3 );
                }
                GHSTab.TabOrder = 3;

                // Chemical GHS properties
                CswNbtMetaDataNodeTypeProp ChemicalGHSClassificationNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, ListFT, "GHS Classification" ) );
                CswNbtMetaDataNodeTypeProp ChemicalGHSClassCodesNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, GridFT, "GHS Class Codes" ) );
                CswNbtMetaDataNodeTypeProp ChemicalGHSSignalWordNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, ListFT, "GHS Signal Word" ) );
                CswNbtMetaDataNodeTypeProp ChemicalGHSLabelCodesNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, GridFT, "GHS Label Codes" ) );
                CswNbtMetaDataNodeTypeProp ChemicalGHSPictosNTP = _CswNbtSchemaModTrnsctn.MetaData.makeNewProp( new CswNbtWcfMetaDataModel.NodeTypeProp( ChemicalNT, ImageListFT, "GHS Pictos" ) );

                CswCommaDelimitedString GHSClasses = new CswCommaDelimitedString(){
                    "Category 1",
                    "Category 1 / 1A / 1B",
                    "Category 1A",
                    "Category 1A / 1B",
                    "Category 1A / 1B / 1C",
                    "Category 1B",
                    "Category 2",
                    "Category 2 (skin)/2A (eye)",
                    "Category 2A",
                    "Category 2B",
                    "Category 3",
                    "Category 4",
                    "Category 5",
                    "Type A",
                    "Type B",
                    "Type C&D",
                    "Type E&F",
                    "Compressed Gas",
                    "Liquified Gas",
                    "Dissolved Gas",
                    "Refridgerated Liquidified Gas"
                };
                ChemicalGHSClassificationNTP.ListOptions = GHSClasses.ToString();
                ChemicalGHSSignalWordNTP.ListOptions = "Danger,Warning";

                ChemicalGHSClassificationNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                ChemicalGHSClassCodesNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                ChemicalGHSSignalWordNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                ChemicalGHSLabelCodesNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );
                ChemicalGHSPictosNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );

                ChemicalGHSClassificationNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GHSTab.TabId, 1, 1, "Hazard Classification" );
                ChemicalGHSClassCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GHSTab.TabId, 2, 1, "Hazard Classification" );
                ChemicalGHSSignalWordNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GHSTab.TabId, 3, 1, "Hazard Label" );
                ChemicalGHSLabelCodesNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GHSTab.TabId, 4, 1, "Hazard Label" );
                ChemicalGHSPictosNTP.updateLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Edit, true, GHSTab.TabId, 5, 1, "Hazard Label" );


                // Grid Views
                CswNbtView GHSClassCodesView = _CswNbtSchemaModTrnsctn.restoreView( ChemicalGHSClassCodesNTP.ViewId );
                GHSClassCodesView.Root.ChildRelationships.Clear();

                CswNbtViewRelationship ChemicalVR1 = GHSClassCodesView.AddViewRelationship( ChemicalNT, false );
                CswNbtViewRelationship GHSVR1 = GHSClassCodesView.AddViewRelationship( ChemicalVR1, NbtViewPropOwnerType.Second, GHSMaterialNTP, true );
                CswNbtViewRelationship GHSPhraseVR1 = GHSClassCodesView.AddViewRelationship( GHSVR1, NbtViewPropOwnerType.First, GHSGHSPhraseNTP, true );

                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseCodeNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseCategoryNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseEnglishNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseChineseNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseDanishNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseDutchNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseFrenchNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseGermanNTP );
                GHSClassCodesView.AddViewProperty( GHSPhraseVR1, GHSPhraseSpanishNTP );

                GHSClassCodesView.AddViewPropertyAndFilter( GHSVR1, GHSTypeNTP, Value: "Class Code" );
                GHSClassCodesView.AddViewPropertyAndFilter( GHSVR1, GHSJurisdictionNTP, Value: "North America", ShowAtRuntime: true );
                GHSClassCodesView.save();

                CswNbtView GHSLabelCodesView = _CswNbtSchemaModTrnsctn.restoreView( ChemicalGHSLabelCodesNTP.ViewId );
                GHSLabelCodesView.Root.ChildRelationships.Clear();

                CswNbtViewRelationship ChemicalVR2 = GHSLabelCodesView.AddViewRelationship( ChemicalNT, false );
                CswNbtViewRelationship GHSVR2 = GHSLabelCodesView.AddViewRelationship( ChemicalVR2, NbtViewPropOwnerType.Second, GHSMaterialNTP, true );
                CswNbtViewRelationship GHSPhraseVR2 = GHSLabelCodesView.AddViewRelationship( GHSVR2, NbtViewPropOwnerType.First, GHSGHSPhraseNTP, true );

                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseCodeNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseCategoryNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseEnglishNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseChineseNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseDanishNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseDutchNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseFrenchNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseGermanNTP );
                GHSLabelCodesView.AddViewProperty( GHSPhraseVR2, GHSPhraseSpanishNTP );

                GHSLabelCodesView.AddViewPropertyAndFilter( GHSVR2, GHSTypeNTP, Value: "Label Code" );
                GHSLabelCodesView.AddViewPropertyAndFilter( GHSVR2, GHSJurisdictionNTP, Value: "North America", ShowAtRuntime: true );
                GHSLabelCodesView.save();

                // Picto Options
                ChemicalGHSPictosNTP.Extended = "true"; // allow multiple values
                ChemicalGHSPictosNTP.TextAreaColumns = 100;
                ChemicalGHSPictosNTP.TextAreaRows = 100;

                CswDelimitedString PictoNames = new CswDelimitedString( '\n' ) { 
                    "Chemical",
                    "Explosive",
                    "Flammable",
                    "Natural",
                    "Oxidizer",
                    "Danger",
                    "X"
                };
                CswDelimitedString PictoPaths = new CswDelimitedString( '\n' ) { 
                    //"Images/cispro/1-1.gif",
                    //"Images/cispro/1-2.gif",
                    //"Images/cispro/1-3.gif",
                    //"Images/cispro/1-4.gif",
                    //"Images/cispro/1-5.gif",
                    //"Images/cispro/1-6.gif",
                    //"Images/cispro/5-2.gif",
                    "Images/cispro/acide.gif",
                    //"Images/cispro/acide2.gif",
                    //"Images/cispro/blan-red.gif",
                    //"Images/cispro/bleu4.gif",
                    //"Images/cispro/bleu4-noir.gif",
                    "Images/cispro/bottle.gif",
                    "Images/cispro/exclam.gif",
                    "Images/cispro/explos.gif",
                    "Images/cispro/flamme.gif",
                    //"Images/cispro/jaune5-1.gif",
                    "Images/cispro/pollu.gif",
                    "Images/cispro/rondflam.gif",
                    //"Images/cispro/rouge2.gif",
                    //"Images/cispro/rouge2_noir.gif",
                    //"Images/cispro/rouge3.gif",
                    //"Images/cispro/rouge3_noir.gif",
                    "Images/cispro/silouete.gif",
                    "Images/cispro/skull.gif"
                    //"Images/cispro/skull_2.gif",
                    //"Images/cispro/skull6.gif",
                    //"Images/cispro/stripes.gif",
                    //"Images/cispro/vert.gif"
                };
                ChemicalGHSPictosNTP.ListOptions = PictoNames.ToString();
                ChemicalGHSPictosNTP.ValueOptions = PictoPaths.ToString();
            }

            //GHS Phrase nodes
            Dictionary<Int32, string> GHSPhraseCodes = new Dictionary<Int32, string>();
            //Physical
            GHSPhraseCodes.Add( 200, "Unstable explosive" );
            GHSPhraseCodes.Add( 201, "Explosive; mass explosion hazard" );
            GHSPhraseCodes.Add( 202, "Explosive; severe projection hazard" );
            GHSPhraseCodes.Add( 203, "Explosive; fire, blast or projection hazard" );
            GHSPhraseCodes.Add( 204, "Fire or projection hazard" );
            GHSPhraseCodes.Add( 205, "May mass explode in fire" );
            GHSPhraseCodes.Add( 220, "Extremely flammable gas" );
            GHSPhraseCodes.Add( 221, "Flammable gas" );
            GHSPhraseCodes.Add( 222, "Extremely flammable material" );
            GHSPhraseCodes.Add( 223, "Flammable material" );
            GHSPhraseCodes.Add( 224, "Extremely flammable liquid and vapour" );
            GHSPhraseCodes.Add( 225, "Highly flammable liquid and vapour" );
            GHSPhraseCodes.Add( 226, "Flammable liquid and vapour" );
            GHSPhraseCodes.Add( 227, "Combustible liquid" );
            GHSPhraseCodes.Add( 228, "Flammable solid" );
            GHSPhraseCodes.Add( 240, "Heating may cause an explosion" );
            GHSPhraseCodes.Add( 241, "Heating may cause a fire or explosion" );
            GHSPhraseCodes.Add( 242, "Heating may cause a fire" );
            GHSPhraseCodes.Add( 250, "Catches fire spontaneously if exposed to air" );
            GHSPhraseCodes.Add( 251, "Self-heating; may catch fire" );
            GHSPhraseCodes.Add( 252, "Self-heating in large quantities; may catch fire" );
            GHSPhraseCodes.Add( 260, "In contact with water releases flammable gases which may ignite spontaneously" );
            GHSPhraseCodes.Add( 261, "In contact with water releases flammable gas" );
            GHSPhraseCodes.Add( 270, "May cause or intensify fire; oxidizer" );
            GHSPhraseCodes.Add( 271, "May cause fire or explosion; strong oxidizer" );
            GHSPhraseCodes.Add( 272, "May intensify fire; oxidizer" );
            GHSPhraseCodes.Add( 280, "Contains gas under pressure; may explode if heated" );
            GHSPhraseCodes.Add( 281, "Contains refrigerated gas; may cause cryogenic burns or injury" );
            GHSPhraseCodes.Add( 290, "May be corrosive to metals" );
            //Health
            GHSPhraseCodes.Add( 300, "Fatal if swallowed" );
            GHSPhraseCodes.Add( 301, "Toxic if swallowed" );
            GHSPhraseCodes.Add( 302, "Harmful if swallowed" );
            GHSPhraseCodes.Add( 303, "May be harmful if swallowed" );
            GHSPhraseCodes.Add( 304, "May be fatal if swallowed and enters airways" );
            GHSPhraseCodes.Add( 305, "May be harmful if swallowed and enters airways" );
            GHSPhraseCodes.Add( 310, "Fatal in contact with skin" );
            GHSPhraseCodes.Add( 311, "Toxic in contact with skin" );
            GHSPhraseCodes.Add( 312, "Harmful in contact with skin" );
            GHSPhraseCodes.Add( 313, "May be harmful in contact with skin" );
            GHSPhraseCodes.Add( 314, "Causes severe skin burns and eye damage" );
            GHSPhraseCodes.Add( 315, "Causes skin irritation" );
            GHSPhraseCodes.Add( 316, "Causes mild skin irritation" );
            GHSPhraseCodes.Add( 317, "May cause an allergic skin reaction" );
            GHSPhraseCodes.Add( 318, "Causes serious eye damage" );
            GHSPhraseCodes.Add( 319, "Causes serious eye irritation" );
            GHSPhraseCodes.Add( 320, "Causes eye irritation" );
            GHSPhraseCodes.Add( 330, "Fatal if inhaled" );
            GHSPhraseCodes.Add( 331, "Toxic if inhaled" );
            GHSPhraseCodes.Add( 332, "Harmful if inhaled" );
            GHSPhraseCodes.Add( 333, "May be harmful if inhaled" );
            GHSPhraseCodes.Add( 334, "May cause allergy or asthma symptoms of breathing difficulties if inhaled" );
            GHSPhraseCodes.Add( 335, "May cause respiratory irritation" );
            GHSPhraseCodes.Add( 336, "May cause drowsiness or dizziness" );
            GHSPhraseCodes.Add( 340, "May cause genetic defects" );
            GHSPhraseCodes.Add( 341, "Suspected of causing genetic defects" );
            GHSPhraseCodes.Add( 350, "May cause cancer" );
            GHSPhraseCodes.Add( 351, "Suspected of causing cancer" );
            GHSPhraseCodes.Add( 360, "May damage fertility or the unborn child" );
            GHSPhraseCodes.Add( 361, "Suspected of damaging fertility or the unborn child" );
            GHSPhraseCodes.Add( 362, "May cause harm to breast-fed children" );
            GHSPhraseCodes.Add( 370, "Causes damage to organs" );
            GHSPhraseCodes.Add( 371, "May cause damage to organs" );
            GHSPhraseCodes.Add( 372, "Causes damage to organs through prolonged or repeated exposure" );
            GHSPhraseCodes.Add( 373, "May cause damage to organs through prolonged or repeated exposure" );
            // Environmental
            GHSPhraseCodes.Add( 400, "Very toxic to aquatic life" );
            GHSPhraseCodes.Add( 401, "Toxic to aquatic life" );
            GHSPhraseCodes.Add( 402, "Harmful to aquatic life" );
            GHSPhraseCodes.Add( 410, "Very toxic to aquatic life with long lasting effects" );
            GHSPhraseCodes.Add( 411, "Toxic to aquatic life with long lasting effects" );
            GHSPhraseCodes.Add( 412, "Harmful to aquatic life with long lasting effects" );
            GHSPhraseCodes.Add( 413, "May cause long lasting harmful effects to aquatic life" );

            foreach( Int32 Code in GHSPhraseCodes.Keys )
            {
                string Category = "Physical";
                if( Code > 299 )
                {
                    Category = "Health";
                }
                else if( Code > 399 )
                {
                    Category = "Environmental";
                }

                CswNbtNode GHSPhraseNode = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( GHSPhraseNT.NodeTypeId, CswNbtNodeCollection.MakeNodeOperation.WriteNode );
                GHSPhraseNode.Properties[GHSPhraseCodeNTP].AsText.Text = "H" + Code.ToString();
                GHSPhraseNode.Properties[GHSPhraseCategoryNTP].AsList.Value = Category;
                GHSPhraseNode.Properties[GHSPhraseEnglishNTP].AsText.Text = GHSPhraseCodes[Code];
                GHSPhraseNode.postChanges( false );
            } // foreach( Int32 Code in GHSPhraseCodes.Keys )

        }//Update()
Пример #12
0
 public CswNbtViewRoot(CswNbtResources CswNbtResources, CswNbtView View, CswDelimitedString RootString)
     : base(CswNbtResources, View)
 {
     _RootString           = RootString;
     _RootString.OnChange += new CswDelimitedString.DelimitedStringChangeHandler(_RootString_OnChange);
     if (ViewNodeType != CswEnumNbtViewNodeType.CswNbtViewRoot)
     {
         throw new CswDniException(CswEnumErrorType.Error, "Invalid View Root", "CswNbtViewRoot was given an invalid RootString: " + RootString.ToString());
     }
 }
Пример #13
0
        public override void update()
        {

            // add some objclass calls
            CswNbtMetaDataObjectClassProp locCodeOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.LocationClass, "Location Code",
                CswNbtMetaDataFieldType.NbtFieldType.Text, IsUnique: true );
            CswNbtMetaDataObjectClassProp allowInvOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.LocationClass, "Allow Inventory",
                CswNbtMetaDataFieldType.NbtFieldType.Logical );
            CswNbtMetaDataObjectClassProp storCompatOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp( CswNbtMetaDataObjectClass.NbtObjectClass.LocationClass, "Storage Compatability",
                CswNbtMetaDataFieldType.NbtFieldType.ImageList );
            CswDelimitedString listOpts = new CswDelimitedString( '\n' );
            listOpts.FromArray( new string[] { "None", "Inorganic Acids", "Organic Acids", 
                "Bases", "Oxidizing Inorganic Acids",
                "Oxidizers", "Toxics", "Flammables" } );
            //            storCompatOcp.ListOptions = listOpts.ToString();
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( storCompatOcp, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.listoptions, listOpts.ToString() );
            CswDelimitedString valOpts = new CswDelimitedString( '\n' );
            valOpts.FromArray( new string[] { "Images/cispro/0w.gif", "Images/cispro/1o.gif", "Images/cispro/2y.gif", 
                "Images/cispro/3g.gif", "Images/cispro/4b.gif", 
                "Images/cispro/5l.gif", "Images/cispro/6p.gif", "Images/cispro/7r.gif" } );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( storCompatOcp, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.valueoptions, valOpts.ToString() );

            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( storCompatOcp, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.textarearows, "32" );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( storCompatOcp, CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.textareacols, "32" );

        }//Update()
Пример #14
0
        public override void update()
        {
            #region Create DSD Phrase OC

            CswNbtMetaDataObjectClass DSDPhraseOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.DSDPhraseClass );
            if( null == DSDPhraseOC )
            {
                DSDPhraseOC = _CswNbtSchemaModTrnsctn.createObjectClass( CswEnumNbtObjectClass.DSDPhraseClass, "warning.png", false );

                _CswNbtSchemaModTrnsctn.createObjectClassProp( DSDPhraseOC, new CswNbtWcfMetaDataModel.ObjectClassProp( DSDPhraseOC )
                    {
                        PropName = CswNbtObjClassDSDPhrase.PropertyName.Code,
                        FieldType = CswEnumNbtFieldType.Text
                    } );

                _CswNbtSchemaModTrnsctn.createObjectClassProp( DSDPhraseOC, new CswNbtWcfMetaDataModel.ObjectClassProp( DSDPhraseOC )
                    {
                        PropName = CswNbtObjClassDSDPhrase.PropertyName.Category,
                        FieldType = CswEnumNbtFieldType.List,
                        ListOptions = "Risk,Safety,Hazard"
                    } );

                foreach( string Language in CswNbtPropertySetPhrase.SupportedLanguages.All )
                {
                    _CswNbtSchemaModTrnsctn.createObjectClassProp( DSDPhraseOC, new CswNbtWcfMetaDataModel.ObjectClassProp( DSDPhraseOC )
                        {
                            PropName = Language,
                            FieldType = CswEnumNbtFieldType.Text
                        } );
                }

            }

            #endregion

            #region Create DSD Chemical Props

            CswNbtMetaDataObjectClass ChemicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ChemicalClass );

            const string _pre = "Images/cispro/DSD/";
            CswDelimitedString dsdImgs = new CswDelimitedString( '\n' )
                {
                    _pre + "none.gif",
                    _pre + "e.gif",
                    _pre + "o.gif",
                    _pre + "f.gif",
                    _pre + "f_plus.gif",
                    _pre + "t.gif",
                    _pre + "t_plus.gif",
                    _pre + "xn.gif",
                    _pre + "xi.gif",
                    _pre + "c.gif",
                    _pre + "n.gif"
                };

            CswDelimitedString dsdValues = new CswDelimitedString( '\n' )
                {
                    "None","Explosive","Oxidizing","Highly flammable","Extremely flammable","Toxic","Very Toxic","Harmful","Irritant","Corrosive","Dangerous for the environment"
                };

            CswNbtMetaDataObjectClassProp PictorgramsOCP = ChemicalOC.getObjectClassProp( CswNbtObjClassChemical.PropertyName.Pictograms ) ??
                _CswNbtSchemaModTrnsctn.createObjectClassProp( ChemicalOC, new CswNbtWcfMetaDataModel.ObjectClassProp( ChemicalOC )
                    {
                        PropName = CswNbtObjClassChemical.PropertyName.Pictograms,
                        FieldType = CswEnumNbtFieldType.ImageList,
                        ListOptions = dsdValues.ToString(),
                        ValueOptions = dsdImgs.ToString(),
                        Extended = true.ToString()
                    } );

            CswNbtMetaDataObjectClassProp LabelCodesOCP = ChemicalOC.getObjectClassProp( CswNbtObjClassChemical.PropertyName.LabelCodes ) ??
                _CswNbtSchemaModTrnsctn.createObjectClassProp( ChemicalOC, new CswNbtWcfMetaDataModel.ObjectClassProp( ChemicalOC )
                    {
                        PropName = CswNbtObjClassChemical.PropertyName.LabelCodes,
                        FieldType = CswEnumNbtFieldType.MultiList,
                        ListOptions = "" //Intentionally empty - will be dynamic
                    } );

            CswNbtView DSDLabelCodesView = _CswNbtSchemaModTrnsctn.makeSafeView( "DSD Label Codes Property Grid", CswEnumNbtViewVisibility.Hidden );
            DSDLabelCodesView.SetViewMode( CswEnumNbtViewRenderingMode.Grid );
            DSDLabelCodesView.AddViewRelationship( DSDPhraseOC, false );
            DSDLabelCodesView.save();

            CswNbtMetaDataObjectClassProp LabelCodesGridOCP = ChemicalOC.getObjectClassProp( CswNbtObjClassChemical.PropertyName.LabelCodesGrid ) ??
                _CswNbtSchemaModTrnsctn.createObjectClassProp( ChemicalOC, new CswNbtWcfMetaDataModel.ObjectClassProp( ChemicalOC )
                {
                    PropName = CswNbtObjClassChemical.PropertyName.LabelCodesGrid,
                    FieldType = CswEnumNbtFieldType.Grid,
                    ViewXml = DSDLabelCodesView.ToString(),
                    Extended = "Small"
                } );

            #endregion

        } // update()
Пример #15
0
 /// <summary>
 /// Convert the NodeKey information into a delimited string
 /// </summary>
 public override string ToString()
 {
     return(_DelimitedString.ToString());
 }
Пример #16
0
        public override void update()
        {
            // Fix graphics URLs for Storage Compatibility (remove "/NbtWebApp")

            CswDelimitedString ImageUrls = new CswDelimitedString( '\n' )
                {
                    "Images/cispro/0w.gif",
                    "Images/cispro/1o.gif",
                    "Images/cispro/2y.gif",
                    "Images/cispro/3g.gif",
                    "Images/cispro/4b.gif",
                    "Images/cispro/5l.gif",
                    "Images/cispro/6p.gif",
                    "Images/cispro/7r.gif"
                };

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

            CswNbtMetaDataObjectClassProp ChemStorCompatOCP = ChemicalOC.getObjectClassProp( CswNbtObjClassChemical.PropertyName.StorageCompatibility );
            CswNbtMetaDataObjectClassProp LocStorCompatOCP = LocationOC.getObjectClassProp( CswNbtObjClassLocation.PropertyName.StorageCompatibility );

            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( ChemStorCompatOCP, CswEnumNbtObjectClassPropAttributes.valueoptions, ImageUrls.ToString() );
            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( LocStorCompatOCP, CswEnumNbtObjectClassPropAttributes.valueoptions, ImageUrls.ToString() );

        }//Update()
Пример #17
0
        public override void update()
        {
            // Fix DSD Picto Paths
            CswNbtMetaDataObjectClass ChemicalOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ChemicalClass );
            foreach( CswNbtMetaDataNodeType ChemicalNT in ChemicalOC.getNodeTypes() )
            {

                CswDelimitedString PictoPaths = new CswDelimitedString( '\n' )
                    {
                        "Images/cispro/DSD/512/none.gif",
                        "Images/cispro/DSD/512/e.gif",
                        "Images/cispro/DSD/512/o.gif",
                        "Images/cispro/DSD/512/f.gif",
                        "Images/cispro/DSD/512/f_plus.gif",
                        "Images/cispro/DSD/512/t.gif",
                        "Images/cispro/DSD/512/t_plus.gif",
                        "Images/cispro/DSD/512/xn.gif",
                        "Images/cispro/DSD/512/xi.gif",
                        "Images/cispro/DSD/512/c.gif",
                        "Images/cispro/DSD/512/n.gif"
                    };
                CswNbtMetaDataNodeTypeProp PictogramsNTP = ChemicalNT.getNodeTypePropByObjectClassProp( CswNbtObjClassChemical.PropertyName.Pictograms );
                PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.ImageUrls].AsMemo.Text = PictoPaths.ToString();
                PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.HeightInPixels].AsNumber.Value = 77;
                PictogramsNTP.DesignNode.AttributeProperty[CswNbtFieldTypeRuleImageList.AttributeName.WidthInPixels].AsNumber.Value = 77;
                PictogramsNTP.DesignNode.postChanges( false );

                foreach( CswNbtObjClassChemical ChemicalNode in ChemicalNT.getNodes( false, true ) )
                {
                    CswDelimitedString oldVals = ChemicalNode.Pictograms.Value;
                    CswDelimitedString newVals = new CswDelimitedString( CswNbtNodePropImageList.Delimiter );
                    foreach( string oldVal in oldVals )
                    {
                        if( oldVal.IndexOf( "/DSD/" ) >= 0 && oldVal.IndexOf( "/DSD/512" ) == 0 )
                        {
                            newVals.Add( oldVal.Replace( "/DSD/", "/DSD/512/" ) );
                        }
                        else
                        {
                            newVals.Add( oldVal );
                        }
                    }
                    ChemicalNode.Pictograms.Value = newVals;
                    ChemicalNode.postChanges( false );
                } // foreach( CswNbtObjClassChemical ChemicalNode in ChemicalNT.getNodes( false, true ) )
            } // foreach( CswNbtMetaDataNodeType ChemicalNT in ChemicalOC.getNodeTypes() )

            // Example DSD Print Label
            CswNbtMetaDataObjectClass ContainerOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.ContainerClass );
            CswNbtMetaDataObjectClass PrintLabelOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.PrintLabelClass );
            if( null != PrintLabelOC )
            {
                CswNbtMetaDataNodeType PrintLabelNT = PrintLabelOC.FirstNodeType;
                if( null != PrintLabelNT )
                {
                    CswNbtObjClassPrintLabel DsdLabel = _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( PrintLabelNT.NodeTypeId );
                    DsdLabel.LabelName.Text = "Example DSD Label";
                    if( null != ContainerOC )
                    {
                        foreach(CswNbtMetaDataNodeType ContainerNT in ContainerOC.getNodeTypes())
                        {
                            DsdLabel.NodeTypes.SelectedNodeTypeIds.Add( ContainerNT.NodeTypeId.ToString() );
                        }
                    }
                    DsdLabel.EplText.Text = @"I8,0,001
S2
OD
JF
WN
D12
ZB
q375
N
A25,15,0,2,1,1,N,""{Material}""
B25,45,0,1,3,6,40,N,""{Barcode}""
A25,80,0,2,1,1,N,""{Barcode}""
A25,130,0,2,1,1,N,""{NBTDSDB}""
GW0,160,{NBTDSDPICTOS}
GW128,160,{NBTDSDPICTOS_2}
GW256,160,{NBTDSDPICTOS_3}
P1";
                    DsdLabel.postChanges( false );
                }
            }


        } // update()
Пример #18
0
        } //getDemoDataGrid()

        public static void getDemoDataNodesAsGrid(ICswResources CswResources, CswNbtDemoDataReturn Return, CswNbtDemoDataRequests.CswDemoNodesGridRequest Request)
        {
            CswNbtResources CswNbtResources = (CswNbtResources)CswResources;

            //Build table infrastructure
            DataTable GridTable = new DataTable("depdendentnodestable");

            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.NodeId, typeof(Int32));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.Name, typeof(string));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.Type, typeof(string));
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.IsDemo, typeof(string));
            //            GridTable.Columns.Add( CswNbtDemoDataReturn.ColumnNames.Action, typeof( sbyte ) );
            GridTable.Columns.Add(CswNbtDemoDataReturn.ColumnNames.MenuOptions, typeof(string));


            string DependentNodesQuery = "select n.nodeid, t.nodetypeid, n.nodename as \"name\" ,n.isdemo \"Is Demo\", t.nodetypename as \"type\" ";

            DependentNodesQuery += "from nodes n ";
            DependentNodesQuery += "join nodetypes t on (n.nodetypeid=t.nodetypeid) ";



            //We have to cope with oracle's limit of 1000 on lists
            //as per case 29811
            DependentNodesQuery += " where ";
            List <string> AllNodeIds        = Request.NodeIds;
            int           NumberoFInClauses = (AllNodeIds.Count / 1000) + 1; //we _only_ want the whole-number result here

            for (int idx = 0; idx < NumberoFInClauses; idx++)
            {
                if (idx > 0)
                {
                    DependentNodesQuery += " or ";
                }

                List <string> CurrentList = null;
                if (AllNodeIds.Count > 1000)
                {
                    CurrentList = AllNodeIds.GetRange(0, 1000);
                    AllNodeIds.RemoveRange(0, 1000);
                }
                else
                {
                    CurrentList = AllNodeIds;
                }

                CswDelimitedString DepdendentNodeIds = new CswDelimitedString(',');
                DepdendentNodeIds.FromArray(CurrentList.ToArray());
                DependentNodesQuery += " n.nodeid in (" + DepdendentNodeIds.ToString() + ") ";
            }



            DependentNodesQuery += "order by lower(n.nodename), lower(t.nodetypename)";

            CswArbitrarySelect DependentNodesSelect      = CswNbtResources.makeCswArbitrarySelect("select_depdendent_nodes", DependentNodesQuery);
            DataTable          DepdendentNodesTableTable = DependentNodesSelect.getTable();

            foreach (DataRow CurrentDependentNodeRow in DepdendentNodesTableTable.Rows)
            {
                DataRow NewGridRowOfDependentNodes = GridTable.NewRow();
                GridTable.Rows.Add(NewGridRowOfDependentNodes);

                NewGridRowOfDependentNodes[CswNbtDemoDataReturn.ColumnNames.NodeId] = CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.NodeId];
                NewGridRowOfDependentNodes[CswNbtDemoDataReturn.ColumnNames.Name]   = CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.Name];
                NewGridRowOfDependentNodes[CswNbtDemoDataReturn.ColumnNames.Type]   = CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.Type];
                NewGridRowOfDependentNodes[CswNbtDemoDataReturn.ColumnNames.IsDemo] = ("1" == CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.IsDemo].ToString()) ? "yes" : "no";

                CswPrimaryKey cswPrimaryKey = new CswPrimaryKey();
                cswPrimaryKey.FromString("nodes_" + CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.NodeId].ToString());
                CswNbtNodeKey CswNbtNodeKey = new CswNbtNodeKey();
                CswNbtNodeKey.NodeId     = cswPrimaryKey;
                CswNbtNodeKey.NodeTypeId = CswConvert.ToInt32(CurrentDependentNodeRow["nodetypeid"]);


                string menu_options = "{ ";
                menu_options += "\"nodeid\" : \"nodes_" + CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.NodeId].ToString() + "\",";
                menu_options += "\"nodename\" : \" " + CurrentDependentNodeRow[CswNbtDemoDataReturn.ColumnNames.Name].ToString() + "\",";
                menu_options += "\"nodekey\" : \" " + CswNbtNodeKey.ToString() + "\"";
                menu_options += " }";


                NewGridRowOfDependentNodes[CswNbtDemoDataReturn.ColumnNames.MenuOptions] = menu_options;
            }//iterate result rows

            CswNbtGrid Grid = new CswNbtGrid(CswNbtResources);

            Return.Data.Grid = Grid.DataTableToGrid(GridTable, IncludeEditFields: false);
        }//getDemoDataNodesAsGrid()
Пример #19
0
        public override void SyncGestalt()
        {
            CswDelimitedString NewGestalt = new CswDelimitedString(Delimiter);

            foreach (string Key in Value)
            {
                if (Options.ContainsKey(Key))
                {
                    NewGestalt.Add(Options[Key]);
                }
            }
            SetPropRowValue(CswEnumNbtSubFieldName.Gestalt, CswEnumNbtPropColumn.Gestalt, NewGestalt.ToString());
        } // _setGestalt()
        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()
Пример #21
0
 public static CswNbtViewNode makeViewNode( CswNbtResources CswNbtResources, CswNbtView View, CswDelimitedString ViewNodeString )
 {
     CswNbtViewNode newNode = null;
     CswEnumNbtViewNodeType type = (CswEnumNbtViewNodeType) ViewNodeString[0];
     if( type == CswEnumNbtViewNodeType.CswNbtViewRelationship )
     {
         newNode = new CswNbtViewRelationship( CswNbtResources, View, ViewNodeString );
     }
     else if( type == CswEnumNbtViewNodeType.CswNbtViewProperty )
     {
         newNode = new CswNbtViewProperty( CswNbtResources, View, ViewNodeString );
     }
     else if( type == CswEnumNbtViewNodeType.CswNbtViewPropertyFilter )
     {
         newNode = new CswNbtViewPropertyFilter( CswNbtResources, View, ViewNodeString );
     }
     else if( type == CswEnumNbtViewNodeType.CswNbtViewRoot )
     {
         newNode = new CswNbtViewRoot( CswNbtResources, View, ViewNodeString );
     }
     else
     {
         throw new CswDniException( CswEnumErrorType.Error, "Invalid ViewNode", "CswNbtViewNode.makeViewNode() got an invalid ViewNodeString: " + ViewNodeString.ToString() );
     }
     return newNode;
 } // makeViewNode()