diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs index 06481f6b..94cc1ddc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs @@ -109,19 +109,22 @@ namespace VEPROMS.CSLA.Library } private static string ChooseDatabase(string constr) { - if (LastDatabase != "NoDefault" && LastDatabase != "") + if (_SelectedDatabase == null) { - if (System.Windows.Forms.MessageBox.Show("Open " + LastDatabase, "Reopen Last Database", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + if (LastDatabase != "NoDefault" && LastDatabase != "") { - SelectedDatabase = LastDatabase; - return constr.Replace("{MENU}", _SelectedDatabase); + if (System.Windows.Forms.MessageBox.Show("Open " + LastDatabase, "Reopen Last Database", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + { + SelectedDatabase = LastDatabase; + return constr.Replace("{MENU}", _SelectedDatabase); + } + } + System.Windows.Forms.ContextMenuStrip cms = BuildDatabaseMenu(constr); + while (_SelectedDatabase == null) + { + cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); + System.Windows.Forms.Application.DoEvents(); } - } - System.Windows.Forms.ContextMenuStrip cms = BuildDatabaseMenu(constr); - while (_SelectedDatabase == null) - { - cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); - System.Windows.Forms.Application.DoEvents(); } return constr.Replace("{MENU}", _SelectedDatabase); }