diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index 448121b..c1dec1e 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -82,6 +82,12 @@ frmAuftraggeberEdit.cs + + Form + + + frmExceptionWindow.cs + Form @@ -174,6 +180,9 @@ frmAuftraggeberEdit.cs + + frmExceptionWindow.cs + frmKalibrierungFestlegung.cs diff --git a/SanSystem/frmExceptionWindow.Designer.cs b/SanSystem/frmExceptionWindow.Designer.cs new file mode 100644 index 0000000..f5b15a4 --- /dev/null +++ b/SanSystem/frmExceptionWindow.Designer.cs @@ -0,0 +1,78 @@ +namespace SanSystem +{ + partial class frmExceptionWindow + { + /// + /// 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() + { + this.button1 = new System.Windows.Forms.Button(); + this.txt_error = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button1.Location = new System.Drawing.Point(12, 389); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(911, 75); + this.button1.TabIndex = 0; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1_Click); + // + // txt_error + // + this.txt_error.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txt_error.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txt_error.Location = new System.Drawing.Point(12, 12); + this.txt_error.Multiline = true; + this.txt_error.Name = "txt_error"; + this.txt_error.Size = new System.Drawing.Size(911, 371); + this.txt_error.TabIndex = 1; + // + // frmExceptionWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(935, 476); + this.ControlBox = false; + this.Controls.Add(this.txt_error); + this.Controls.Add(this.button1); + this.Name = "frmExceptionWindow"; + this.Text = "ExceptionWindow"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox txt_error; + } +} \ No newline at end of file diff --git a/SanSystem/frmExceptionWindow.cs b/SanSystem/frmExceptionWindow.cs new file mode 100644 index 0000000..4d29382 --- /dev/null +++ b/SanSystem/frmExceptionWindow.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SanSystem +{ + /// + /// + /// + public partial class frmExceptionWindow : Form + { + /// + /// + /// + /// + public frmExceptionWindow(string message) + { + InitializeComponent(); + txt_error.Text = message; + txt_error.ReadOnly = true; + } + + private void Button1_Click(object sender, EventArgs e) + { + Environment.Exit(0); + } + } +} diff --git a/SanSystem/frmExceptionWindow.resx b/SanSystem/frmExceptionWindow.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SanSystem/frmExceptionWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index 992c045..770d4f9 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -37,10 +37,11 @@ namespace SanSystem { Datenbank.Instance.LoadProjekt(Global.Instance.ProjektNummer, Global.Instance.Projektpfad);// Path.Combine(Global.Instance.Projektpfad,"18-850.xaml")); } - catch(DataBaseVersionMismatchException) + catch(DataBaseVersionMismatchException ex) { - MessageBox.Show("Database version mistmatch\nProgramm wird beendet"); - Environment.Exit(0); + frmExceptionWindow frmException = new frmExceptionWindow(ex.Message); + frmException.FormClosed += FrmException_FormClosed; + frmException.ShowDialog(); } //Datenbank.Instance.CreateProjekt(""); @@ -56,17 +57,22 @@ namespace SanSystem toolStripStatus_projekt_Label.Text = Datenbank.Instance.projekt; this.Text += " " + Global.Instance.PROGRAMMVERSION; + #if (DEBUG || LAPTOP) this.Text += " INTERNE DEBUG VERSION"; #endif if (Wupi.QueryInfo(0, QueryInfoOption.FirmCode) == 0) this.Text += " nicht geschützter Version nur für TESTZWECKE!"; + + } - - + private void FrmException_FormClosed(object sender, FormClosedEventArgs e) + { + Environment.Exit(0); + } private void frm_main_Load(object sender, EventArgs e) {