Example #1
0
        private void DoOpenWindow()
        {
            OpenQueryParameters pars = new OpenQueryParameters();

            pars.GeneratingSql = true;
            var appobj = ContainerInfo.RelatedObject;
            IPhysicalConnection newconn = null;

            if (ContainerInfo.RelatedConnection != null)
            {
                newconn = ContainerInfo.RelatedConnection.CreateConnection();
            }
            if (newconn != null && ContainerInfo.RelatedDatabase != null)
            {
                newconn.SetOnOpenDatabase(ContainerInfo.RelatedDatabase);
            }
            pars.GeneratingSql = true;
            m_frame            = new QueryFrame(newconn, pars);
            MainWindow.Instance.OpenContent(m_frame);
            MainWindow.Instance.Window.BringToFront();
            if (!m_shownGenereratedSql)
            {
                m_frame.GenerateSqlFinished(m_sqltext);
                m_shownGenereratedSql = true;
            }
        }
Example #2
0
 private void DoFindWindow()
 {
     m_frame = MainWindow.Instance.GetCurrentContent() as QueryFrame;
     if (m_frame == null)
     {
         throw new InternalError("DAE-00053 No current query window found");
     }
 }
Example #3
0
        public override void Open()
        {
            var pars = new OpenQueryParameters();

            pars.File = new DiskFile(QueryFile);
            //pars.SavedContext = Context;
            var frm = new QueryFrame(null, pars);

            MainWindow.Instance.OpenContent(frm);
        }
Example #4
0
        public override void Open()
        {
            var pars = new OpenQueryParameters();

            pars.SavedContext = Context;
            pars.GoToDesign   = true;
            pars.SavedDesign  = Design;
            var frm = new QueryFrame(null, pars);

            MainWindow.Instance.OpenContent(frm);
        }
Example #5
0
        protected void ExecuteQueryText(string sql)
        {
            sql = QueryFrame.AskQueryParams(sql, null);
            if (sql == null)
            {
                return;
            }
            var conn = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(Context.DocumentElement.FindElement("Database"));
            var job  = RunSqlJob.CreateJob(conn, sql);

            job.StartProcess();
        }
Example #6
0
        public override void OpenAction()
        {
            if (QueryFrame.FindOpenedFile(m_file.DataDiskPath))
            {
                return;
            }
            OpenQueryParameters pars = new OpenQueryParameters();
            IPhysicalConnection conn = MainWindowExtension.SelectedConnection;

            if (conn != null)
            {
                conn = conn.Clone();
            }
            pars.File = m_file;
            MainWindow.Instance.OpenContent(new QueryFrame(conn, pars));
        }
Example #7
0
        public void EditScript()
        {
            if (QueryFrame.FindOpenedFile(m_file.DataDiskPath))
            {
                return;
            }
            IPhysicalConnection conn = MainWindowExtension.SelectedConnection;

            if (conn != null)
            {
                conn = conn.Clone();
            }
            OpenQueryParameters pars = new OpenQueryParameters();
            string dbname            = MainWindowExtension.SelectedDatabaseName;

            pars.File           = m_file;
            pars.DisableContext = m_conn != null;
            if (dbname != null && conn != null)
            {
                conn.AfterOpen += ConnTools.ChangeDatabaseCallback(dbname);
            }
            MainWindow.Instance.OpenContent(new QueryFrame(conn, pars));
        }
Example #8
0
 public QueryDesignFrame(QueryFrame queryFrame)
 {
     InitializeComponent();
     m_queryFrame = queryFrame;
     m_condDesign = new ConditionDesigner(tabFilter, this);
 }