Exemplo n.º 1
0
        public virtual LexAccessApiResult GetLexRecordsByCat(long category)
        {
            LexAccessApiResult lexAccessApiResult = new LexAccessApiResult();
            StringBuilder      text = new StringBuilder();

            List <string> lexRecords = DbLexRecord.GetRecordsByCat(conn_, lexiconType, category);

            for (int i = 0; i < lexRecords.Count; i++)

            {
                string lexRecord = (string)lexRecords[i];
                text.Append(lexRecord);
            }

            lexAccessApiResult.SetText(text.ToString());
            return(lexAccessApiResult);
        }
Exemplo n.º 2
0
        public virtual LexAccessApiResult GetLexRecords(string input)
        {
            LexAccessApiResult lexAccessApiResult = new LexAccessApiResult();

            if ((ReferenceEquals(input, null)) || (input.Length == 0))

            {
                return(lexAccessApiResult);
            }

            bool   isEui = CheckFormatEui.IsValidEui(input);
            string text  = "";

            if (isEui == true)

            {
                string lexRecord = DbLexRecord.GetRecordByEui(conn_, lexiconType, input);
                text = lexRecord;
            }
            else

            {
                List <string> euis = DbInflVars.GetUniqueEuisByInflVar(conn_, lexiconType, input);

                List <string> lexRecords = new List <string>();
                foreach (string eui in euis)
                {
                    lexRecords.Add(DbLexRecord.GetRecordByEui(conn_, lexiconType, eui));
                }

                for (int i = 0; i < lexRecords.Count; i++)

                {
                    text = text + lexRecords[i];
                }
            }

            lexAccessApiResult.SetText(text);
            return(lexAccessApiResult);
        }
Exemplo n.º 3
0
        public virtual LexAccessApiResult GetLexRecordsByBase(string input, int baseBy)
        {
            LexAccessApiResult lexAccessApiResult = new LexAccessApiResult();

            if ((ReferenceEquals(input, null)) || (input.Length == 0))

            {
                return(lexAccessApiResult);
            }

            string text = "";


            List <string> lexRecords = DbLexRecord.GetRecordsByBase(conn_, lexiconType, input, baseBy);

            for (int i = 0; i < lexRecords.Count; i++)

            {
                text = text + (string)lexRecords[i];
            }

            lexAccessApiResult.SetText(text);
            return(lexAccessApiResult);
        }