Ejemplo n.º 1
0
        internal void Create(string databaseName, string path)
        {
            dBContext.CreateDatabase(databaseName, path);

            taskQueue.Post(TopicsTable.CreateQuery());
            taskQueue.Post(IndicatorsTable.CreateQuery());
        }
Ejemplo n.º 2
0
        internal List <string> GetTopicsIdList()
        {
            var query = TopicsTable.SelectTopicIds();

            var results = dBContext.ExecuteQuery(query);

            var topicsIds = new List <string>();

            for (int i = 0; i < results.Count; i++)
            {
                topicsIds.Add(results[i][0]);
            }

            return(topicsIds);
        }
Ejemplo n.º 3
0
        public GrammarDataSet()
        {
            _tableGrammar = new GrammarTable();
            _tableTopics = new TopicsTable();
            _tableRules = new RulesTable();
            _tableExamples = new ExamplesTable();

            this.Tables.AddRange(new DataTable[] {_tableGrammar, _tableTopics, _tableRules, _tableExamples} );

            AddForeignKey(_tableTopics, _tableTopics, Strings.COL_TOPIC_ID, Strings.COL_PARENT_TOPIC_ID, Strings.FK_TOPICS_TOPICS, true, true);
            AddForeignKey(_tableTopics, _tableRules, Strings.COL_TOPIC_ID, Strings.FK_RULES_TOPICS, true);
            AddForeignKey(_tableRules, _tableExamples, Strings.COL_RULE_ID, Strings.FK_EXAMPLES_RULES, true);

            _tableGrammar.DefaultView.Sort = Strings.COL_GRAMMAR_ID;
            _tableTopics.DefaultView.Sort = "ParentTopicId, Position";
            _tableRules.DefaultView.Sort = "TopicId, Position";
            _tableExamples.DefaultView.Sort = "RuleId, Position";

            this.EnforceConstraints = true;
        }
Ejemplo n.º 4
0
        internal void Insert(TopicsTable[] result)
        {
            var query = TopicsTable.InsertQuery(result);

            taskQueue.Post(query);
        }