Example #1
0
        private string GetSource()
        {
            string            source     = "";
            IndexRootJson     rootJson   = GetIndexRootData();
            string            jsonData   = rootJson.Source;
            ConnectParameters sourceConn = JsonConvert.DeserializeObject <ConnectParameters>(jsonData);

            source = sourceConn.SourceName;
            return(source);
        }
Example #2
0
        private IndexFileData GetIndexFileData(string dataType)
        {
            IndexFileData        indexdata = new IndexFileData();
            IndexRootJson        rootJson  = GetIndexRootData();
            string               taxonomy  = rootJson.Taxonomy;
            List <IndexFileData> idxData   = GetIndexArray(taxonomy);

            indexdata = idxData.FirstOrDefault(s => s.DataName == dataType);
            return(indexdata);
        }
Example #3
0
        private IndexRootJson GetIndexRootData()
        {
            IndexRootJson     rootJson   = new IndexRootJson();
            string            idxQuery   = $" where INDEXNODE = '/'";
            IndexAccess       idxAccess  = new IndexAccess();
            List <IndexModel> idxResults = idxAccess.SelectIndexesByQuery(idxQuery, databaseConnectionString);

            if (idxResults.Count > 0)
            {
                string jsonStringObject = idxResults[0].JsonDataObject;
                rootJson = JsonConvert.DeserializeObject <IndexRootJson>(jsonStringObject);
            }
            return(rootJson);
        }
        public void CreateRoot(ConnectParameters source)
        {
            string        jsonSource    = JsonConvert.SerializeObject(source);
            IndexRootJson indexRootJson = new IndexRootJson
            {
                Source   = jsonSource,
                Taxonomy = _taxonomy
            };
            string json  = JsonConvert.SerializeObject(indexRootJson);
            string table = "pdo_qc_index";

            dbConn.DBDelete(table);
            myIndex.Add(new IndexData {
                DataName = "QCPROJECT", DataType = "QCPROJECT", IndexNode = "/", QcLocation = null, JsonDataObject = json
            });
        }