Exemple #1
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="items"></param>
        /// <param name="abort"></param>
        /// <returns></returns>
        /// <created>UPh,01.11.2015</created>
        /// <changed>UPh,01.11.2015</changed>
        // ********************************************************************************
        internal override void GetTermList(TermListItems items, IAbortTermQuery abort, bool bTargetLanguage)
        {
            if (_DataBase == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(_LangAttribute1))
            {
                return;
            }

            try
            {
                string langattribute;
                if (bTargetLanguage)
                {
                    langattribute = _LangAttribute2;
                }
                else
                {
                    langattribute = _LangAttribute1;
                }

                string sql = string.Format("SELECT origterm,conceptid FROM {0}", "I_" + langattribute);

                using (OleDbCommand cmd = new OleDbCommand(sql, _DataBase))
                {
                    //cmd.Parameters.AddWithValue("@langtable", "I_" + _LangAttribute1);

                    using (OleDbDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            try
                            {
                                string term   = reader[0].ToString();
                                int    termID = reader.GetInt32(1);

                                items.Add(File.ID, term, termID);
                            }
                            catch (Exception)
                            {
                                continue;
                            }
                        }
                    }
                }

                // Get statuses
                foreach (TermListItem item in items)
                {
                    GetTermStatus(item, abort);
                }
            }
            catch (Exception)
            {
                items.Clear();
            }
        }
Exemple #2
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="items"></param>
        /// <returns></returns>
        /// <created>UPh,29.10.2015</created>
        /// <changed>UPh,29.10.2015</changed>
        // ********************************************************************************
        internal override void GetTermList(TermListItems items, IAbortTermQuery abort, bool bTargetLanguage)
        {
            if (_Doc == null)
            {
                return;
            }

            if (bTargetLanguage)
            {
                return; // TODO
            }
            for (int iLangset = 0; iLangset < _Langset1.Count; iLangset++)
            {
                XmlNode langSet = _Langset1[iLangset];
                foreach (XmlNode node in langSet.SelectNodes(".//term"))
                {
                    items.Add(File.ID, node.InnerText, iLangset);
                }

                //XmlNode node = langSet.SelectSingleNode(".//term");
                //if (node == null)
                //    node = langSet.SelectSingleNode(".//ntig/termGrp/term");

                //if (node != null)
                //    items.Add(File.ID, node.InnerText, items.Count);
            }
        }
Exemple #3
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="items"></param>
        /// <param name="bAbort"></param>
        /// <returns></returns>
        /// <created>UPh,25.10.2015</created>
        /// <changed>UPh,25.10.2015</changed>
        // ********************************************************************************
        internal override void GetTermList(TermListItems items, IAbortTermQuery abort, bool bTargetLanguage)
        {
            if (_Stream == null)
            {
                return;
            }

            for (int i = 0; i < _Terms.Count; i++)
            {
                var tuple = _Terms[i];

                TermListItem item = new TermListItem();
                if (bTargetLanguage)
                {
                    items.Add(File.ID, tuple.Item2, i);
                }
                else
                {
                    items.Add(File.ID, tuple.Item1, i);
                }
            }
        }