public void QueryFilterRefreshTest() { QueryFilterControl filter = CreateFilterControl(); GroupOperator aggrGroup, rootGroup; CreateFilterCondition1(filter, out rootGroup, out aggrGroup); DataTable searchCriteriaTable = filter.QueryDataset.Tables[QuerySearchObject_DB.TasQueryConditionGroup]; filter.Flush(); Assert.AreEqual(6, searchCriteriaTable.Rows.Count); var querySearchObjectId = (long)filter.QueryDataset.Tables[QuerySearchObject_DB.TasQuerySearchObject].Rows[0]["idfQuerySearchObject"]; DataRow row = filter.QueryDataset.Tables[QuerySearchObject_DB.TasQuerySearchField].Rows.Find(HumanCaseIdField); if (row != null) { row.Delete(); } filter.RefreshNodes(); Assert.AreEqual(4, searchCriteriaTable.Rows.Count); CheckConditionRow(searchCriteriaTable.Rows[0], -1L, DBNull.Value, querySearchObjectId, 0); CheckConditionRow(searchCriteriaTable.Rows[1], -2L, -1L, querySearchObjectId, 0, SubQuerySearchObjectId - 1, DBNull.Value, "Exists"); CheckConditionRow(searchCriteriaTable.Rows[2], -3L, -2L, SubQuerySearchObjectId - 1, 0); CheckConditionRow(searchCriteriaTable.Rows[3], DBNull.Value, -3L, SubQuerySearchObjectId - 1, 0, DBNull.Value, SubQuerySearchFieldIdSeed - 1L, "Binary", 0, TestNameIdValue); }
private void RefereshClick(object sender, EventArgs e) { var row = m_Filter.QueryDataset.Tables[QuerySearchObject_DB.TasQuerySearchField].Rows.Find(HumanCaseIdField); if (row != null) { row.Delete(); } //m_Filter.QueryDataset.Tables[QuerySearchObject_DB.tasQuerySearchField].Rows[0].Delete(); m_Filter.RefreshNodes(); }