From 07c755c1214328f078d93c0c7745a816a249339c Mon Sep 17 00:00:00 2001 From: Kilian Wirl Date: Wed, 10 Dec 2025 13:48:52 +0100 Subject: [PATCH] Ablaufkorrektur MaschineTransport - FachValue korrigiert. --- AA-Forms/FormWSVerfolgung.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/AA-Forms/FormWSVerfolgung.cs b/AA-Forms/FormWSVerfolgung.cs index ca46bef..8ace28c 100644 --- a/AA-Forms/FormWSVerfolgung.cs +++ b/AA-Forms/FormWSVerfolgung.cs @@ -112,7 +112,7 @@ namespace Deckungsbeitrag.AA_Forms } } this.aufgabe = (Aufgabe)item.Tag; - Fach_speichern(); + Fach_speichern(); // Gleiches Fach mit neuem Auftrag = Update. } private void Panel_Laden(int start) @@ -127,6 +127,7 @@ namespace Deckungsbeitrag.AA_Forms { this.auftrag = Auftrag.GetAuftrag(fachliste[0].AuftragID); this.aufgabe = Aufgabe.GetAufgabe(null, fachliste[0].AufgabeID); + this.fach = new WSFach(); } else { @@ -214,19 +215,21 @@ namespace Deckungsbeitrag.AA_Forms if (neuerAuftrag.ShowDialog() == DialogResult.OK) { this.auftrag = neuerAuftrag.Auftrag; - Fach_speichern(); + Fach_speichern(); // Gleiches Fach mit neuem Auftrag = Update. } } private void Fach_speichern() { - this.fach = new WSFach(); + //this.fach = new WSFach(); this.fach.AuftragID = (int)this.auftrag.AuftragID; this.fach.MaschineID = (int)this.maschine.MaschineID; this.fach.Gewaschen = DateTime.Now; this.fach.Gewicht = 0; this.fach.WProgrammID = 1; if (this.aufgabe != null) this.fach.AufgabeID = this.aufgabe.AufgabeID; + else this.fach.AufgabeID = null; if (this.extraAuftrag != null) this.fach.ExtraAuftragID = this.extraAuftrag.AuftragID; + else this.fach.ExtraAuftragID = null; if (this.fach.Save() == 1) Panel_Laden(2); } @@ -249,10 +252,10 @@ namespace Deckungsbeitrag.AA_Forms Maschine ms = (Maschine)this.maschine; if (this.auftrag != null) { - Fach_speichern(); - this.fach.FachID = null; this.aufgabe = null; this.extraAuftrag = null; + if (this.fach != null) this.fach.FachID = null; + Fach_speichern(); // Neues Fach mit gleichem Inhalt = } else { @@ -287,7 +290,6 @@ namespace Deckungsbeitrag.AA_Forms if (Form.ModifierKeys == Keys.None && keyData == Keys.R) { Cursor.Current = Cursors.WaitCursor; - //this.SuspendLayout(); if (((Maschine)this.maschine).MaschineID == 1) { if (this.auftrag == null) MessageBox.Show($"Kein Kunde ausgewählt. Bitte JETZT erledigen.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Warning); @@ -298,7 +300,6 @@ namespace Deckungsbeitrag.AA_Forms if (this.auftrag == null) MessageBox.Show($"Kein Kunde ausgewählt. Bitte JETZT erledigen.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Warning); else _monitor.WS_2_Transport = true; } - //this.ResumeLayout(); Cursor.Current = Cursors.Default; return true; }