Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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);
 }