Пример #1
0
        private void GetODbcRecords(TreeNode nodeToAddTo, int vIsUI = 0)
        {
            try
            {
                foreach (var vCurrCloudList in in2sqlSvcCloud.vCloudList)
                {
                    string vv = vCurrCloudList.CloudName;
                }


                if (vIsUI == 0)
                {
                    foreach (var vCurrvODBCList in In2SqlSvcODBC.vODBCList)
                    {
                        in2SqlRightPaneTreeTables.setODBCTreeLineSimple(nodeToAddTo, vCurrvODBCList.OdbcName);
                    }
                    return;
                }
                if (vIsUI == 1)
                {
                    foreach (var vCurrvODBCList in In2SqlSvcODBC.vODBCList)
                    {
                        In2SqlSvcODBC.checkOdbcStatus(vCurrvODBCList.OdbcName);
                        in2SqlRightPaneTreeTables.setODBCTreeLineComplex(nodeToAddTo, vCurrvODBCList.OdbcName, vCurrvODBCList.OdbcName);
                    }
                    return;
                }
            }
            catch (Exception er)
            {
                In2SqlSvcTool.ExpHandler(er, "GetODbcRecords");
            }
        }
Пример #2
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();
        }
Пример #3
0
        public static void getTablesAndViews(TreeNodeMouseClickEventArgs e)
        {
            e.Node.Nodes.Clear();
            string vCurrOdbcName = e.Node.Text;

            In2SqlSvcODBC.checkOdbcStatus(vCurrOdbcName);

            var vCurrODBC = In2SqlSvcODBC.vODBCList.Find(item => item.OdbcName == vCurrOdbcName);

            try
            {
                if ((vCurrODBC.ConnStatus == 0))
                {
                    return;
                }

                if (vCurrODBC.ConnStatus < 0)
                {
                    e.Node.ImageIndex         = 7;
                    e.Node.SelectedImageIndex = 7;
                    e.Node.Tag = "ODBC%";
                    TreeNode vNodeErrRecord = new TreeNode(vCurrODBC.ConnErrMsg, 99, 99);
                    e.Node.Nodes.Add(vNodeErrRecord);
                    return;
                }

                if (vCurrODBC.ConnStatus == 1)
                {
                    e.Node.ImageIndex         = 2;
                    e.Node.SelectedImageIndex = 2;
                    e.Node.Tag = "ODBC#";
                    TreeNode vNodeTableFolder = new TreeNode("Tables".ToString(), 3, 3);
                    vNodeTableFolder.Tag = vCurrODBC.OdbcName + "_tf";
                    e.Node.Nodes.Add(vNodeTableFolder);

                    initSQlObjects(ref vCurrODBC);

                    foreach (var vCurrTable in vCurrODBC.Tables)
                    {
                        TreeNode vNodeTable = new TreeNode(vCurrTable.Name, 4, 4);
                        vNodeTable.Tag = vCurrODBC.OdbcName + "|" + vCurrTable.Name + "|$TABLE$";
                        vNodeTableFolder.Nodes.Add(vNodeTable);
                        TreeNode vNodeColumnTbl = new TreeNode(" ".ToString(), 99, 99);
                        vNodeColumnTbl.Tag = vCurrODBC.OdbcName + "." + vCurrTable.Name;
                        vNodeTable.Nodes.Add(vNodeColumnTbl);
                    }

                    TreeNode vNodeViewFolder = new TreeNode("Views".ToString(), 5, 5);
                    vNodeViewFolder.Tag = vCurrODBC.OdbcName + "_vf";
                    e.Node.Nodes.Add(vNodeViewFolder);

                    foreach (var vCurrView in vCurrODBC.Views)
                    {
                        TreeNode vNodeView = new TreeNode(vCurrView.Name, 6, 6);
                        vNodeView.Tag = vCurrODBC.OdbcName + "." + vNodeView.Name + "|$VIEW$";
                        vNodeViewFolder.Nodes.Add(vNodeView);
                        TreeNode vNodeColumnVw = new TreeNode(" ".ToString(), 99, 99);
                        vNodeColumnVw.Tag = vCurrODBC.OdbcName + "." + vNodeView.Name;
                        vNodeView.Nodes.Add(vNodeColumnVw);
                    }

                    TreeNode vNodeFunctionFolder = new TreeNode("Functions".ToString(), 10, 10);
                    vNodeFunctionFolder.Tag = vCurrODBC.OdbcName + "_fn";
                    e.Node.Nodes.Add(vNodeFunctionFolder);

                    foreach (var vCurrFunc in vCurrODBC.SQLFunctions)
                    {
                        TreeNode vNodeView = new TreeNode(vCurrFunc.Name, 9, 9);
                        vNodeView.Tag = vCurrODBC.OdbcName + "." + vCurrFunc.Name;
                        vNodeFunctionFolder.Nodes.Add(vNodeView);
                    }

                    TreeNode vNodeExecFolder = new TreeNode("Procedures".ToString(), 8, 8);
                    vNodeExecFolder.Tag = vCurrODBC.OdbcName + "_pr";
                    e.Node.Nodes.Add(vNodeExecFolder);

                    foreach (var vCurrProced in vCurrODBC.SQLProgramms)
                    {
                        TreeNode vNodeView = new TreeNode(vCurrProced.Name, 11, 11);
                        vNodeView.Tag = vCurrODBC.OdbcName + "|" + vCurrProced.Name;
                        vNodeExecFolder.Nodes.Add(vNodeView);
                    }

                    return;
                }
            }
            catch (Exception er)
            {
                In2SqlSvcTool.ExpHandler(er, "treeODBC_NodeMouseClick 1 ");
            }
        }