コード例 #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);
        }
コード例 #2
0
        static void Main()
        {
            try
            {
                //Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
                //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                //AppDomain.CurrentDomain.UnhandledException +=
                //    new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

                // 虚拟打印机初始化
                VirtualPrint.Init();

                // 列宽控制类初始化
                ColumnWidthControl.Init();

                // 查询过滤器初始化
                QueryFilterControl.Init();

                GlobalObject.GlobalParameter.Init();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Application.Run(new FormMain());

                // 保存设置
                ColumnWidthControl.Save();
            }
            catch (Exception exce)
            {
                MessageDialog.ShowErrorMessage(exce.Message);
            }
        }
コード例 #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);
        }