Esempio n. 1
0
        private void rootMenu_Click(object sender, EventArgs e)
        {
            if (sender.ToString().Contains("Edit"))
            {
                In2SqlSvcTool.RunCmdLauncher("odbcad32");
            }

            else if (sender.ToString().Contains("Refresh"))
            {
                miSelectNode.Nodes.Clear();
                GetODbcRecords(miSelectNode, 0);
            }

            else if (sender.ToString().Contains("ReConnect"))
            {
                miSelectNode.ImageIndex = 1;
                miSelectNode.Collapse();
                miSelectNode.SelectedImageIndex = 1;
                miSelectNode.Tag = "ODBC$";
            }

            else if (sender.ToString().Contains("Login"))
            {
                in2SqlWF01Login frm1 = new in2SqlWF01Login(miSelectNode.Text);//.Sho
                frm1.Show();
                miSelectNode.ImageIndex = 1;
                miSelectNode.Collapse();
                miSelectNode.SelectedImageIndex = 1;
                miSelectNode.Tag = "ODBC$";
            }
        }
Esempio n. 2
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");
            }
        }