From a306dc1e57fcd122b2739d490cd5f8cb470c4bce Mon Sep 17 00:00:00 2001 From: Damian Wessels Date: Sun, 11 Dec 2022 14:50:09 +0100 Subject: [PATCH] wenn projekt null ist, soll man kein MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Objekt hinzufügen dürfen --- SanSystem/Database/Datenbank.cs | 11 +++- SanSystem/FrmAktuelleBesatzung.Designer.cs | 10 +-- SanSystem/FrmSelectMassenDate.cs | 2 + SanSystem/frmObjektEdit.Designer.cs | 76 +++++++++++----------- SanSystem/frmObjekteList.Designer.cs | 31 ++++----- SanSystem/frmStrassenList.cs | 5 ++ 6 files changed, 75 insertions(+), 60 deletions(-) diff --git a/SanSystem/Database/Datenbank.cs b/SanSystem/Database/Datenbank.cs index dfea20e..a24cc22 100644 --- a/SanSystem/Database/Datenbank.cs +++ b/SanSystem/Database/Datenbank.cs @@ -9,6 +9,7 @@ using System.IO.Compression; using System.Diagnostics; using KlassenBIB; using SanShared.Exceptions; +using System.Windows.Forms; namespace Database { @@ -82,8 +83,14 @@ namespace Database public void SaveProjekt() { string filepath = Path.Combine(pfad, "projekte", "TeufelDB.xaml"); - Trace.WriteLine(filepath); - XamlServices.Save(filepath, TeufelDB); + try + { + XamlServices.Save(filepath, TeufelDB); + } + catch(UnauthorizedAccessException ex) + { + MessageBox.Show("Fehler beim speichern " + ex.Message); + } } } } diff --git a/SanSystem/FrmAktuelleBesatzung.Designer.cs b/SanSystem/FrmAktuelleBesatzung.Designer.cs index b0add2b..2f18b83 100644 --- a/SanSystem/FrmAktuelleBesatzung.Designer.cs +++ b/SanSystem/FrmAktuelleBesatzung.Designer.cs @@ -42,9 +42,9 @@ namespace SanSystem this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(12, 9); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(415, 20); + this.label1.Size = new System.Drawing.Size(475, 25); this.label1.TabIndex = 0; - this.label1.Text = "Wer möchte sich Heute die Weltherschaft an sich reißen?"; + this.label1.Text = "Wer möchte Heute die Weltherrschaft an sich reißen?"; // // label2 // @@ -52,7 +52,7 @@ namespace SanSystem this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(244, 35); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(13, 20); + this.label2.Size = new System.Drawing.Size(18, 25); this.label2.TabIndex = 1; this.label2.Text = "/"; // @@ -61,7 +61,7 @@ namespace SanSystem this.txt_vorarbeiter.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_vorarbeiter.Location = new System.Drawing.Point(12, 32); this.txt_vorarbeiter.Name = "txt_vorarbeiter"; - this.txt_vorarbeiter.Size = new System.Drawing.Size(226, 26); + this.txt_vorarbeiter.Size = new System.Drawing.Size(226, 30); this.txt_vorarbeiter.TabIndex = 2; // // txt_nacharbeiter @@ -69,7 +69,7 @@ namespace SanSystem this.txt_nacharbeiter.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_nacharbeiter.Location = new System.Drawing.Point(263, 32); this.txt_nacharbeiter.Name = "txt_nacharbeiter"; - this.txt_nacharbeiter.Size = new System.Drawing.Size(226, 26); + this.txt_nacharbeiter.Size = new System.Drawing.Size(226, 30); this.txt_nacharbeiter.TabIndex = 3; // // btn_ok diff --git a/SanSystem/FrmSelectMassenDate.cs b/SanSystem/FrmSelectMassenDate.cs index 1f0acc8..a2e338c 100644 --- a/SanSystem/FrmSelectMassenDate.cs +++ b/SanSystem/FrmSelectMassenDate.cs @@ -33,6 +33,8 @@ namespace SanSystem { MassenStatistik massenStatistik = null; List objekte; + + // TODO Objekte können noch null sein, unter if (inspektionsobjekts == null) objekte = Datenbank.Instance.loadedProjekt.Objekte; else diff --git a/SanSystem/frmObjektEdit.Designer.cs b/SanSystem/frmObjektEdit.Designer.cs index f45e46d..bcdea2f 100644 --- a/SanSystem/frmObjektEdit.Designer.cs +++ b/SanSystem/frmObjektEdit.Designer.cs @@ -108,10 +108,10 @@ // tabPage2 // this.tabPage2.Controls.Add(this.dgv_sanierungen); - this.tabPage2.Location = new System.Drawing.Point(4, 29); + this.tabPage2.Location = new System.Drawing.Point(4, 34); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(1282, 656); + this.tabPage2.Size = new System.Drawing.Size(1282, 651); this.tabPage2.TabIndex = 2; this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; @@ -130,10 +130,10 @@ // Kanalinformationen // this.Kanalinformationen.Controls.Add(this.dgv_schadenkuerzel); - this.Kanalinformationen.Location = new System.Drawing.Point(4, 29); + this.Kanalinformationen.Location = new System.Drawing.Point(4, 34); this.Kanalinformationen.Name = "Kanalinformationen"; this.Kanalinformationen.Padding = new System.Windows.Forms.Padding(3); - this.Kanalinformationen.Size = new System.Drawing.Size(1282, 656); + this.Kanalinformationen.Size = new System.Drawing.Size(1282, 651); this.Kanalinformationen.TabIndex = 1; this.Kanalinformationen.Text = "Kanalinformationen"; this.Kanalinformationen.UseVisualStyleBackColor = true; @@ -182,11 +182,11 @@ this.tabPage1.Controls.Add(this.label2); this.tabPage1.Controls.Add(this.label1); this.tabPage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tabPage1.Location = new System.Drawing.Point(4, 29); + this.tabPage1.Location = new System.Drawing.Point(4, 34); this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.tabPage1.Size = new System.Drawing.Size(1282, 656); + this.tabPage1.Size = new System.Drawing.Size(1282, 651); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Grunddaten"; this.tabPage1.UseVisualStyleBackColor = true; @@ -208,9 +208,9 @@ this.cb_overrideAuftraggeber.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cb_overrideAuftraggeber.Location = new System.Drawing.Point(590, 191); this.cb_overrideAuftraggeber.Name = "cb_overrideAuftraggeber"; - this.cb_overrideAuftraggeber.Size = new System.Drawing.Size(190, 24); + this.cb_overrideAuftraggeber.Size = new System.Drawing.Size(279, 29); this.cb_overrideAuftraggeber.TabIndex = 33; - this.cb_overrideAuftraggeber.Text = "Spezielle Auftraggeber"; + this.cb_overrideAuftraggeber.Text = "Auftraggeber Überschreiben"; this.cb_overrideAuftraggeber.UseVisualStyleBackColor = true; this.cb_overrideAuftraggeber.CheckedChanged += new System.EventHandler(this.Cb_overrideAuftraggeber_CheckedChanged); // @@ -219,7 +219,7 @@ this.txt_san_nr.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_san_nr.Location = new System.Drawing.Point(745, 29); this.txt_san_nr.Name = "txt_san_nr"; - this.txt_san_nr.Size = new System.Drawing.Size(191, 26); + this.txt_san_nr.Size = new System.Drawing.Size(191, 30); this.txt_san_nr.TabIndex = 7; // // txt_ort @@ -227,7 +227,7 @@ this.txt_ort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_ort.Location = new System.Drawing.Point(745, 145); this.txt_ort.Name = "txt_ort"; - this.txt_ort.Size = new System.Drawing.Size(191, 26); + this.txt_ort.Size = new System.Drawing.Size(191, 30); this.txt_ort.TabIndex = 9; // // txt_bemerkung @@ -243,7 +243,7 @@ this.txt_objekt_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_objekt_name.Location = new System.Drawing.Point(192, 67); this.txt_objekt_name.Name = "txt_objekt_name"; - this.txt_objekt_name.Size = new System.Drawing.Size(330, 26); + this.txt_objekt_name.Size = new System.Drawing.Size(330, 30); this.txt_objekt_name.TabIndex = 2; // // txt_hausnummer @@ -252,7 +252,7 @@ this.txt_hausnummer.Location = new System.Drawing.Point(745, 107); this.txt_hausnummer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_hausnummer.Name = "txt_hausnummer"; - this.txt_hausnummer.Size = new System.Drawing.Size(148, 26); + this.txt_hausnummer.Size = new System.Drawing.Size(148, 30); this.txt_hausnummer.TabIndex = 8; // // txt_strasse @@ -261,7 +261,7 @@ this.txt_strasse.Location = new System.Drawing.Point(745, 67); this.txt_strasse.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_strasse.Name = "txt_strasse"; - this.txt_strasse.Size = new System.Drawing.Size(320, 26); + this.txt_strasse.Size = new System.Drawing.Size(320, 30); this.txt_strasse.TabIndex = 7; // // txt_dn @@ -270,7 +270,7 @@ this.txt_dn.Location = new System.Drawing.Point(192, 201); this.txt_dn.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_dn.Name = "txt_dn"; - this.txt_dn.Size = new System.Drawing.Size(330, 26); + this.txt_dn.Size = new System.Drawing.Size(330, 30); this.txt_dn.TabIndex = 5; // // txt_punkt_bis @@ -279,7 +279,7 @@ this.txt_punkt_bis.Location = new System.Drawing.Point(192, 153); this.txt_punkt_bis.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_punkt_bis.Name = "txt_punkt_bis"; - this.txt_punkt_bis.Size = new System.Drawing.Size(330, 26); + this.txt_punkt_bis.Size = new System.Drawing.Size(330, 30); this.txt_punkt_bis.TabIndex = 4; this.txt_punkt_bis.Leave += new System.EventHandler(this.Txt_punkt_bis_Leave); // @@ -289,7 +289,7 @@ this.txt_punkt_von.Location = new System.Drawing.Point(192, 107); this.txt_punkt_von.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_punkt_von.Name = "txt_punkt_von"; - this.txt_punkt_von.Size = new System.Drawing.Size(330, 26); + this.txt_punkt_von.Size = new System.Drawing.Size(330, 30); this.txt_punkt_von.TabIndex = 3; this.txt_punkt_von.TextChanged += new System.EventHandler(this.txt_punkt_von_TextChanged); // @@ -299,7 +299,7 @@ this.txt_pro_nr.Location = new System.Drawing.Point(192, 31); this.txt_pro_nr.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_pro_nr.Name = "txt_pro_nr"; - this.txt_pro_nr.Size = new System.Drawing.Size(330, 26); + this.txt_pro_nr.Size = new System.Drawing.Size(330, 30); this.txt_pro_nr.TabIndex = 1; // // label9 @@ -308,7 +308,7 @@ this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Location = new System.Drawing.Point(585, 32); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(66, 20); + this.label9.Size = new System.Drawing.Size(84, 25); this.label9.TabIndex = 32; this.label9.Text = "SAN. Nr"; // @@ -331,7 +331,7 @@ this.cb_objekname_man.AutoSize = true; this.cb_objekname_man.Location = new System.Drawing.Point(108, 70); this.cb_objekname_man.Name = "cb_objekname_man"; - this.cb_objekname_man.Size = new System.Drawing.Size(59, 20); + this.cb_objekname_man.Size = new System.Drawing.Size(72, 24); this.cb_objekname_man.TabIndex = 29; this.cb_objekname_man.Text = "man?"; this.cb_objekname_man.UseVisualStyleBackColor = true; @@ -343,7 +343,7 @@ this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label8.Location = new System.Drawing.Point(601, 340); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(91, 20); + this.label8.Size = new System.Drawing.Size(112, 25); this.label8.TabIndex = 28; this.label8.Text = "Bemerkung"; // @@ -353,7 +353,7 @@ this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label7.Location = new System.Drawing.Point(584, 148); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(31, 20); + this.label7.Size = new System.Drawing.Size(39, 25); this.label7.TabIndex = 27; this.label7.Text = "Ort"; // @@ -363,7 +363,7 @@ this.lbl_objektname.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_objektname.Location = new System.Drawing.Point(9, 70); this.lbl_objektname.Name = "lbl_objektname"; - this.lbl_objektname.Size = new System.Drawing.Size(95, 20); + this.lbl_objektname.Size = new System.Drawing.Size(118, 25); this.lbl_objektname.TabIndex = 25; this.lbl_objektname.Text = "Objektname"; // @@ -410,7 +410,7 @@ "Ziegelwerk"}); this.cb_material.Location = new System.Drawing.Point(192, 252); this.cb_material.Name = "cb_material"; - this.cb_material.Size = new System.Drawing.Size(323, 28); + this.cb_material.Size = new System.Drawing.Size(323, 33); this.cb_material.TabIndex = 6; // // groupBox2 @@ -432,7 +432,7 @@ this.txt_haltungslaenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_haltungslaenge.Location = new System.Drawing.Point(188, 21); this.txt_haltungslaenge.Name = "txt_haltungslaenge"; - this.txt_haltungslaenge.Size = new System.Drawing.Size(136, 26); + this.txt_haltungslaenge.Size = new System.Drawing.Size(136, 30); this.txt_haltungslaenge.TabIndex = 11; // // txt_laenge_schacht @@ -440,7 +440,7 @@ this.txt_laenge_schacht.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_laenge_schacht.Location = new System.Drawing.Point(188, 112); this.txt_laenge_schacht.Name = "txt_laenge_schacht"; - this.txt_laenge_schacht.Size = new System.Drawing.Size(136, 26); + this.txt_laenge_schacht.Size = new System.Drawing.Size(136, 30); this.txt_laenge_schacht.TabIndex = 13; // // label21 @@ -449,7 +449,7 @@ this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label21.Location = new System.Drawing.Point(6, 114); this.label21.Name = "label21"; - this.label21.Size = new System.Drawing.Size(107, 20); + this.label21.Size = new System.Drawing.Size(132, 25); this.label21.TabIndex = 21; this.label21.Text = "Schachtlänge"; // @@ -459,7 +459,7 @@ this.cb_geschlossenesEnde.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cb_geschlossenesEnde.Location = new System.Drawing.Point(9, 75); this.cb_geschlossenesEnde.Name = "cb_geschlossenesEnde"; - this.cb_geschlossenesEnde.Size = new System.Drawing.Size(172, 24); + this.cb_geschlossenesEnde.Size = new System.Drawing.Size(210, 29); this.cb_geschlossenesEnde.TabIndex = 12; this.cb_geschlossenesEnde.Text = "Geschlossene Ende"; this.cb_geschlossenesEnde.UseVisualStyleBackColor = true; @@ -471,7 +471,7 @@ this.label6.Location = new System.Drawing.Point(5, 26); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(112, 20); + this.label6.Size = new System.Drawing.Size(137, 25); this.label6.TabIndex = 5; this.label6.Text = "Haltungslänge"; // @@ -484,7 +484,7 @@ this.dt_haltunggemessen_datum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.dt_haltunggemessen_datum.Name = "dt_haltunggemessen_datum"; this.dt_haltunggemessen_datum.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.dt_haltunggemessen_datum.Size = new System.Drawing.Size(354, 26); + this.dt_haltunggemessen_datum.Size = new System.Drawing.Size(354, 30); this.dt_haltunggemessen_datum.TabIndex = 10; // // label20 @@ -494,7 +494,7 @@ this.label20.Location = new System.Drawing.Point(8, 300); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(216, 20); + this.label20.Size = new System.Drawing.Size(265, 25); this.label20.TabIndex = 16; this.label20.Text = "Haltungslänge gemessen am"; // @@ -505,7 +505,7 @@ this.label19.Location = new System.Drawing.Point(584, 111); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(105, 20); + this.label19.Size = new System.Drawing.Size(129, 25); this.label19.TabIndex = 13; this.label19.Text = "Hausnummer"; // @@ -516,7 +516,7 @@ this.label18.Location = new System.Drawing.Point(584, 72); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(64, 20); + this.label18.Size = new System.Drawing.Size(79, 25); this.label18.TabIndex = 12; this.label18.Text = "Strasse"; // @@ -527,7 +527,7 @@ this.label5.Location = new System.Drawing.Point(9, 255); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(65, 20); + this.label5.Size = new System.Drawing.Size(81, 25); this.label5.TabIndex = 4; this.label5.Text = "Material"; // @@ -538,7 +538,7 @@ this.label4.Location = new System.Drawing.Point(9, 204); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(104, 20); + this.label4.Size = new System.Drawing.Size(128, 25); this.label4.TabIndex = 3; this.label4.Text = "Durchmesser"; // @@ -549,7 +549,7 @@ this.label3.Location = new System.Drawing.Point(9, 156); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(76, 20); + this.label3.Size = new System.Drawing.Size(94, 25); this.label3.TabIndex = 2; this.label3.Text = "Bis Punkt"; // @@ -560,7 +560,7 @@ this.label2.Location = new System.Drawing.Point(9, 110); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(83, 20); + this.label2.Size = new System.Drawing.Size(103, 25); this.label2.TabIndex = 1; this.label2.Text = "Von Punkt"; // @@ -571,7 +571,7 @@ this.label1.Location = new System.Drawing.Point(9, 35); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(116, 20); + this.label1.Size = new System.Drawing.Size(143, 25); this.label1.TabIndex = 0; this.label1.Text = "Projektnummer"; // @@ -591,7 +591,7 @@ // // frmObjektEdit // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.ClientSize = new System.Drawing.Size(1290, 689); diff --git a/SanSystem/frmObjekteList.Designer.cs b/SanSystem/frmObjekteList.Designer.cs index e903bb5..cab19cc 100644 --- a/SanSystem/frmObjekteList.Designer.cs +++ b/SanSystem/frmObjekteList.Designer.cs @@ -65,6 +65,7 @@ this.dGObjekte.Margin = new System.Windows.Forms.Padding(2); this.dGObjekte.MultiSelect = false; this.dGObjekte.Name = "dGObjekte"; + this.dGObjekte.RowHeadersWidth = 51; this.dGObjekte.RowTemplate.Height = 24; this.dGObjekte.Size = new System.Drawing.Size(499, 238); this.dGObjekte.TabIndex = 0; @@ -90,7 +91,7 @@ this.lbl_street.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_street.Location = new System.Drawing.Point(6, 9); this.lbl_street.Name = "lbl_street"; - this.lbl_street.Size = new System.Drawing.Size(104, 20); + this.lbl_street.Size = new System.Drawing.Size(128, 25); this.lbl_street.TabIndex = 2; this.lbl_street.Text = "Strassename"; // @@ -100,7 +101,7 @@ this.lbl_projekt.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_projekt.Location = new System.Drawing.Point(6, 49); this.lbl_projekt.Name = "lbl_projekt"; - this.lbl_projekt.Size = new System.Drawing.Size(116, 20); + this.lbl_projekt.Size = new System.Drawing.Size(143, 25); this.lbl_projekt.TabIndex = 3; this.lbl_projekt.Text = "Projektnummer"; // @@ -109,7 +110,7 @@ this.txt_strasse.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_strasse.Location = new System.Drawing.Point(157, 6); this.txt_strasse.Name = "txt_strasse"; - this.txt_strasse.Size = new System.Drawing.Size(352, 26); + this.txt_strasse.Size = new System.Drawing.Size(352, 30); this.txt_strasse.TabIndex = 4; // // txt_pro_nr_1 @@ -117,7 +118,7 @@ this.txt_pro_nr_1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_pro_nr_1.Location = new System.Drawing.Point(157, 46); this.txt_pro_nr_1.Name = "txt_pro_nr_1"; - this.txt_pro_nr_1.Size = new System.Drawing.Size(100, 26); + this.txt_pro_nr_1.Size = new System.Drawing.Size(100, 30); this.txt_pro_nr_1.TabIndex = 5; // // label3 @@ -126,7 +127,7 @@ this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.Location = new System.Drawing.Point(263, 49); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(14, 20); + this.label3.Size = new System.Drawing.Size(19, 25); this.label3.TabIndex = 6; this.label3.Text = "-"; // @@ -136,7 +137,7 @@ this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.Location = new System.Drawing.Point(389, 49); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(14, 20); + this.label4.Size = new System.Drawing.Size(19, 25); this.label4.TabIndex = 7; this.label4.Text = "-"; // @@ -145,7 +146,7 @@ this.txt_pro_nr_2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_pro_nr_2.Location = new System.Drawing.Point(283, 46); this.txt_pro_nr_2.Name = "txt_pro_nr_2"; - this.txt_pro_nr_2.Size = new System.Drawing.Size(100, 26); + this.txt_pro_nr_2.Size = new System.Drawing.Size(100, 30); this.txt_pro_nr_2.TabIndex = 8; // // txt_pro_nr_3 @@ -153,7 +154,7 @@ this.txt_pro_nr_3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_pro_nr_3.Location = new System.Drawing.Point(409, 46); this.txt_pro_nr_3.Name = "txt_pro_nr_3"; - this.txt_pro_nr_3.Size = new System.Drawing.Size(100, 26); + this.txt_pro_nr_3.Size = new System.Drawing.Size(100, 30); this.txt_pro_nr_3.TabIndex = 9; // // lbl_ort @@ -162,7 +163,7 @@ this.lbl_ort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_ort.Location = new System.Drawing.Point(549, 9); this.lbl_ort.Name = "lbl_ort"; - this.lbl_ort.Size = new System.Drawing.Size(31, 20); + this.lbl_ort.Size = new System.Drawing.Size(39, 25); this.lbl_ort.TabIndex = 10; this.lbl_ort.Text = "Ort"; // @@ -171,7 +172,7 @@ this.txt_ort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_ort.Location = new System.Drawing.Point(604, 6); this.txt_ort.Name = "txt_ort"; - this.txt_ort.Size = new System.Drawing.Size(235, 26); + this.txt_ort.Size = new System.Drawing.Size(235, 30); this.txt_ort.TabIndex = 11; // // label1 @@ -180,7 +181,7 @@ this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(15, 25); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(25, 20); + this.label1.Size = new System.Drawing.Size(32, 25); this.label1.TabIndex = 12; this.label1.Text = " "; // @@ -190,7 +191,7 @@ this.lbl_projwrong.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_projwrong.Location = new System.Drawing.Point(46, 25); this.lbl_projwrong.Name = "lbl_projwrong"; - this.lbl_projwrong.Size = new System.Drawing.Size(224, 20); + this.lbl_projwrong.Size = new System.Drawing.Size(276, 25); this.lbl_projwrong.TabIndex = 13; this.lbl_projwrong.Text = "Projektnummer nicht vergeben"; // @@ -200,7 +201,7 @@ this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(15, 51); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(25, 20); + this.label5.Size = new System.Drawing.Size(32, 25); this.label5.TabIndex = 14; this.label5.Text = " "; // @@ -210,7 +211,7 @@ this.lbl_grounddata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_grounddata.Location = new System.Drawing.Point(46, 51); this.lbl_grounddata.Name = "lbl_grounddata"; - this.lbl_grounddata.Size = new System.Drawing.Size(282, 20); + this.lbl_grounddata.Size = new System.Drawing.Size(345, 25); this.lbl_grounddata.TabIndex = 15; this.lbl_grounddata.Text = "Grunddaten sind nicht richtig vergeben"; // @@ -254,7 +255,7 @@ this.btn_set_kali.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_set_kali.Location = new System.Drawing.Point(510, 262); this.btn_set_kali.Name = "btn_set_kali"; - this.btn_set_kali.Size = new System.Drawing.Size(317, 53); + this.btn_set_kali.Size = new System.Drawing.Size(423, 53); this.btn_set_kali.TabIndex = 19; this.btn_set_kali.Text = "Ausgewählte mit Linergrundlagen versehen"; this.btn_set_kali.UseVisualStyleBackColor = true; diff --git a/SanSystem/frmStrassenList.cs b/SanSystem/frmStrassenList.cs index 668f80a..b1cb998 100644 --- a/SanSystem/frmStrassenList.cs +++ b/SanSystem/frmStrassenList.cs @@ -147,6 +147,11 @@ namespace SanSystem private void btn_add_Click(object sender, EventArgs e) { + if(Datenbank.Instance.loadedProjekt == null) + { + MessageBox.Show("Es wurde kein Projekt geladen"); + return; + } KlassenBIB.Inspektionsobjekt inspektionsobjekt = new KlassenBIB.Inspektionsobjekt(); inspektionsobjekt.Projektnummer = Global.Instance.ProjektNummer; Datenbank.Instance.loadedProjekt.Objekte.Add(inspektionsobjekt);