コード例 #1
0
        private void tsmiConnect_Click(object sender, EventArgs e)
        {
            frmConnect objForm = new frmConnect();

            objForm.MdiParent = this;
            objForm.Show();
        }
コード例 #2
0
ファイル: AttributeProperties.cs プロジェクト: jakedw7/iAM
        private object CustomEventItem_OnClick(object sender, EventArgs e)
        {
            // open an instance the connect form so the user
            // can define a new connection
            String server              = "";
            String database            = "";
            String userName            = "";
            String password            = "";
            String attributeName       = "";
            String providerName        = "";
            bool   bIntegratedSecurity = true;
            string serviceName         = "";
            string SID  = "";
            string port = "";

            if (m_pgProperties.Item["Server"] != null)
            {
                server = m_pgProperties.Item["Server"].Value.ToString();
            }
            if (m_pgProperties.Item["Database"] != null)
            {
                database = m_pgProperties.Item["Database"].Value.ToString();
            }
            if (m_pgProperties.Item["Login"] != null)
            {
                userName = m_pgProperties.Item["Login"].Value.ToString();
            }
            if (m_pgProperties.Item["Password"] != null)
            {
                password = m_pgProperties.Item["Password"].Value.ToString();
            }
            if (m_pgProperties.Item["Attribute"] != null)
            {
                attributeName = m_pgProperties.Item["Attribute"].Value.ToString();
            }
            if (m_pgProperties.Item["Provider"] != null)
            {
                providerName = m_pgProperties.Item["Provider"].Value.ToString();
            }
            if (m_pgProperties.Item["Integrated Security"] != null)
            {
                bIntegratedSecurity = Convert.ToBoolean(m_pgProperties.Item["Integrated Security"].Value.ToString());
            }
            if (m_pgProperties.Item["Service Name"] != null)
            {
                serviceName = m_pgProperties.Item["Service Name"].Value.ToString();
            }
            if (m_pgProperties.Item["SID"] != null)
            {
                SID = m_pgProperties.Item["SID"].Value.ToString();
            }
            if (m_pgProperties.Item["Port"] != null)
            {
                port = m_pgProperties.Item["Port"].Value.ToString();
            }
            frmConnect f = new frmConnect(server, database, bIntegratedSecurity, SID, serviceName, port, userName, password, providerName, attributeName);

            if (f.ShowDialog() == DialogResult.OK)
            {
                f.Close();
                SolutionExplorerTreeNode selectedNode = (SolutionExplorerTreeNode)FormManager.GetSolutionExplorer().GetTreeView().SelectedNode;
                NetworkDefinition        currNetDef   = selectedNode.NetworkDefinition;
                frmDataDisplay           SQLDataView  = new frmDataDisplay(server, database, userName, password, attributeName, providerName, currNetDef.NetDefName);
                if (SQLDataView.ShowDialog() == DialogResult.OK)
                {
                    String view = SQLDataView.View;
                    viewSelectStatement = SQLDataView.ViewSelectStatement;
                    SQLDataView.Close();
                    return(viewSelectStatement);
                }
            }
            return("");
        }