DB operations now occur w/in transactions, added Open DB Form to tester
This commit is contained in:
35
DbToolsTester/Forms/OpenForm.cs
Normal file
35
DbToolsTester/Forms/OpenForm.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DbToolsTester.Forms {
|
||||
public partial class OpenForm : DevExpress.XtraEditors.XtraForm {
|
||||
public string Db1Path => Db1File.Text;
|
||||
public string Db2Path => db2File.Text;
|
||||
|
||||
public OpenForm() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnOpen_Click(object sender, EventArgs e) {
|
||||
MainForm.Instance.SetDatabases(Db1File.Text, db2File.Text);
|
||||
}
|
||||
|
||||
private void Db1File_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) {
|
||||
if (e.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) {
|
||||
OpenFileDialog dlg = new OpenFileDialog() {
|
||||
Filter = "Database Files (*.sql;*.sqlite;*.db)|*.sql;*.sqlite;*.db|SQL Files (*.sql)|*.sql|Sqlite Files (*.sqlite;*.db)|*.sqlite;*.db|Text Files (*.txt)|*.txt|All Files (*.*)|*.*",
|
||||
CheckFileExists = true,
|
||||
Multiselect = false,
|
||||
Title = "Select Database File"
|
||||
};
|
||||
if (dlg.ShowDialog() == DialogResult.OK) {
|
||||
if (sender.Equals(Db1File)) {
|
||||
Db1File.Text = dlg.FileName;
|
||||
} else if (sender.Equals(db2File)) {
|
||||
db2File.Text = dlg.FileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user