Beispiel #1
0
        public int GetObjectCount(JToken token, int rowNr)
        {
            string select      = "";
            string query       = "";
            int    objectCount = 0;
            string parentName  = (string)token["DataName"];

            _currentItem = _idxData.Find(x => x.DataName == parentName);
            if (string.IsNullOrEmpty(_currentItem.ParentKey))
            {
                select = _currentItem.Select;
                if (!String.IsNullOrEmpty(select))
                {
                    _currentItem.DataTable = _dbConn.GetDataTable(select, query);
                }
                objectCount = _currentItem.DataTable.Rows.Count;
            }
            else
            {
                //DataRow pr = _parentItem.DataTable.Rows[rowNr];
                //string query = GetParentKey(pr, _currentItem.ParentKey);
                //DataRow[] childRows = _currentItem.DataTable.Select(query);
                //objectCount = childRows.Length;
            }
            return(objectCount);
        }
Beispiel #2
0
        private void LoadLogHeader(string json, string logName, int pointer)
        {
            DataAccessDef dataType = _dataDef.First(x => x.DataType == "Log");
            string        select   = dataType.Select;
            string        query    = $" where UWI = '{_uwi}' and CURVE_ID = '{logName}'";
            DataTable     dt       = _dbConn.GetDataTable(select, query);

            if (dt.Rows.Count == 0)
            {
                json = Common.SetJsonDataObjectDate(json, "ROW_CREATED_DATE");
                json = Common.SetJsonDataObjectDate(json, "ROW_CHANGED_DATE");
                _dbConn.InsertDataObject(json, "Log");
                LoadLogCurve(pointer, logName);
            }
        }