diff --git a/Config/DatabaseSettings.cs b/Config/DatabaseSettings.cs index 3f2d204ce..e6ba8c511 100644 --- a/Config/DatabaseSettings.cs +++ b/Config/DatabaseSettings.cs @@ -15,21 +15,15 @@ namespace Config // Public fields public string BenchName; public bool IsRealBench; - public DBSettings UsersDBSettings; - public DBSettings BenchDBSettings; - public DBSettings ProceduresDBSettings; - public DBSettings WMTypesDBSettings; - public DBSettings WaterMetersDBSettings; + public DBSettings ProceduresDBSettings; /// Config database settings + public DBSettings WaterMetersDBSettings; /// Results database settings // Constructor public DatabaseSettings() { BenchName = String.Empty; /// Empty string to avoid null IsRealBench = false; - UsersDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_users; UID=root; PASSWORD=;"); - BenchDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_bench; UID=root; PASSWORD=;"); ProceduresDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;"); - WMTypesDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_wmtypes; UID=root; PASSWORD=;"); WaterMetersDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;"); } @@ -39,10 +33,7 @@ namespace Config result.BenchName = BenchName; result.IsRealBench = IsRealBench; - result.UsersDBSettings = (DBSettings)UsersDBSettings.Clone(); - result.BenchDBSettings = (DBSettings)BenchDBSettings.Clone(); result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone(); - result.WMTypesDBSettings = (DBSettings)WMTypesDBSettings.Clone(); result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone(); return result; diff --git a/Config/DatabaseSettingsDlg.Designer.cs b/Config/DatabaseSettingsDlg.Designer.cs index 55c044981..c2529135b 100644 --- a/Config/DatabaseSettingsDlg.Designer.cs +++ b/Config/DatabaseSettingsDlg.Designer.cs @@ -36,34 +36,19 @@ namespace Config this.cancelButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.benchNameTextBox = new System.Windows.Forms.TextBox(); - this.usersConnectionStringTextBox = new System.Windows.Forms.TextBox(); this.connectionStringLabel = new System.Windows.Forms.Label(); - this.benchConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.proceduresConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.wmTypesConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.watermetersConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); + this.configDbConnectionStringTextBox = new System.Windows.Forms.TextBox(); + this.resultsDbConnectionStringTextBox = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); - this.testConnUsersBtn = new System.Windows.Forms.Button(); - this.createUsersDbBtn = new System.Windows.Forms.Button(); this.realBenchCheckBox = new System.Windows.Forms.CheckBox(); this.dbTypeLabel = new System.Windows.Forms.Label(); - this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.benchDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.proceduresDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.wmTypesDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.watermetersDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.testConnBenchBtn = new System.Windows.Forms.Button(); - this.testConnProceduresBtn = new System.Windows.Forms.Button(); - this.testConnWMTypesBtn = new System.Windows.Forms.Button(); - this.testConnWaterMetersBtn = new System.Windows.Forms.Button(); - this.createBenchDbBtn = new System.Windows.Forms.Button(); - this.createProceduresDbBtn = new System.Windows.Forms.Button(); - this.createWMTypesDbBtn = new System.Windows.Forms.Button(); - this.createWaterMetersDbBtn = new System.Windows.Forms.Button(); + this.configDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.resultsDbTypeComboBox = new System.Windows.Forms.ComboBox(); + this.testConnConfigDbBtn = new System.Windows.Forms.Button(); + this.testConnResultsDbBtn = new System.Windows.Forms.Button(); + this.createConfigDbBtn = new System.Windows.Forms.Button(); + this.createResultsDbBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // okButton @@ -92,77 +77,31 @@ namespace Config resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox"); this.benchNameTextBox.Name = "benchNameTextBox"; // - // usersConnectionStringTextBox - // - resources.ApplyResources(this.usersConnectionStringTextBox, "usersConnectionStringTextBox"); - this.usersConnectionStringTextBox.Name = "usersConnectionStringTextBox"; - // // connectionStringLabel // resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel"); this.connectionStringLabel.Name = "connectionStringLabel"; // - // benchConnectionStringTextBox + // configDbConnectionStringTextBox // - resources.ApplyResources(this.benchConnectionStringTextBox, "benchConnectionStringTextBox"); - this.benchConnectionStringTextBox.Name = "benchConnectionStringTextBox"; + resources.ApplyResources(this.configDbConnectionStringTextBox, "configDbConnectionStringTextBox"); + this.configDbConnectionStringTextBox.Name = "configDbConnectionStringTextBox"; // - // proceduresConnectionStringTextBox + // resultsDbConnectionStringTextBox // - resources.ApplyResources(this.proceduresConnectionStringTextBox, "proceduresConnectionStringTextBox"); - this.proceduresConnectionStringTextBox.Name = "proceduresConnectionStringTextBox"; - // - // wmTypesConnectionStringTextBox - // - resources.ApplyResources(this.wmTypesConnectionStringTextBox, "wmTypesConnectionStringTextBox"); - this.wmTypesConnectionStringTextBox.Name = "wmTypesConnectionStringTextBox"; - // - // watermetersConnectionStringTextBox - // - resources.ApplyResources(this.watermetersConnectionStringTextBox, "watermetersConnectionStringTextBox"); - this.watermetersConnectionStringTextBox.Name = "watermetersConnectionStringTextBox"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; + resources.ApplyResources(this.resultsDbConnectionStringTextBox, "resultsDbConnectionStringTextBox"); + this.resultsDbConnectionStringTextBox.Name = "resultsDbConnectionStringTextBox"; // // label4 // resources.ApplyResources(this.label4, "label4"); this.label4.Name = "label4"; // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.label5.Name = "label5"; - // // label6 // resources.ApplyResources(this.label6, "label6"); this.label6.Name = "label6"; // - // testConnUsersBtn - // - this.testConnUsersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnUsersBtn, "testConnUsersBtn"); - this.testConnUsersBtn.Name = "testConnUsersBtn"; - this.testConnUsersBtn.UseVisualStyleBackColor = true; - this.testConnUsersBtn.Click += new System.EventHandler(this.testConnUsersBtn_Click); - // - // createUsersDbBtn - // - this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn"); - this.createUsersDbBtn.Name = "createUsersDbBtn"; - this.createUsersDbBtn.UseVisualStyleBackColor = true; - this.createUsersDbBtn.Click += new System.EventHandler(this.createDatabasesButton_Click); - // // realBenchCheckBox // resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox"); @@ -174,132 +113,67 @@ namespace Config resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel"); this.dbTypeLabel.Name = "dbTypeLabel"; // - // usersDbTypeComboBox + // configDbTypeComboBox // - this.usersDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox"); - this.usersDbTypeComboBox.Name = "usersDbTypeComboBox"; + this.configDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.configDbTypeComboBox, "configDbTypeComboBox"); + this.configDbTypeComboBox.Name = "configDbTypeComboBox"; // - // benchDbTypeComboBox + // resultsDbTypeComboBox // - this.benchDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.benchDbTypeComboBox, "benchDbTypeComboBox"); - this.benchDbTypeComboBox.Name = "benchDbTypeComboBox"; + this.resultsDbTypeComboBox.FormattingEnabled = true; + resources.ApplyResources(this.resultsDbTypeComboBox, "resultsDbTypeComboBox"); + this.resultsDbTypeComboBox.Name = "resultsDbTypeComboBox"; // - // proceduresDbTypeComboBox + // testConnConfigDbBtn // - this.proceduresDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.proceduresDbTypeComboBox, "proceduresDbTypeComboBox"); - this.proceduresDbTypeComboBox.Name = "proceduresDbTypeComboBox"; + this.testConnConfigDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.testConnConfigDbBtn, "testConnConfigDbBtn"); + this.testConnConfigDbBtn.Name = "testConnConfigDbBtn"; + this.testConnConfigDbBtn.UseVisualStyleBackColor = true; + this.testConnConfigDbBtn.Click += new System.EventHandler(this.testConnConfigDbBtn_Click); // - // wmTypesDbTypeComboBox + // testConnResultsDbBtn // - this.wmTypesDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.wmTypesDbTypeComboBox, "wmTypesDbTypeComboBox"); - this.wmTypesDbTypeComboBox.Name = "wmTypesDbTypeComboBox"; + this.testConnResultsDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.testConnResultsDbBtn, "testConnResultsDbBtn"); + this.testConnResultsDbBtn.Name = "testConnResultsDbBtn"; + this.testConnResultsDbBtn.UseVisualStyleBackColor = true; + this.testConnResultsDbBtn.Click += new System.EventHandler(this.testConnResultsDbBtn_Click); // - // watermetersDbTypeComboBox + // createConfigDbBtn // - this.watermetersDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.watermetersDbTypeComboBox, "watermetersDbTypeComboBox"); - this.watermetersDbTypeComboBox.Name = "watermetersDbTypeComboBox"; + this.createConfigDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.createConfigDbBtn, "createConfigDbBtn"); + this.createConfigDbBtn.Name = "createConfigDbBtn"; + this.createConfigDbBtn.UseVisualStyleBackColor = true; + this.createConfigDbBtn.Click += new System.EventHandler(this.createConfigDbBtn_Click); // - // testConnBenchBtn + // createResultsDbBtn // - this.testConnBenchBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnBenchBtn, "testConnBenchBtn"); - this.testConnBenchBtn.Name = "testConnBenchBtn"; - this.testConnBenchBtn.UseVisualStyleBackColor = true; - this.testConnBenchBtn.Click += new System.EventHandler(this.testConnBenchBtn_Click); - // - // testConnProceduresBtn - // - this.testConnProceduresBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnProceduresBtn, "testConnProceduresBtn"); - this.testConnProceduresBtn.Name = "testConnProceduresBtn"; - this.testConnProceduresBtn.UseVisualStyleBackColor = true; - this.testConnProceduresBtn.Click += new System.EventHandler(this.testConnProceduresBtn_Click); - // - // testConnWMTypesBtn - // - this.testConnWMTypesBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnWMTypesBtn, "testConnWMTypesBtn"); - this.testConnWMTypesBtn.Name = "testConnWMTypesBtn"; - this.testConnWMTypesBtn.UseVisualStyleBackColor = true; - this.testConnWMTypesBtn.Click += new System.EventHandler(this.testConnWMTypesBtn_Click); - // - // testConnWaterMetersBtn - // - this.testConnWaterMetersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnWaterMetersBtn, "testConnWaterMetersBtn"); - this.testConnWaterMetersBtn.Name = "testConnWaterMetersBtn"; - this.testConnWaterMetersBtn.UseVisualStyleBackColor = true; - this.testConnWaterMetersBtn.Click += new System.EventHandler(this.testConnWaterMetersBtn_Click); - // - // createBenchDbBtn - // - this.createBenchDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createBenchDbBtn, "createBenchDbBtn"); - this.createBenchDbBtn.Name = "createBenchDbBtn"; - this.createBenchDbBtn.UseVisualStyleBackColor = true; - this.createBenchDbBtn.Click += new System.EventHandler(this.createbenchDbBtn_Click); - // - // createProceduresDbBtn - // - this.createProceduresDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createProceduresDbBtn, "createProceduresDbBtn"); - this.createProceduresDbBtn.Name = "createProceduresDbBtn"; - this.createProceduresDbBtn.UseVisualStyleBackColor = true; - this.createProceduresDbBtn.Click += new System.EventHandler(this.createProecduresDbBtn_Click); - // - // createWMTypesDbBtn - // - this.createWMTypesDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createWMTypesDbBtn, "createWMTypesDbBtn"); - this.createWMTypesDbBtn.Name = "createWMTypesDbBtn"; - this.createWMTypesDbBtn.UseVisualStyleBackColor = true; - this.createWMTypesDbBtn.Click += new System.EventHandler(this.createWMTypesDbBtn_Click); - // - // createWaterMetersDbBtn - // - this.createWaterMetersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createWaterMetersDbBtn, "createWaterMetersDbBtn"); - this.createWaterMetersDbBtn.Name = "createWaterMetersDbBtn"; - this.createWaterMetersDbBtn.UseVisualStyleBackColor = true; - this.createWaterMetersDbBtn.Click += new System.EventHandler(this.createWaterMetersDbBtn_Click); + this.createResultsDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.createResultsDbBtn, "createResultsDbBtn"); + this.createResultsDbBtn.Name = "createResultsDbBtn"; + this.createResultsDbBtn.UseVisualStyleBackColor = true; + this.createResultsDbBtn.Click += new System.EventHandler(this.createResultsDbBtn_Click); // // DatabaseSettingsDlg // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.createWaterMetersDbBtn); - this.Controls.Add(this.createWMTypesDbBtn); - this.Controls.Add(this.createProceduresDbBtn); - this.Controls.Add(this.createBenchDbBtn); - this.Controls.Add(this.testConnWaterMetersBtn); - this.Controls.Add(this.testConnWMTypesBtn); - this.Controls.Add(this.testConnProceduresBtn); - this.Controls.Add(this.testConnBenchBtn); - this.Controls.Add(this.watermetersDbTypeComboBox); - this.Controls.Add(this.wmTypesDbTypeComboBox); - this.Controls.Add(this.proceduresDbTypeComboBox); - this.Controls.Add(this.benchDbTypeComboBox); - this.Controls.Add(this.usersDbTypeComboBox); + this.Controls.Add(this.createResultsDbBtn); + this.Controls.Add(this.createConfigDbBtn); + this.Controls.Add(this.testConnResultsDbBtn); + this.Controls.Add(this.testConnConfigDbBtn); + this.Controls.Add(this.resultsDbTypeComboBox); + this.Controls.Add(this.configDbTypeComboBox); this.Controls.Add(this.dbTypeLabel); this.Controls.Add(this.realBenchCheckBox); - this.Controls.Add(this.createUsersDbBtn); - this.Controls.Add(this.testConnUsersBtn); this.Controls.Add(this.label6); - this.Controls.Add(this.label5); this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.watermetersConnectionStringTextBox); - this.Controls.Add(this.wmTypesConnectionStringTextBox); - this.Controls.Add(this.proceduresConnectionStringTextBox); - this.Controls.Add(this.benchConnectionStringTextBox); + this.Controls.Add(this.resultsDbConnectionStringTextBox); + this.Controls.Add(this.configDbConnectionStringTextBox); this.Controls.Add(this.connectionStringLabel); - this.Controls.Add(this.usersConnectionStringTextBox); this.Controls.Add(this.benchNameTextBox); this.Controls.Add(this.label1); this.Controls.Add(this.okButton); @@ -319,34 +193,19 @@ namespace Config private System.Windows.Forms.Button okButton; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox benchNameTextBox; - private System.Windows.Forms.TextBox usersConnectionStringTextBox; - private System.Windows.Forms.Label connectionStringLabel; - private System.Windows.Forms.TextBox benchConnectionStringTextBox; - private System.Windows.Forms.TextBox proceduresConnectionStringTextBox; - private System.Windows.Forms.TextBox wmTypesConnectionStringTextBox; - private System.Windows.Forms.TextBox watermetersConnectionStringTextBox; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Button testConnUsersBtn; - private System.Windows.Forms.Button createUsersDbBtn; + private System.Windows.Forms.TextBox benchNameTextBox; + private System.Windows.Forms.Label connectionStringLabel; + private System.Windows.Forms.TextBox configDbConnectionStringTextBox; + private System.Windows.Forms.TextBox resultsDbConnectionStringTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label6; private System.Windows.Forms.CheckBox realBenchCheckBox; - private System.Windows.Forms.Label dbTypeLabel; - private System.Windows.Forms.ComboBox usersDbTypeComboBox; - private System.Windows.Forms.ComboBox benchDbTypeComboBox; - private System.Windows.Forms.ComboBox proceduresDbTypeComboBox; - private System.Windows.Forms.ComboBox wmTypesDbTypeComboBox; - private System.Windows.Forms.ComboBox watermetersDbTypeComboBox; - private System.Windows.Forms.Button testConnBenchBtn; - private System.Windows.Forms.Button testConnProceduresBtn; - private System.Windows.Forms.Button testConnWMTypesBtn; - private System.Windows.Forms.Button testConnWaterMetersBtn; - private System.Windows.Forms.Button createBenchDbBtn; - private System.Windows.Forms.Button createProceduresDbBtn; - private System.Windows.Forms.Button createWMTypesDbBtn; - private System.Windows.Forms.Button createWaterMetersDbBtn; + private System.Windows.Forms.Label dbTypeLabel; + private System.Windows.Forms.ComboBox configDbTypeComboBox; + private System.Windows.Forms.ComboBox resultsDbTypeComboBox; + private System.Windows.Forms.Button testConnConfigDbBtn; + private System.Windows.Forms.Button testConnResultsDbBtn; + private System.Windows.Forms.Button createConfigDbBtn; + private System.Windows.Forms.Button createResultsDbBtn; } } \ No newline at end of file diff --git a/Config/DatabaseSettingsDlg.cs b/Config/DatabaseSettingsDlg.cs index 937bcbf28..fb0b4a917 100644 --- a/Config/DatabaseSettingsDlg.cs +++ b/Config/DatabaseSettingsDlg.cs @@ -33,25 +33,16 @@ namespace Config realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer; dbTypeLabel.Text = Strings.Database_type; connectionStringLabel.Text = Strings.Connection_string; - label2.Text = Strings.Users_and_groups; - label3.Text = Strings.Bench_parameters; label4.Text = Strings.Procedures; - label5.Text = Strings.Water_meter_types; label6.Text = Strings.Water_meter_data; okButton.Text = Strings.OkBtnText; cancelButton.Text = Strings.CancelBtnText; - testConnBenchBtn.Text = Strings.Test_connection; - testConnProceduresBtn.Text = Strings.Test_connection; - testConnUsersBtn.Text = Strings.Test_connection; - testConnWaterMetersBtn.Text = Strings.Test_connection; - testConnWMTypesBtn.Text = Strings.Test_connection; + testConnConfigDbBtn.Text = Strings.Test_connection; + testConnResultsDbBtn.Text = Strings.Test_connection; - createBenchDbBtn.Text = Strings.Create_DB; - createProceduresDbBtn.Text = Strings.Create_DB; - createUsersDbBtn.Text = Strings.Create_DB; - createWaterMetersDbBtn.Text = Strings.Create_DB; - createWMTypesDbBtn.Text = Strings.Create_DB; + createConfigDbBtn.Text = Strings.Create_DB; + createResultsDbBtn.Text = Strings.Create_DB; } private void BenchSettingsDlg_Load(object sender, EventArgs e) @@ -65,24 +56,15 @@ namespace Config for (int i = 0; i < (int)Entities.DBType.DbTypesCount; i++) { Entities.DBType dbType = (Entities.DBType)i; - usersDbTypeComboBox.Items.Add(dbType); - benchDbTypeComboBox.Items.Add(dbType); - proceduresDbTypeComboBox.Items.Add(dbType); - wmTypesDbTypeComboBox.Items.Add(dbType); - watermetersDbTypeComboBox.Items.Add(dbType); + configDbTypeComboBox.Items.Add(dbType); + resultsDbTypeComboBox.Items.Add(dbType); } - usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType; - benchDbTypeComboBox.SelectedIndex = (int)bench.BenchDBSettings.DbType; - proceduresDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType; - wmTypesDbTypeComboBox.SelectedIndex = (int)bench.WMTypesDBSettings.DbType; - watermetersDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType; + configDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType; + resultsDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType; /// Initialize connection strings - usersConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString; - benchConnectionStringTextBox.Text = bench.BenchDBSettings.ConnectionString; - proceduresConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString; - wmTypesConnectionStringTextBox.Text = bench.WMTypesDBSettings.ConnectionString; - watermetersConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString; + configDbConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString; + resultsDbConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString; } bool UpdateBenchFromUIControls() @@ -101,17 +83,11 @@ namespace Config bench.BenchName = benchNameTextBox.Text; bench.IsRealBench = realBenchCheckBox.Checked; - bench.UsersDBSettings.ConnectionString = usersConnectionStringTextBox.Text; - bench.BenchDBSettings.ConnectionString = benchConnectionStringTextBox.Text; - bench.ProceduresDBSettings.ConnectionString = proceduresConnectionStringTextBox.Text; - bench.WMTypesDBSettings.ConnectionString = wmTypesConnectionStringTextBox.Text; - bench.WaterMetersDBSettings.ConnectionString = watermetersConnectionStringTextBox.Text; + bench.ProceduresDBSettings.ConnectionString = configDbConnectionStringTextBox.Text; + bench.WaterMetersDBSettings.ConnectionString = resultsDbConnectionStringTextBox.Text; - bench.UsersDBSettings.DbType = (Entities.DBType)usersDbTypeComboBox.SelectedIndex; - bench.BenchDBSettings.DbType = (Entities.DBType)benchDbTypeComboBox.SelectedIndex; - bench.ProceduresDBSettings.DbType = (Entities.DBType)proceduresDbTypeComboBox.SelectedIndex; - bench.WMTypesDBSettings.DbType = (Entities.DBType)wmTypesDbTypeComboBox.SelectedIndex; - bench.WaterMetersDBSettings.DbType = (Entities.DBType)watermetersDbTypeComboBox.SelectedIndex; + bench.ProceduresDBSettings.DbType = (Entities.DBType)configDbTypeComboBox.SelectedIndex; + bench.WaterMetersDBSettings.DbType = (Entities.DBType)resultsDbTypeComboBox.SelectedIndex; return true; } @@ -144,7 +120,7 @@ namespace Config Close(); } - private void createDatabasesButton_Click(object sender, EventArgs e) + private void createConfigDbBtn_Click(object sender, EventArgs e) { if (!UpdateBenchFromUIControls()) return; @@ -154,29 +130,7 @@ namespace Config try { Cursor.Current = Cursors.WaitCursor; - FluentCommon.CreateEmptyUsersDB(bench.UsersDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (NHibernate.HibernateException exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void createbenchDbBtn_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - FluentCommon.CreateEmptyBenchDB(bench.BenchDBSettings); + FluentCommon.CreateEmptyConfigDB(bench.ProceduresDBSettings); MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); Cursor.Current = Cursors.Default; DialogResult = DialogResult.None; @@ -188,7 +142,7 @@ namespace Config } } - private void createProecduresDbBtn_Click(object sender, EventArgs e) + private void createResultsDbBtn_Click(object sender, EventArgs e) { if (!UpdateBenchFromUIControls()) return; @@ -198,7 +152,7 @@ namespace Config try { Cursor.Current = Cursors.WaitCursor; - FluentCommon.CreateEmptyProceduresDB(bench.ProceduresDBSettings); + FluentCommon.CreateEmptyResultsDB(bench.WaterMetersDBSettings); MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); Cursor.Current = Cursors.Default; DialogResult = DialogResult.None; @@ -210,50 +164,11 @@ namespace Config } } - private void createWMTypesDbBtn_Click(object sender, EventArgs e) - { - - } - - private void createWaterMetersDbBtn_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - FluentCommon.CreateEmptyWaterMetersDB(bench.WaterMetersDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (Exception exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void testConnUsersBtn_Click(object sender, EventArgs e) + private void testConnConfigDbBtn_Click(object sender, EventArgs e) { } - private void testConnBenchBtn_Click(object sender, EventArgs e) - { - } - - private void testConnProceduresBtn_Click(object sender, EventArgs e) - { - } - - private void testConnWMTypesBtn_Click(object sender, EventArgs e) - { - } - - private void testConnWaterMetersBtn_Click(object sender, EventArgs e) + private void testConnResultsDbBtn_Click(object sender, EventArgs e) { } } diff --git a/Config/DatabaseSettingsDlg.resx b/Config/DatabaseSettingsDlg.resx index 9e8ff90fa..47f4fc496 100644 --- a/Config/DatabaseSettingsDlg.resx +++ b/Config/DatabaseSettingsDlg.resx @@ -141,7 +141,7 @@ $this - 30 + 15 614, 49 @@ -165,7 +165,7 @@ $this - 31 + 16 True @@ -192,7 +192,7 @@ $this - 29 + 14 116, 15 @@ -213,28 +213,7 @@ $this - 28 - - - 202, 101 - - - 406, 20 - - - 17 - - - usersConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 27 + 13 True @@ -261,160 +240,64 @@ $this - 26 + 12 - - 202, 127 + + 202, 107 - + 406, 20 - - 19 - - - benchConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 25 - - - 202, 153 - - - 406, 20 - - + 20 - - proceduresConnectionStringTextBox + + configDbConnectionStringTextBox - + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 24 + + 11 - - 202, 179 + + 202, 137 - + 406, 20 - - 21 - - - wmTypesConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 23 - - - 202, 205 - - - 406, 20 - - + 22 - - watermetersConnectionStringTextBox + + resultsDbConnectionStringTextBox - + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 22 - - - True - - - 12, 104 - - - 90, 13 - - - 47 - - - Users and groups - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 21 - - - True - - - 12, 130 - - - 93, 13 - - - 48 - - - Bench parameters - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 20 + + 10 True - 12, 156 + 12, 110 - 61, 13 + 69, 13 49 - Procedures + Configuration label4 @@ -426,49 +309,22 @@ $this - 19 - - - True - - - 12, 182 - - - 90, 13 - - - 50 - - - Watermeter types - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 18 + 9 True - 12, 208 + 12, 140 - 67, 13 + 42, 13 51 - Watermeters + Results label6 @@ -480,55 +336,7 @@ $this - 17 - - - 614, 99 - - - 95, 23 - - - 52 - - - Test Connection - - - testConnUsersBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 16 - - - 711, 99 - - - 120, 23 - - - 53 - - - Create DB - - - createUsersDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 15 + 8 True @@ -555,7 +363,7 @@ $this - 14 + 7 True @@ -582,328 +390,157 @@ $this - 13 - - - 116, 101 - - - 80, 21 - - - 56 - - - usersDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 12 - - - 116, 127 - - - 80, 21 - - - 57 - - - benchDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 11 - - - 116, 153 - - - 80, 21 - - - 58 - - - proceduresDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 10 - - - 116, 179 - - - 80, 21 - - - 59 - - - wmTypesDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - - - 116, 205 - - - 80, 21 - - - 60 - - - watermetersDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - - - - NoControl - - - 614, 125 - - - 95, 23 - - - 61 - - - Test Connection - - - testConnBenchBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - NoControl - - - 614, 151 - - - 95, 23 - - - 62 - - - Test Connection - - - testConnProceduresBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 6 - - NoControl + + 116, 107 - - 614, 177 + + 80, 21 - - 95, 23 + + 58 - - 63 + + configDbTypeComboBox - - Test Connection + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - testConnWMTypesBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + $this - + 5 - - NoControl + + 116, 137 - - 614, 203 + + 80, 21 - - 95, 23 + + 60 - - 64 + + resultsDbTypeComboBox - - Test Connection + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - testConnWaterMetersBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + $this - + 4 - + + NoControl - - 711, 124 + + 614, 105 - - 120, 23 + + 95, 23 - - 65 + + 62 - - Create DB + + Test Connection - - createBenchDbBtn + + testConnConfigDbBtn - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 3 - + NoControl - - 711, 150 + + 614, 135 - - 120, 23 + + 95, 23 - - 66 + + 64 - - Create DB + + Test Connection - - createProceduresDbBtn + + testConnResultsDbBtn - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 2 - + NoControl - - 711, 176 + + 711, 104 - + 120, 23 - - 67 + + 66 - + Create DB - - createWMTypesDbBtn + + createConfigDbBtn - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 1 - + NoControl - - 711, 202 + + 711, 134 - + 120, 23 - + 68 - + Create DB - - createWaterMetersDbBtn + + createResultsDbBtn - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 0 @@ -913,7 +550,7 @@ 6, 13 - 836, 241 + 840, 172 CenterParent diff --git a/Config/Entities/Enums.cs b/Config/Entities/Enums.cs index 22d6d84bf..535545732 100644 --- a/Config/Entities/Enums.cs +++ b/Config/Entities/Enums.cs @@ -14,6 +14,13 @@ namespace Config.Entities DbTypesCount, } + /// Identifies the database based on the content + public enum DBKind + { + Config, + Results, + Count, + } public enum ProcedureState { @@ -23,9 +30,7 @@ namespace Config.Entities Count, } - /// - /// Kind of meters for the procedure / test - /// + /// Kind of meters for the procedure / test public enum MetersKind { Single, @@ -38,9 +43,7 @@ namespace Config.Entities HotWater, } - /// - /// Transition step is finished when this condition is fulfilled - /// + /// Transition step is finished when this condition is fulfilled public enum StepCondition { None, @@ -85,9 +88,7 @@ namespace Config.Entities CubicMtr, } - /// - /// Possible modes of operation of components and devices. - /// + /// Possible modes of operation of components and devices. public enum DebugMode { DetectedOff = -2, @@ -116,14 +117,14 @@ namespace Config.Entities } - /// Arrangement of tests + /// Arrangement of tests public enum TestsArrangement { Rows, Columns, } - /// Arrangement of meters + /// Arrangement of meters public enum MetersArrangement { Vertically, diff --git a/Config/Entities/User.cs b/Config/Entities/User.cs index 71ea49a19..c2aefdb9b 100644 --- a/Config/Entities/User.cs +++ b/Config/Entities/User.cs @@ -184,7 +184,7 @@ namespace Config.Entities /// reference to a 'User' (if it exists) or null public static User LoadUserByName(string username, DBSettings dbSettings) { - IList listOfUsers = FluentCommon.CreateSessionFactory(Database.Users, dbSettings, false) + IList listOfUsers = FluentCommon.CreateSessionFactory(DBKind.Config, dbSettings, false) .OpenSession() .CreateQuery("FROM User WHERE LOWER(Name) = :username") .SetParameter("username", username.ToLower()) @@ -200,7 +200,7 @@ namespace Config.Entities /// reference to a 'User' (if it exists) or null public static User LoadUserByName(string username) { - IList listOfUsers = FluentCommon.CreateSession(Database.Users) + IList listOfUsers = FluentCommon.CreateSession(DBKind.Config) .CreateQuery("FROM User WHERE LOWER(Name) = :username") .SetParameter("username", username.ToLower()) .List(); @@ -213,7 +213,7 @@ namespace Config.Entities /// public static IList GetAllUsers() { - return FluentCommon.CreateSession(Database.Users) + return FluentCommon.CreateSession(DBKind.Config) .CreateQuery("FROM User") .List(); } diff --git a/Config/Entities/Watermeter.cs b/Config/Entities/Watermeter.cs index 22b377f0c..d2c95bd41 100644 --- a/Config/Entities/Watermeter.cs +++ b/Config/Entities/Watermeter.cs @@ -29,7 +29,7 @@ namespace Config.Entities /// public static Watermeter LoadBySerialnr(string SerialNr) { - IList ListOfWatermeters = FluentCommon.CreateSession(Database.WaterMeters) + IList ListOfWatermeters = FluentCommon.CreateSession(DBKind.Results) .CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter") .SetParameter("SerialNrParameter", SerialNr) .List(); diff --git a/Config/FluentCommon.cs b/Config/FluentCommon.cs index 41abe0dfb..1547ef64d 100644 --- a/Config/FluentCommon.cs +++ b/Config/FluentCommon.cs @@ -12,30 +12,18 @@ using Config.Resources; namespace Config { - /// - /// Identifies the content of a database - /// - public enum Database - { - Users, - Bench, - Procedures, - WaterMeters, - Count, - } - public static class FluentCommon { /// /// Session factories for regular sessions. /// - public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Database.Count]; + public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Entities.DBKind.Count]; /// /// NHibernate session factory (to create the database session 'SessionFactory') /// /// A database session - static ISessionFactory CreateSessionFactory(Database database) + static ISessionFactory CreateSessionFactory(Entities.DBKind database) { Entities.DBType dbType; string connectionString; @@ -43,19 +31,11 @@ namespace Config switch (database) { default: - case Database.Users: - dbType = Data.CurrentBench.UsersDBSettings.DbType; - connectionString = Data.CurrentBench.UsersDBSettings.ConnectionString; - break; - case Database.Bench: - dbType = Data.CurrentBench.BenchDBSettings.DbType; - connectionString = Data.CurrentBench.BenchDBSettings.ConnectionString; - break; - case Database.Procedures: + case Entities.DBKind.Config: dbType = Data.CurrentBench.ProceduresDBSettings.DbType; connectionString = Data.CurrentBench.ProceduresDBSettings.ConnectionString; break; - case Database.WaterMeters: + case Entities.DBKind.Results: dbType = Data.CurrentBench.WaterMetersDBSettings.DbType; connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString; break; @@ -68,7 +48,7 @@ namespace Config /// NHibernate session factory (to create the database session 'SessionFactory') /// /// A database session - public static ISessionFactory CreateSessionFactory(Database database, DBSettings dbSettings, bool createDB) + public static ISessionFactory CreateSessionFactory(Entities.DBKind database, DBSettings dbSettings, bool createDB) { try { @@ -88,16 +68,10 @@ namespace Config switch (database) { default: - case Database.Users: + case Entities.DBKind.Config: cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); break; - case Database.Bench: - cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); - break; - case Database.Procedures: - cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); - break; - case Database.WaterMeters: + case Entities.DBKind.Results: cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf()); break; } @@ -136,17 +110,17 @@ namespace Config } /// Create a NHibernate session for the given database - public static ISession CreateSession(Database database) + public static ISession CreateSession(Entities.DBKind database) { int ix = (int)database; - if (ix < 0 || ix >= (int)Database.Count) return null; + if (ix < 0 || ix >= (int)Entities.DBKind.Count) return null; if (SessionFactories[ix] == null) SessionFactories[ix] = CreateSessionFactory(database); return SessionFactories[ix].OpenSession(); } - public static void SaveToDb(Database database, object obj) + public static void SaveToDb(Entities.DBKind database, object obj) { SaveToDb(CreateSession(database), obj); } @@ -161,7 +135,7 @@ namespace Config } } - public static void DeleteFromDb(Database database, object obj) + public static void DeleteFromDb(Entities.DBKind database, object obj) { DeleteFromDb(CreateSession(database), obj); } @@ -182,10 +156,10 @@ namespace Config /// DBType.SQLite or DBType.MySql /// Connection string /// true=success, false=error - public static bool CreateEmptyUsersDB(DBSettings dbSettings) - { - ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); - if (sessionFactory == null) return false; + public static bool CreateEmptyConfigDB(DBSettings dbSettings) + { + ISessionFactory sessionFactory = CreateSessionFactory(Entities.DBKind.Config, dbSettings, true); + if (sessionFactory == null) return false; /// Populate the database using (var session = sessionFactory.OpenSession()) @@ -232,65 +206,15 @@ namespace Config return true; } - /// - /// Create an empty bench database - /// - /// DBType.SQLite or DBType.MySql - /// Connection string - /// true=success, false=error - public static bool CreateEmptyBenchDB(DBSettings dbSettings) - { - ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); - if (sessionFactory == null) return false; - - /// Populate the database - //using (var session = sessionFactory.OpenSession()) - //{ - // using (var transaction = session.BeginTransaction()) - // { - // /// Create one component - // var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity(); - // session.SaveOrUpdate(cmpnt); - // transaction.Commit(); - // } - //} - return true; - } - - /// - /// Create an empty procedures database - /// - /// DBType.SQLite or DBType.MySql - /// Connection string - /// true=success, false=error - public static bool CreateEmptyProceduresDB(DBSettings dbSettings) - { - ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); - if (sessionFactory == null) return false; - - /// Populate the database - //using (var session = sessionFactory.OpenSession()) - //{ - // using (var transaction = session.BeginTransaction()) - // { - // /// Create one component - // var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity(); - // session.SaveOrUpdate(cmpnt); - // transaction.Commit(); - // } - //} - return true; - } - /// /// Create an empty water meters database /// /// DBType.SQLite or DBType.MySql /// Connection string /// true=success, false=error - public static bool CreateEmptyWaterMetersDB(DBSettings dbSettings) + public static bool CreateEmptyResultsDB(DBSettings dbSettings) { - ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true); + ISessionFactory sessionFactory = CreateSessionFactory(Entities.DBKind.Results, dbSettings, true); if (sessionFactory == null) return false; /// Populate the database diff --git a/ResultsBrowser/DatabaseSettingsDlg.Designer.cs b/ResultsBrowser/DatabaseSettingsDlg.Designer.cs deleted file mode 100644 index 2df897d17..000000000 --- a/ResultsBrowser/DatabaseSettingsDlg.Designer.cs +++ /dev/null @@ -1,349 +0,0 @@ -namespace ResultsBrowser -{ - partial class DatabaseSettingsDlg - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseSettingsDlg)); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.benchNameTextBox = new System.Windows.Forms.TextBox(); - this.usersConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.connectionStringLabel = new System.Windows.Forms.Label(); - this.benchConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.proceduresConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.wmTypesConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.watermetersConnectionStringTextBox = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.testConnUsersBtn = new System.Windows.Forms.Button(); - this.createUsersDbBtn = new System.Windows.Forms.Button(); - this.realBenchCheckBox = new System.Windows.Forms.CheckBox(); - this.dbTypeLabel = new System.Windows.Forms.Label(); - this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.benchDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.proceduresDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.wmTypesDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.watermetersDbTypeComboBox = new System.Windows.Forms.ComboBox(); - this.testConnBenchBtn = new System.Windows.Forms.Button(); - this.testConnProceduresBtn = new System.Windows.Forms.Button(); - this.testConnWMTypesBtn = new System.Windows.Forms.Button(); - this.testConnWaterMetersBtn = new System.Windows.Forms.Button(); - this.createBenchDbBtn = new System.Windows.Forms.Button(); - this.createProceduresDbBtn = new System.Windows.Forms.Button(); - this.createWMTypesDbBtn = new System.Windows.Forms.Button(); - this.createWaterMetersDbBtn = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - resources.ApplyResources(this.okButton, "okButton"); - this.okButton.Name = "okButton"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.cancelButton, "cancelButton"); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // benchNameTextBox - // - resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox"); - this.benchNameTextBox.Name = "benchNameTextBox"; - // - // usersConnectionStringTextBox - // - resources.ApplyResources(this.usersConnectionStringTextBox, "usersConnectionStringTextBox"); - this.usersConnectionStringTextBox.Name = "usersConnectionStringTextBox"; - // - // connectionStringLabel - // - resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel"); - this.connectionStringLabel.Name = "connectionStringLabel"; - // - // benchConnectionStringTextBox - // - resources.ApplyResources(this.benchConnectionStringTextBox, "benchConnectionStringTextBox"); - this.benchConnectionStringTextBox.Name = "benchConnectionStringTextBox"; - // - // proceduresConnectionStringTextBox - // - resources.ApplyResources(this.proceduresConnectionStringTextBox, "proceduresConnectionStringTextBox"); - this.proceduresConnectionStringTextBox.Name = "proceduresConnectionStringTextBox"; - // - // wmTypesConnectionStringTextBox - // - resources.ApplyResources(this.wmTypesConnectionStringTextBox, "wmTypesConnectionStringTextBox"); - this.wmTypesConnectionStringTextBox.Name = "wmTypesConnectionStringTextBox"; - // - // watermetersConnectionStringTextBox - // - resources.ApplyResources(this.watermetersConnectionStringTextBox, "watermetersConnectionStringTextBox"); - this.watermetersConnectionStringTextBox.Name = "watermetersConnectionStringTextBox"; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; - // - // label4 - // - resources.ApplyResources(this.label4, "label4"); - this.label4.Name = "label4"; - // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.label5.Name = "label5"; - // - // label6 - // - resources.ApplyResources(this.label6, "label6"); - this.label6.Name = "label6"; - // - // testConnUsersBtn - // - this.testConnUsersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnUsersBtn, "testConnUsersBtn"); - this.testConnUsersBtn.Name = "testConnUsersBtn"; - this.testConnUsersBtn.UseVisualStyleBackColor = true; - this.testConnUsersBtn.Click += new System.EventHandler(this.testConnUsersBtn_Click); - // - // createUsersDbBtn - // - this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn"); - this.createUsersDbBtn.Name = "createUsersDbBtn"; - this.createUsersDbBtn.UseVisualStyleBackColor = true; - this.createUsersDbBtn.Click += new System.EventHandler(this.createDatabasesButton_Click); - // - // realBenchCheckBox - // - resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox"); - this.realBenchCheckBox.Name = "realBenchCheckBox"; - this.realBenchCheckBox.UseVisualStyleBackColor = true; - // - // dbTypeLabel - // - resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel"); - this.dbTypeLabel.Name = "dbTypeLabel"; - // - // usersDbTypeComboBox - // - this.usersDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox"); - this.usersDbTypeComboBox.Name = "usersDbTypeComboBox"; - // - // benchDbTypeComboBox - // - this.benchDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.benchDbTypeComboBox, "benchDbTypeComboBox"); - this.benchDbTypeComboBox.Name = "benchDbTypeComboBox"; - // - // proceduresDbTypeComboBox - // - this.proceduresDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.proceduresDbTypeComboBox, "proceduresDbTypeComboBox"); - this.proceduresDbTypeComboBox.Name = "proceduresDbTypeComboBox"; - // - // wmTypesDbTypeComboBox - // - this.wmTypesDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.wmTypesDbTypeComboBox, "wmTypesDbTypeComboBox"); - this.wmTypesDbTypeComboBox.Name = "wmTypesDbTypeComboBox"; - // - // watermetersDbTypeComboBox - // - this.watermetersDbTypeComboBox.FormattingEnabled = true; - resources.ApplyResources(this.watermetersDbTypeComboBox, "watermetersDbTypeComboBox"); - this.watermetersDbTypeComboBox.Name = "watermetersDbTypeComboBox"; - // - // testConnBenchBtn - // - this.testConnBenchBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnBenchBtn, "testConnBenchBtn"); - this.testConnBenchBtn.Name = "testConnBenchBtn"; - this.testConnBenchBtn.UseVisualStyleBackColor = true; - this.testConnBenchBtn.Click += new System.EventHandler(this.testConnBenchBtn_Click); - // - // testConnProceduresBtn - // - this.testConnProceduresBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnProceduresBtn, "testConnProceduresBtn"); - this.testConnProceduresBtn.Name = "testConnProceduresBtn"; - this.testConnProceduresBtn.UseVisualStyleBackColor = true; - this.testConnProceduresBtn.Click += new System.EventHandler(this.testConnProceduresBtn_Click); - // - // testConnWMTypesBtn - // - this.testConnWMTypesBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnWMTypesBtn, "testConnWMTypesBtn"); - this.testConnWMTypesBtn.Name = "testConnWMTypesBtn"; - this.testConnWMTypesBtn.UseVisualStyleBackColor = true; - this.testConnWMTypesBtn.Click += new System.EventHandler(this.testConnWMTypesBtn_Click); - // - // testConnWaterMetersBtn - // - this.testConnWaterMetersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.testConnWaterMetersBtn, "testConnWaterMetersBtn"); - this.testConnWaterMetersBtn.Name = "testConnWaterMetersBtn"; - this.testConnWaterMetersBtn.UseVisualStyleBackColor = true; - this.testConnWaterMetersBtn.Click += new System.EventHandler(this.testConnWaterMetersBtn_Click); - // - // createBenchDbBtn - // - this.createBenchDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createBenchDbBtn, "createBenchDbBtn"); - this.createBenchDbBtn.Name = "createBenchDbBtn"; - this.createBenchDbBtn.UseVisualStyleBackColor = true; - this.createBenchDbBtn.Click += new System.EventHandler(this.createbenchDbBtn_Click); - // - // createProceduresDbBtn - // - this.createProceduresDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createProceduresDbBtn, "createProceduresDbBtn"); - this.createProceduresDbBtn.Name = "createProceduresDbBtn"; - this.createProceduresDbBtn.UseVisualStyleBackColor = true; - this.createProceduresDbBtn.Click += new System.EventHandler(this.createProecduresDbBtn_Click); - // - // createWMTypesDbBtn - // - this.createWMTypesDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createWMTypesDbBtn, "createWMTypesDbBtn"); - this.createWMTypesDbBtn.Name = "createWMTypesDbBtn"; - this.createWMTypesDbBtn.UseVisualStyleBackColor = true; - this.createWMTypesDbBtn.Click += new System.EventHandler(this.createWMTypesDbBtn_Click); - // - // createWaterMetersDbBtn - // - this.createWaterMetersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.createWaterMetersDbBtn, "createWaterMetersDbBtn"); - this.createWaterMetersDbBtn.Name = "createWaterMetersDbBtn"; - this.createWaterMetersDbBtn.UseVisualStyleBackColor = true; - this.createWaterMetersDbBtn.Click += new System.EventHandler(this.createWaterMetersDbBtn_Click); - // - // DatabaseSettingsDlg - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.createWaterMetersDbBtn); - this.Controls.Add(this.createWMTypesDbBtn); - this.Controls.Add(this.createProceduresDbBtn); - this.Controls.Add(this.createBenchDbBtn); - this.Controls.Add(this.testConnWaterMetersBtn); - this.Controls.Add(this.testConnWMTypesBtn); - this.Controls.Add(this.testConnProceduresBtn); - this.Controls.Add(this.testConnBenchBtn); - this.Controls.Add(this.watermetersDbTypeComboBox); - this.Controls.Add(this.wmTypesDbTypeComboBox); - this.Controls.Add(this.proceduresDbTypeComboBox); - this.Controls.Add(this.benchDbTypeComboBox); - this.Controls.Add(this.usersDbTypeComboBox); - this.Controls.Add(this.dbTypeLabel); - this.Controls.Add(this.realBenchCheckBox); - this.Controls.Add(this.createUsersDbBtn); - this.Controls.Add(this.testConnUsersBtn); - this.Controls.Add(this.label6); - this.Controls.Add(this.label5); - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.watermetersConnectionStringTextBox); - this.Controls.Add(this.wmTypesConnectionStringTextBox); - this.Controls.Add(this.proceduresConnectionStringTextBox); - this.Controls.Add(this.benchConnectionStringTextBox); - this.Controls.Add(this.connectionStringLabel); - this.Controls.Add(this.usersConnectionStringTextBox); - this.Controls.Add(this.benchNameTextBox); - this.Controls.Add(this.label1); - this.Controls.Add(this.okButton); - this.Controls.Add(this.cancelButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MinimizeBox = false; - this.Name = "DatabaseSettingsDlg"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Load += new System.EventHandler(this.BenchSettingsDlg_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox benchNameTextBox; - private System.Windows.Forms.TextBox usersConnectionStringTextBox; - private System.Windows.Forms.Label connectionStringLabel; - private System.Windows.Forms.TextBox benchConnectionStringTextBox; - private System.Windows.Forms.TextBox proceduresConnectionStringTextBox; - private System.Windows.Forms.TextBox wmTypesConnectionStringTextBox; - private System.Windows.Forms.TextBox watermetersConnectionStringTextBox; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Button testConnUsersBtn; - private System.Windows.Forms.Button createUsersDbBtn; - private System.Windows.Forms.CheckBox realBenchCheckBox; - private System.Windows.Forms.Label dbTypeLabel; - private System.Windows.Forms.ComboBox usersDbTypeComboBox; - private System.Windows.Forms.ComboBox benchDbTypeComboBox; - private System.Windows.Forms.ComboBox proceduresDbTypeComboBox; - private System.Windows.Forms.ComboBox wmTypesDbTypeComboBox; - private System.Windows.Forms.ComboBox watermetersDbTypeComboBox; - private System.Windows.Forms.Button testConnBenchBtn; - private System.Windows.Forms.Button testConnProceduresBtn; - private System.Windows.Forms.Button testConnWMTypesBtn; - private System.Windows.Forms.Button testConnWaterMetersBtn; - private System.Windows.Forms.Button createBenchDbBtn; - private System.Windows.Forms.Button createProceduresDbBtn; - private System.Windows.Forms.Button createWMTypesDbBtn; - private System.Windows.Forms.Button createWaterMetersDbBtn; - } -} \ No newline at end of file diff --git a/ResultsBrowser/DatabaseSettingsDlg.cs b/ResultsBrowser/DatabaseSettingsDlg.cs deleted file mode 100644 index af6effe5f..000000000 --- a/ResultsBrowser/DatabaseSettingsDlg.cs +++ /dev/null @@ -1,264 +0,0 @@ -/// -/// Copyright (c) 2015 Sensus Metering Systems -/// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using ResultsBrowser.Resources; - -namespace ResultsBrowser -{ - /// - /// Dialog to process test bench name and database settings (BenchSettings) - /// - public partial class DatabaseSettingsDlg : Form - { - // Reference to bench DB settins (not a local copy) - Config.DatabaseSettings bench; - - /// - /// Constructor - /// - /// Test bench database settings - public DatabaseSettingsDlg(Config.DatabaseSettings bench) - { - this.bench = bench; - - InitializeComponent(); - } - - void Localize() - { - Text = Strings.Test_Bench_Databases_Specification; - label1.Text = Strings.Test_bench_name; - realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer; - dbTypeLabel.Text = Strings.Database_type; - connectionStringLabel.Text = Strings.Connection_string; - label2.Text = Strings.Users_and_groups; - label3.Text = Strings.Bench_parameters; - label4.Text = Strings.Procedures; - label5.Text = Strings.Water_meter_types; - label6.Text = Strings.Water_meter_data; - okButton.Text = Strings.OkBtnText; - cancelButton.Text = Strings.CancelBtnText; - - testConnBenchBtn.Text = Strings.Test_connection; - testConnProceduresBtn.Text = Strings.Test_connection; - testConnUsersBtn.Text = Strings.Test_connection; - testConnWaterMetersBtn.Text = Strings.Test_connection; - testConnWMTypesBtn.Text = Strings.Test_connection; - - createBenchDbBtn.Text = Strings.Create_DB; - createProceduresDbBtn.Text = Strings.Create_DB; - createUsersDbBtn.Text = Strings.Create_DB; - createWaterMetersDbBtn.Text = Strings.Create_DB; - createWMTypesDbBtn.Text = Strings.Create_DB; - } - - private void BenchSettingsDlg_Load(object sender, EventArgs e) - { - Localize(); - - benchNameTextBox.Text = bench.BenchName; - realBenchCheckBox.Checked = bench.IsRealBench; - - /// Initialize 'Database type' combo-boxes - for (int i = 0; i < (int)Config.Entities.DBType.DbTypesCount; i++) - { - Config.Entities.DBType dbType = (Config.Entities.DBType)i; - usersDbTypeComboBox.Items.Add(dbType); - benchDbTypeComboBox.Items.Add(dbType); - proceduresDbTypeComboBox.Items.Add(dbType); - wmTypesDbTypeComboBox.Items.Add(dbType); - watermetersDbTypeComboBox.Items.Add(dbType); - } - usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType; - benchDbTypeComboBox.SelectedIndex = (int)bench.BenchDBSettings.DbType; - proceduresDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType; - wmTypesDbTypeComboBox.SelectedIndex = (int)bench.WMTypesDBSettings.DbType; - watermetersDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType; - - /// Initialize connection strings - usersConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString; - benchConnectionStringTextBox.Text = bench.BenchDBSettings.ConnectionString; - proceduresConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString; - wmTypesConnectionStringTextBox.Text = bench.WMTypesDBSettings.ConnectionString; - watermetersConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString; - } - - bool UpdateBenchFromUIControls() - { - for (int i = 0; i < Program.LocalSettings.BenchesCount; i++) - { - if (bench != Program.LocalSettings.TestBenches[i] && - benchNameTextBox.Text == Program.LocalSettings.TestBenches[i].BenchName) - { - MessageBox.Show(Strings.Bench_name_conflict_Use_another_name_pls, Strings.Error, MessageBoxButtons.OK); - return false; - } - } - - bench.BenchName = benchNameTextBox.Text; - bench.IsRealBench = realBenchCheckBox.Checked; - - bench.UsersDBSettings.ConnectionString = usersConnectionStringTextBox.Text; - bench.BenchDBSettings.ConnectionString = benchConnectionStringTextBox.Text; - bench.ProceduresDBSettings.ConnectionString = proceduresConnectionStringTextBox.Text; - bench.WMTypesDBSettings.ConnectionString = wmTypesConnectionStringTextBox.Text; - bench.WaterMetersDBSettings.ConnectionString = watermetersConnectionStringTextBox.Text; - - bench.UsersDBSettings.DbType = (Config.Entities.DBType)usersDbTypeComboBox.SelectedIndex; - bench.BenchDBSettings.DbType = (Config.Entities.DBType)benchDbTypeComboBox.SelectedIndex; - bench.ProceduresDBSettings.DbType = (Config.Entities.DBType)proceduresDbTypeComboBox.SelectedIndex; - bench.WMTypesDBSettings.DbType = (Config.Entities.DBType)wmTypesDbTypeComboBox.SelectedIndex; - bench.WaterMetersDBSettings.DbType = (Config.Entities.DBType)watermetersDbTypeComboBox.SelectedIndex; - - return true; - } - - /// - /// Update bench DB setting, return 'OK' - /// - /// Not used - /// Not used - private void okButton_Click(object sender, EventArgs e) - { - if (UpdateBenchFromUIControls()) - { - DialogResult = DialogResult.OK; - Close(); - return; - } - - DialogResult = DialogResult.None; - } - - /// - /// Throw away changes, return 'Cancel' - /// - /// Not used - /// Not used - private void cancelButton_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - Close(); - } - - private void createDatabasesButton_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - Config.FluentCommon.CreateEmptyUsersDB(bench.UsersDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (Exception exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void createbenchDbBtn_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - Config.FluentCommon.CreateEmptyBenchDB(bench.BenchDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (Exception exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void createProecduresDbBtn_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - Config.FluentCommon.CreateEmptyProceduresDB(bench.ProceduresDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (Exception exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void createWMTypesDbBtn_Click(object sender, EventArgs e) - { - - } - - private void createWaterMetersDbBtn_Click(object sender, EventArgs e) - { - if (!UpdateBenchFromUIControls()) return; - - if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine + - Strings.Do_you_want_to_proceed, Strings.Warning, - MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)) - try - { - Cursor.Current = Cursors.WaitCursor; - Config.FluentCommon.CreateEmptyWaterMetersDB(bench.WaterMetersDBSettings); - MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification); - Cursor.Current = Cursors.Default; - DialogResult = DialogResult.None; - } - catch (Exception exception) - { - Cursor.Current = Cursors.Default; - MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error); - } - } - - private void testConnUsersBtn_Click(object sender, EventArgs e) - { - } - - private void testConnBenchBtn_Click(object sender, EventArgs e) - { - } - - private void testConnProceduresBtn_Click(object sender, EventArgs e) - { - } - - private void testConnWMTypesBtn_Click(object sender, EventArgs e) - { - } - - private void testConnWaterMetersBtn_Click(object sender, EventArgs e) - { - } - } -} \ No newline at end of file diff --git a/ResultsBrowser/DatabaseSettingsDlg.resx b/ResultsBrowser/DatabaseSettingsDlg.resx deleted file mode 100644 index 9e8ff90fa..000000000 --- a/ResultsBrowser/DatabaseSettingsDlg.resx +++ /dev/null @@ -1,930 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 614, 15 - - - 217, 28 - - - - 14 - - - OK - - - okButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 30 - - - 614, 49 - - - 217, 28 - - - 13 - - - Cancel - - - cancelButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 31 - - - True - - - 12, 18 - - - 93, 13 - - - 15 - - - Test Bench Name - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 29 - - - 116, 15 - - - 315, 20 - - - 16 - - - benchNameTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 28 - - - 202, 101 - - - 406, 20 - - - 17 - - - usersConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 27 - - - True - - - 199, 82 - - - 89, 13 - - - 18 - - - Connection string - - - connectionStringLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 26 - - - 202, 127 - - - 406, 20 - - - 19 - - - benchConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 25 - - - 202, 153 - - - 406, 20 - - - 20 - - - proceduresConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 24 - - - 202, 179 - - - 406, 20 - - - 21 - - - wmTypesConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 23 - - - 202, 205 - - - 406, 20 - - - 22 - - - watermetersConnectionStringTextBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 22 - - - True - - - 12, 104 - - - 90, 13 - - - 47 - - - Users and groups - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 21 - - - True - - - 12, 130 - - - 93, 13 - - - 48 - - - Bench parameters - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 20 - - - True - - - 12, 156 - - - 61, 13 - - - 49 - - - Procedures - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 19 - - - True - - - 12, 182 - - - 90, 13 - - - 50 - - - Watermeter types - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 18 - - - True - - - 12, 208 - - - 67, 13 - - - 51 - - - Watermeters - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 17 - - - 614, 99 - - - 95, 23 - - - 52 - - - Test Connection - - - testConnUsersBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 16 - - - 711, 99 - - - 120, 23 - - - 53 - - - Create DB - - - createUsersDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 15 - - - True - - - 116, 47 - - - 219, 17 - - - 54 - - - Test bench is controlled by this computer - - - realBenchCheckBox - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 14 - - - True - - - 113, 82 - - - 76, 13 - - - 55 - - - Database type - - - dbTypeLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 13 - - - 116, 101 - - - 80, 21 - - - 56 - - - usersDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 12 - - - 116, 127 - - - 80, 21 - - - 57 - - - benchDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 11 - - - 116, 153 - - - 80, 21 - - - 58 - - - proceduresDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 10 - - - 116, 179 - - - 80, 21 - - - 59 - - - wmTypesDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - - - 116, 205 - - - 80, 21 - - - 60 - - - watermetersDbTypeComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - - - - NoControl - - - 614, 125 - - - 95, 23 - - - 61 - - - Test Connection - - - testConnBenchBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - NoControl - - - 614, 151 - - - 95, 23 - - - 62 - - - Test Connection - - - testConnProceduresBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 6 - - - NoControl - - - 614, 177 - - - 95, 23 - - - 63 - - - Test Connection - - - testConnWMTypesBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - NoControl - - - 614, 203 - - - 95, 23 - - - 64 - - - Test Connection - - - testConnWaterMetersBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - NoControl - - - 711, 124 - - - 120, 23 - - - 65 - - - Create DB - - - createBenchDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - NoControl - - - 711, 150 - - - 120, 23 - - - 66 - - - Create DB - - - createProceduresDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - NoControl - - - 711, 176 - - - 120, 23 - - - 67 - - - Create DB - - - createWMTypesDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - NoControl - - - 711, 202 - - - 120, 23 - - - 68 - - - Create DB - - - createWaterMetersDbBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 6, 13 - - - 836, 241 - - - CenterParent - - - Test Bench Databases Specification - - - DatabaseSettingsDlg - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ResultsBrowser/MainWnd.cs b/ResultsBrowser/MainWnd.cs index 464bf3456..f501b6df0 100644 --- a/ResultsBrowser/MainWnd.cs +++ b/ResultsBrowser/MainWnd.cs @@ -118,7 +118,7 @@ namespace ResultsBrowser try { - ISession session = FluentCommon.CreateSession(Database.Procedures); + ISession session = FluentCommon.CreateSession(DBKind.Config); IList testResults; IList partialTestResults; diff --git a/ResultsBrowser/Program.cs b/ResultsBrowser/Program.cs index cc0da5671..62df99dd7 100644 --- a/ResultsBrowser/Program.cs +++ b/ResultsBrowser/Program.cs @@ -189,7 +189,7 @@ namespace ResultsBrowser { /// Load user from the UsersAndGroupsDB database loadedUser = User.LoadUserByName(loginDlgBench.User, - LocalSettings.TestBenches[i].UsersDBSettings); + LocalSettings.TestBenches[i].ProceduresDBSettings); if (loadedUser != null) { authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password); diff --git a/ResultsBrowser/ResultsBrowser.csproj b/ResultsBrowser/ResultsBrowser.csproj index 188cd6683..06214fef8 100644 --- a/ResultsBrowser/ResultsBrowser.csproj +++ b/ResultsBrowser/ResultsBrowser.csproj @@ -79,12 +79,6 @@ BenchesDlg.cs - - Form - - - DatabaseSettingsDlg.cs - Form @@ -129,9 +123,6 @@ BenchesDlg.cs - - DatabaseSettingsDlg.cs - AdditionalDataDlg.cs diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs index 4f62975e7..c1f6e3cd8 100644 --- a/TestBenchFramework/BenchControl/StateMachine.cs +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -224,7 +224,7 @@ namespace TBF.BenchControl { /// Load the list of components (entities) from the database. /// Then create the components (derived from IComponent). - components = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Config.Database.Bench)); + components = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config)); MasterValves = GenericDevices.ValveBase.MasterValves(components); CoupledValves = GenericDevices.ValveBase.CoupledValves(components); ExtendedValves = GenericDevices.ValveBase.ExtendedValves(components); @@ -331,7 +331,7 @@ namespace TBF.BenchControl public static void LoadProcedure(bool loadPathsOnly) { - ISession session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + ISession session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); WtSession = session; feedingPaths = session.CreateQuery("FROM FeedingPath ORDER BY ItemNr").List(); diff --git a/TestBenchFramework/ComponentsManagerDlg.cs b/TestBenchFramework/ComponentsManagerDlg.cs index 383e61973..454739715 100644 --- a/TestBenchFramework/ComponentsManagerDlg.cs +++ b/TestBenchFramework/ComponentsManagerDlg.cs @@ -107,7 +107,7 @@ namespace TBF sharedButtons.DisableButtons(UiControls.SharedButtons.Buttons.Remove | UiControls.SharedButtons.Buttons.Edit); - session = Config.FluentCommon.CreateSession(Config.Database.Bench); + session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); cmpntEntities = session .CreateQuery("FROM Component ORDER BY ItemNr") .List(); diff --git a/TestBenchFramework/Forms/EditUsers.cs b/TestBenchFramework/Forms/EditUsers.cs index bbf01f52e..6b3954d68 100644 --- a/TestBenchFramework/Forms/EditUsers.cs +++ b/TestBenchFramework/Forms/EditUsers.cs @@ -34,7 +34,7 @@ namespace TBF.Forms private void EditUsers_Activated(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; - session = Config.FluentCommon.CreateSession(Config.Database.Users); + session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); ListUsers(); RefreshButtonStates(); } diff --git a/TestBenchFramework/MainWnd.cs b/TestBenchFramework/MainWnd.cs index 7950b4bc2..5d6214fdb 100644 --- a/TestBenchFramework/MainWnd.cs +++ b/TestBenchFramework/MainWnd.cs @@ -362,7 +362,7 @@ namespace TBF { string oriProcName = procedureComboBox.Text; - IList procedures = Config.FluentCommon.CreateSession(Config.Database.Procedures) + IList procedures = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config) .CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' ORDER BY ItemNr") .List(); @@ -479,7 +479,7 @@ namespace TBF string purchaseOrder = dlg.PurchaseOrder; string tester = dlg.Tester; - NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); IList testResults = session .CreateQuery("FROM TestResult WHERE PurchaseOrder = :purchaseOrder") diff --git a/TestBenchFramework/MetrologyDlg.cs b/TestBenchFramework/MetrologyDlg.cs index 55aba5506..2304d8c76 100644 --- a/TestBenchFramework/MetrologyDlg.cs +++ b/TestBenchFramework/MetrologyDlg.cs @@ -50,7 +50,7 @@ namespace TBF int flowMetersCount = 0; int pressMetersCount = 0; - session = Config.FluentCommon.CreateSession(Config.Database.Bench); + session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); cmpntEntities = session.CreateQuery("FROM Component ORDER BY ItemNr") .List(); diff --git a/TestBenchFramework/PathsDlg.cs b/TestBenchFramework/PathsDlg.cs index 6d2259c34..e94a197ef 100644 --- a/TestBenchFramework/PathsDlg.cs +++ b/TestBenchFramework/PathsDlg.cs @@ -53,13 +53,13 @@ namespace TBF sharedButtons.DownClicked += downButton_Click; /// Load the list of components from the database - TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Config.Database.Bench)); + TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config)); /// Find all master valves Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents); /// Create the database session for paths - Session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + Session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); pathsTabControl.TabPages[(int)PathsDlgTabs.Feeding].Tag = pathsFeedingCtrl; pathsTabControl.TabPages[(int)PathsDlgTabs.Bench].Tag = pathsBenchCtrl; diff --git a/TestBenchFramework/ProcedureDlg.cs b/TestBenchFramework/ProcedureDlg.cs index b98f6b5ad..c9b71f019 100644 --- a/TestBenchFramework/ProcedureDlg.cs +++ b/TestBenchFramework/ProcedureDlg.cs @@ -90,7 +90,7 @@ namespace TBF LoadedProcedure = procedure; /// Prepare a list of components and a list of all valves in the test bench - using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Database.Bench)) + using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config)) { TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(session); Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents); @@ -110,7 +110,7 @@ namespace TBF } /// Loads paths, this must be done before PrepareMetrology12AndProcessTabs() call - using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Database.Procedures)) + using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config)) { feedingPaths = session.CreateQuery("FROM FeedingPath").List(); benchPaths = session.CreateQuery("FROM BenchPath").List(); @@ -391,7 +391,7 @@ namespace TBF void RefreshHistoryTab() { - NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + NHibernate.ISession session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); IList procedures = session .CreateQuery("FROM Procedure WHERE ProcedureState = 'History'") .List(); diff --git a/TestBenchFramework/Program.cs b/TestBenchFramework/Program.cs index 7d78678dd..088836c3e 100644 --- a/TestBenchFramework/Program.cs +++ b/TestBenchFramework/Program.cs @@ -205,7 +205,7 @@ namespace TBF { /// Load user from the UsersAndGroupsDB database loadedUser = User.LoadUserByName(loginDlgBench.User, - LocalSettings.TestBenches[i].UsersDBSettings); + LocalSettings.TestBenches[i].ProceduresDBSettings); if (loadedUser != null) { authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password); @@ -265,7 +265,7 @@ namespace TBF /// if (LocalSettings.LastProcedureName != null) { - IList listOfProcedures = Config.FluentCommon.CreateSession(Config.Database.Procedures) + IList listOfProcedures = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config) .CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' AND Name = :procName") .SetParameter("procName", LocalSettings.LastProcedureName) .List(); diff --git a/TestBenchFramework/TransitionsDlg.cs b/TestBenchFramework/TransitionsDlg.cs index 3eaf2efb2..78a38024f 100644 --- a/TestBenchFramework/TransitionsDlg.cs +++ b/TestBenchFramework/TransitionsDlg.cs @@ -93,7 +93,7 @@ namespace TBF Top = (ls.TransitionsDlgTop != 0) ? ls.TransitionsDlgTop : 150; /// Open the database - Session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + Session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); /// Prepare a list of components and a list of all valves in the test bench TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Session); diff --git a/TestBenchFramework/UiControls/BenchControlPanel.cs b/TestBenchFramework/UiControls/BenchControlPanel.cs index d68876304..991c8f9d8 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.cs +++ b/TestBenchFramework/UiControls/BenchControlPanel.cs @@ -113,7 +113,7 @@ namespace TBF.UiControls string oriTestName = testComboBox.Text; - IList procedures = Config.FluentCommon.CreateSession(Config.Database.Procedures) + IList procedures = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config) .CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' AND Name = :name") .SetParameter("name", Program.MainWnd.ProcedureName) .List(); diff --git a/TestBenchFramework/UiControls/ProceduresCtrl.cs b/TestBenchFramework/UiControls/ProceduresCtrl.cs index 61ea95ffc..66e2b4042 100644 --- a/TestBenchFramework/UiControls/ProceduresCtrl.cs +++ b/TestBenchFramework/UiControls/ProceduresCtrl.cs @@ -67,7 +67,7 @@ namespace TBF.UiControls void ReloadAndRedrawAll() { /// Load the procedures - session = Config.FluentCommon.CreateSession(Config.Database.Procedures); + session = Config.FluentCommon.CreateSession(Config.Entities.DBKind.Config); MyItems = session.CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' ORDER BY ItemNr") .List();