Beispiel #1
0
        private void WF01BTTest_Click(object sender, EventArgs e)
        {
            var vCurrODBC = In2SqlSvcODBC.vODBCList.Find(item => item.OdbcName == vODBCName);

            vCurrODBC.Login    = WF01TBLogin.Text;
            vCurrODBC.Password = WF01TBPassword.Text;
            In2SqlSvcODBC.ChangeOdbcValue(vODBCName, vCurrODBC);

            In2SqlSvcODBC.checkOdbcStatus(vODBCName);

            vCurrODBC = In2SqlSvcODBC.vODBCList.Find(item => item.OdbcName == vODBCName);
            DialogResult result;

            if (vCurrODBC.ConnStatus == 1)
            {
                WF01BTOk.Enabled = true;
                result           = MessageBox.Show("Test passed".ToString());
                in2SqlRegistry.setLocalValue(vODBCName, "Login", vCurrODBC.Login);
                in2SqlRegistry.setLocalValue(vODBCName, "Password", vCurrODBC.Password);
            }
            else
            {
                result = MessageBox.Show(vCurrODBC.ConnErrMsg);
            }

            In2SqlSvcTool.RunGarbageCollector();
        }
Beispiel #2
0
 public void ActivateTab()
 {
     if (ribbon != null)
     {
         ribbon.ActivateTab("SqlEngine");
     }
     In2SqlSvcTool.RunGarbageCollector();
 }
Beispiel #3
0
 private void SqlEngine_Shutdown(object sender, System.EventArgs e)
 {
     currExcelApp = null;
     In2SqlSvcTool.RunGarbageCollector();
 }
Beispiel #4
0
        public void ExecMenuButton(Office.IRibbonControl vControl)
        {
            var vActivCell = SqlEngine.currExcelApp.ActiveCell;

            try
            {
                In2SqlSvcTool.RunGarbageCollector();

                switch (vControl.Id)
                {
                case "ExecConnManager":
                    showSQlMAnPane();
                    ActivateTab();
                    break;


                case "ODBCManager":
                    In2SqlSvcTool.RunCmdLauncher("odbcad32");
                    ActivateTab();
                    break;

                case "OdbcProp":
                    showODBCProp();
                    ActivateTab();
                    break;

                case "BackOutl":
                    showOutlinePane();
                    ActivateTab();
                    break;

                case "SqlEdit":
                    showEditPane();
                    break;

                case "KeepOnly":
                    intSqlVBAEngine.RibbonKeepOnly();
                    ActivateTab();
                    break;

                case "RemoveOnly":
                    intSqlVBAEngine.RibbonRemoveOnly();
                    ActivateTab();
                    break;

                case "Retrieve":
                    intSqlVBAEngine.RibbonRefresh();
                    ActivateTab();
                    break;

                case "RetrieveAll":
                    intSqlVBAEngine.RibbonRefreshAll();
                    ActivateTab();
                    break;


                case "EditQuery":
                    showSqlEdit();
                    ActivateTab();
                    break;

                case "PivotExcel":
                    intSqlVBAEngine.RibbonPivotExcel();
                    ActivateTab();
                    break;

                case "Undo":
                    intSqlVBAEngine.Undo();
                    ActivateTab();
                    break;

                case "Redo":
                    intSqlVBAEngine.Redo();
                    ActivateTab();
                    break;

                //  ()
                case "UpdateDataAll":
                    intSqlVBAEngine.updateTablesAll();
                    ActivateTab();
                    break;

                case "UpdateData":
                    intSqlVBAEngine.updateTables();
                    ActivateTab();
                    break;
                //

                case "PowerPivotMM":
                    intSqlVBAEngine.runPowerPivotM();
                    //intSqlVBAEngine.checkTableName();
                    ActivateTab();
                    break;

                case "Options":
                    intSqlVBAEngine.runSqlProperties();
                    //intSqlVBAEngine.checkTableName();
                    ActivateTab();
                    break;

                case "TableProp":
                    intSqlVBAEngine.runTableProperties();
                    break;

                case "About":
                    showAbout();

                    /*  var frmshowAbout = new in2SqlWF09CloudConnectionEditor();
                     * frmshowAbout.Show();
                     * ActivateTab();*/
                    break;



                //RightTaskPane

                default:
                    /*  string caption = "Information message";
                     * MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                     * DialogResult result;
                     *
                     * // Displays the MessageBox.
                     * result = MessageBox.Show(vControl.Id, caption, buttons);
                     */
                    break;
                }
                // In2SqlSvcTool.RunGarbageCollector();
            }
            catch (Exception e)
            {
                In2SqlSvcTool.ExpHandler(e, "ExecMenuButton");
            }
        }