} // update()

        private void _addGHSPhrase( String Code, String English )
        {
            _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( GHSPhraseNT.NodeTypeId, delegate( CswNbtNode NewNode )
                {
                    CswNbtObjClassGHSPhrase GHSPhraseNode = NewNode;
                    GHSPhraseNode.Code.Text = Code;
                    GHSPhraseNode.Category.Value = "Precaution";
                    GHSPhraseNode.English.Text = English;
                } );
        } // _addGHSPhrase
Пример #2
0
        private void _handleData( DataTable Tbl, int LanguageRow, int MaxRows, Dictionary<string, CswNbtObjClassGHSPhrase> GHSPhrases, int GHSPhraseNTId )
        {
            DataRow LangRow = Tbl.Rows[LanguageRow];
            for( int i = LanguageRow + 1; i <= MaxRows; i++ )
            {
                DataRow HazardsRow = Tbl.Rows[i];

                string code = HazardsRow[0].ToString();

                if( GHSPhrases.ContainsKey( code ) )
                {
                    CswNbtObjClassGHSPhrase GHSPhrase = GHSPhrases[code];
                    for( int c = 1; c <= 23; c++ )
                    {
                        string Language = LanguageCodeMap[LangRow[c].ToString().Trim()];
                        string LanguageText = HazardsRow[c].ToString();
                        GHSPhrase.Node.Properties[Language].AsText.Text = LanguageText;
                        GHSPhrase.postChanges( false );
                    }
                }
                else
                {
                    _CswNbtSchemaModTrnsctn.Nodes.makeNodeFromNodeTypeId( GHSPhraseNTId, delegate( CswNbtNode NewNode )
                    {
                        CswNbtObjClassGHSPhrase NodeAsGHSPhrase = NewNode;
                        NodeAsGHSPhrase.Code.Text = code;
                        for( int c = 1; c <= 23; c++ )
                        {
                            string Language = LanguageCodeMap[LangRow[c].ToString().Trim()];
                            string LanguageText = HazardsRow[c].ToString();
                            NodeAsGHSPhrase.Node.Properties[Language].AsText.Text = LanguageText;
                        }
                    } );
                }
            }
        }