private void btnDalje_Click(object sender, EventArgs e) { if (chxPostgreSQL.Checked == false && chxMySql.Checked == false && chxSQLServer.Checked == false) { MessageBox.Show("Choose one DBMS!", "Warning"); } else if (chxPostgreSQL.Checked == true) { MigratorModel traziPostgre = new MigratorModel(); postgreInstalation = traziPostgre.verifyPostgreInstalation(); if (postgreInstalation.Length > 4) { MessageBox.Show("Your System is INSATALLED with Postgres", "Message"); frmIzvorniPosluzitelj frmIzvorni = new frmIzvorniPosluzitelj(this); this.Hide(); frmIzvorni.ShowDialog(); } else { MessageBox.Show("Your System is NOT INSATALLED with Postgres", "Message"); } } else { frmIzvorniPosluzitelj frmIzvorni = new frmIzvorniPosluzitelj(this); this.Hide(); frmIzvorni.ShowDialog(); } }
private void btnTestirajIzvorniPosluzitelj_Click(object sender, EventArgs e) { ConnString = "server=" + txtIzvorniPosluzitelj.Text + ";" + "user="******";" + "pwd=" + txtIzvornaLozinka.Text + ";" + "database=" + txtIzvornaBaza.Text + ";"; MigratorModel model = new MigratorModel(); if (glavna.chxSQLServer.Checked == true) { if (chxWindowsA.Checked == true) { ConnString = "Server=" + txtIzvorniPosluzitelj.Text + ";" + "Database=" + txtIzvornaBaza.Text + ";" + "User Id=" + txtIzvornoKorisnickoIme.Text + ";" + "Trusted_Connection=True;"; if (model.SqlServer(ConnString) == true) MessageBox.Show("Connection succeeded!", "Message"); else MessageBox.Show("Connection failed!", "Warning"); } else if(chxWindowsA.Checked==false) { ConnString = "server=" + txtIzvorniPosluzitelj.Text + ";" + "user="******";" + "pwd=" + txtIzvornaLozinka.Text + ";" + "database=" + txtIzvornaBaza.Text + ";"; if (model.SqlServer(ConnString) == true) MessageBox.Show("Connection succeeded!", "Message"); else MessageBox.Show("Connection failed!", "Warning"); } } if (glavna.chxMySql.Checked == true) { if (model.Mysql(ConnString) == true) MessageBox.Show("Connection succeeded!", "Message"); else MessageBox.Show("Connection failed!", "Warning"); } if (glavna.chxPostgreSQL.Checked == true) { if (model.PostgreSQL(ConnString) == true) MessageBox.Show("Connection succeeded!", "Message"); else MessageBox.Show("Connection failed!", "Warning"); } }