public void DeleteTable(string connectString, string table) { DbUtilities dbConn = new DbUtilities(); dbConn.OpenWithConnectionString(connectString); dbConn.DBDelete(table); dbConn.CloseConnection(); }
private void DeleteInDatabase(ConnectParameters connector, IndexModel indexItem) { string dataType = indexItem.DataType; string dataKey = indexItem.DataKey; List <DataAccessDef> accessDefs = JsonConvert.DeserializeObject <List <DataAccessDef> >(connector.DataAccessDefinition); DataAccessDef accessDef = accessDefs.First(x => x.DataType == dataType); string select = accessDef.Select; string dataTable = Common.GetTable(select); string dataQuery = "where " + dataKey; DbUtilities dbConn = new DbUtilities(); dbConn.OpenWithConnectionString(connector.ConnectionString); dbConn.DBDelete(dataTable, dataQuery); dbConn.CloseConnection(); }
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 }); }
private void DeleteParent(string qcStr, IndexModel idxResults) { string condition = $"INDEXID={idxResults.IndexId}"; var rows = indexTable.Select(condition); rows[0]["JSONDATAOBJECT"] = ""; rows[0]["QC_STRING"] = qcStr; indexTable.AcceptChanges(); if (syncPredictions) { string dataType = idxResults.DataType; string dataKey = idxResults.DataKey; DataAccessDef ruleAccessDef = _accessDefs.First(x => x.DataType == dataType); string select = ruleAccessDef.Select; string dataTable = GetTable(select); string dataQuery = "where " + dataKey; _dbConn.DBDelete(dataTable, dataQuery); } }