예제 #1
0
        private void btnConnectMySql_Click(object sender, EventArgs e)
        {
            ConfigGlobal.SettingConfig.Setting_EntityPath = txtLinkMapEntity.Text.Trim();
            ConfigGlobal.Save();

            //Connect MySql
            string connectionString = GetConnectionStringMySql();
            //connStr = "SERVER=10.8.6.87;DATABASE=DatabaseWorking;UID=lemon;PASSWORD=Quantedge@123;CharSet=utf8;Port=3306;";
            var connection = new MySqlConnection(connectionString);

            try
            {
                connection.Open();
                LoadSchemaMySql();
                //MessageBox.Show("Connect successfull ! ");
                connection.Close();

                // Close Form
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can not open connection ! " + ex.ToString());
            }
        }
예제 #2
0
        /// <summary>
        /// method to save setting
        /// </summary>
        private void SaveSetting()
        {
            ConfigGlobal.SettingConfig.Database_Catalog           = txtCatalog.Text;
            ConfigGlobal.SettingConfig.DataBase_SqlServer         = txtSqlServer.Text;
            ConfigGlobal.SettingConfig.Database_SqlAuthentication = rbtnSqlServerAuthentication.Checked;
            ConfigGlobal.SettingConfig.Database_Password          = txtPassword.Text;
            ConfigGlobal.SettingConfig.Database_UserName          = txtLogin.Text;

            ConfigGlobal.Save();
        }
 private void SaveSetting()
 {
     ConfigGlobal.SettingConfig.Setting_ProjectName      = txtProjectName.Text;
     ConfigGlobal.SettingConfig.Setting_ClassPrefix      = txtClassPrefix.Text;
     ConfigGlobal.SettingConfig.Setting_SpPrefix         = txtSpPrefix.Text;
     ConfigGlobal.SettingConfig.Setting_OutputDirectory  = txtOutputDir.Text;
     ConfigGlobal.SettingConfig.Setting_FoudationLink    = txtFoudationLink.Text;
     ConfigGlobal.SettingConfig.Setting_MemoryWorkerBase = txtMemoryWorkerBase.Text;
     ConfigGlobal.SettingConfig.Setting_CheckGenByForder = chkGeneratorByFolder.Checked;
     ConfigGlobal.Save();
 }
예제 #4
0
        private void btnConnectOracle_Click(object sender, EventArgs e)
        {
            LoadListFile();
            LoadListFieldsBool();

            ConfigGlobal.SettingConfig.Setting_EntityPath = txtLinkMapEntity.Text.Trim();
            ConfigGlobal.Save();

            var loginScreen = new ConnectStringForm();
            var result      = loginScreen.ShowDialog();

            this.DialogResult = result;
            this.Close();
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                OracleHelper.ConnectionString = txtConnectionString.Text.Trim();
                OracleHelper.IsConectOracle   = true;
                OracleHelper.GetDt("select 5 from dual");

                DialogResult = DialogResult.OK;
                Close();


                ConfigGlobal.SettingConfig.Setting_ConnectionString = txtConnectionString.Text.Trim();
                ConfigGlobal.Save();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }