private QueryFilterControl CreateFilterControl(string lang = "en") { DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString")); ConnectionManager.DefaultInstance.SetCredentials(Config.GetSetting("EidssConnectionString")); EidssUserContext.Init(); context = ModelUserContext.Instance as EidssUserContext; Security = new EidssSecurityManager(); int result = Security.LogIn(Organizaton, Admin, AdminPassword); Assert.AreEqual(0, result); EIDSS_LookupCacheHelper.Init(); EidssUserContext.CurrentLanguage = lang; var queryDb = new Query_DB(); var querySearchObjectDb = new QuerySearchObject_DB(); var queryDs = queryDb.LoadDetailData(QueryId); DataRow row = queryDs.Tables[Query_DB.TasQueryObjectTree].Rows[0]; var searchObjectsDs = querySearchObjectDb.LoadDetailData(row["idfQuerySearchObject"]); var form = new Form(); var filter = new QueryFilterControl { Parent = form, Dock = DockStyle.Fill }; filter.Init(); filter.Bind((long)queryDs.Tables[1].Rows[0]["idfQuerySearchObject"], searchObjectsDs); return(filter); }
public void QueryFilterFlashTest() { QueryFilterControl filter = CreateFilterControl(); GroupOperator aggrGroup, rootGroup; CreateFilterCondition1(filter, out rootGroup, out aggrGroup); filter.Flush(); DataTable searchCriteriaTable = filter.QueryDataset.Tables[QuerySearchObject_DB.TasQueryConditionGroup]; Assert.AreEqual(6, searchCriteriaTable.Rows.Count); string filterText = filter.GetFilterText(filter.FilterCriteria, null, " "); CheckFilterCondition1(filter); var ds = filter.QueryDataset; filter = CreateFilterControl(); filter.Bind((long)ds.Tables[1].Rows[0]["idfQuerySearchObject"], ds); filter.Flush(); CheckFilterCondition1(filter); filter = CreateFilterControl(); CreateFilterCondition2(filter, ref rootGroup, ref aggrGroup); filter.Flush(); searchCriteriaTable = filter.QueryDataset.Tables[QuerySearchObject_DB.TasQueryConditionGroup]; Assert.AreEqual(7, searchCriteriaTable.Rows.Count); CheckFilterCondition2(filter); ds = filter.QueryDataset; filter = CreateFilterControl(); filter.Bind((long)ds.Tables[1].Rows[0]["idfQuerySearchObject"], ds); filter.Flush(); CheckFilterCondition2(filter); filter = CreateFilterControl(); CreateFilterCondition3(filter, out rootGroup); filter.Flush(); searchCriteriaTable = filter.QueryDataset.Tables[QuerySearchObject_DB.TasQueryConditionGroup]; Assert.AreEqual(3, searchCriteriaTable.Rows.Count); CheckFilterCondition3(filter); ds = filter.QueryDataset; filter = CreateFilterControl(); filter.Bind((long)ds.Tables[1].Rows[0]["idfQuerySearchObject"], ds); filter.Flush(); CheckFilterCondition3(filter); }
private QueryFilterControl CreateFilterControl(string lang = "en") { var queryDb = new Query_DB(); var querySearchObjectDb = new QuerySearchObject_DB(); DataSet queryDs = queryDb.LoadDetailData(QueryId); DataRow row = queryDs.Tables[Query_DB.TasQueryObjectTree].Rows[0]; DataSet searchObjectsDs = querySearchObjectDb.LoadDetailData(row["idfQuerySearchObject"]); var form = new Form(); var filter = new QueryFilterControl { Parent = form, Dock = DockStyle.Fill }; filter.Init(); filter.Bind((long)queryDs.Tables[1].Rows[0]["idfQuerySearchObject"], searchObjectsDs); return(filter); }
private void FlashClick(object sender, EventArgs e) { m_Filter.Flush(); m_Filter.Bind((long)m_Filter.QueryDataset.Tables[1].Rows[0]["idfQuerySearchObject"], m_Filter.QueryDataset); }