예제 #1
0
        public ConnectionDialog(ConnectionDialog_enum ConnectionConnectionDialog_type, DBConnection con, string sTitle, NavigationButtons.Navigation xnav)
        {
            m_Title = sTitle;
            my_ConnectionDialog_enum = ConnectionConnectionDialog_type;
            InitializeComponent();
            nav = xnav;
            usrc_NavigationButtons1.Init(nav);
            usrc_NavigationButtons1.Button_NEXT_Enabled = false;

            if (con.RecentItemsFolder.Length ==0)
            {
                con.RecentItemsFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            }
            this.cmb_ServerName.RecentItemsFolder = con.RecentItemsFolder;
            this.cmb_DataBaseName.RecentItemsFolder = con.RecentItemsFolder;
            this.cmb_UserName.RecentItemsFolder = con.RecentItemsFolder;

            Y[0] = cmb_DataBaseName.Top;
            Y[1] = rdb_UseWindowsAuthentication.Top;
            Y[2] = rdb_SQL_Server_Authentication.Top;
            Y[3] = cmb_UserName.Top;
            Y[4] = txt_Password.Top;

            m_con = con;
            switch (m_con.DBType)
            {
                case DBConnection.eDBType.MYSQL:
                   rdb_UseWindowsAuthentication.Enabled = false;
                   rdb_SQL_Server_Authentication.Enabled = false;
                   this.radioButton_MicrosoftSQL.Checked = false;
                   this.radioButton_MySqlServer.Checked = true;
                   break;

                case DBConnection.eDBType.MSSQL:
                    this.radioButton_MicrosoftSQL.Checked = true;
                    rdb_UseWindowsAuthentication.Enabled = true;
                    rdb_SQL_Server_Authentication.Enabled = true;
                    if (m_con.WindowsAuthentication)
                    {
                        rdb_UseWindowsAuthentication.Checked = true;
                    }
                    else
                    {
                        rdb_SQL_Server_Authentication.Checked = true;
                    }
                    break;
            }
        }
예제 #2
0
        public ConnectionDialog(Form parentForm, ConnectionDialog_enum ConnectionConnectionDialog_type, Log_DBConnection con, string sTitle)
        {
            m_Title = sTitle;
            my_ConnectionDialog_enum = ConnectionConnectionDialog_type;
            m_ParentForm = parentForm;
            InitializeComponent();

            this.cmb_ServerName.RecentItemsFolder = con.RecentItemsFolder;
            this.cmb_DataBaseName.RecentItemsFolder = con.RecentItemsFolder;
            this.cmb_UserName.RecentItemsFolder = con.RecentItemsFolder;

            Y[0] = cmb_DataBaseName.Top;
            Y[1] = rdb_UseWindowsAuthentication.Top;
            Y[2] = rdb_SQL_Server_Authentication.Top;
            Y[3] = cmb_UserName.Top;
            Y[4] = txt_Password.Top;

            m_con = con;
            switch (m_con.DBType)
            {
                case Log_DBConnection.eDBType.MYSQL:
                   rdb_UseWindowsAuthentication.Enabled = false;
                   rdb_SQL_Server_Authentication.Enabled = false;
                   this.radioButton_MicrosoftSQL.Checked = false;
                   this.radioButton_MySqlServer.Checked = true;
                   break;

                case Log_DBConnection.eDBType.MSSQL:
                    this.radioButton_MicrosoftSQL.Checked = true;
                    rdb_UseWindowsAuthentication.Enabled = true;
                    rdb_SQL_Server_Authentication.Enabled = true;
                    if (m_con.WindowsAuthentication)
                    {
                        rdb_UseWindowsAuthentication.Checked = true;
                    }
                    else
                    {
                        rdb_SQL_Server_Authentication.Checked = true;
                    }
                    break;
            }
        }