kleine Anpassungen in FormNeuerAuftrag

This commit is contained in:
Kilian Wirl 2025-12-03 12:32:08 +01:00
parent 86286845e4
commit 78cff24d2b
6 changed files with 97 additions and 131 deletions

View File

@ -341,42 +341,42 @@ namespace Deckungsbeitrag
if (!label.Name.Contains("1")) this.auftrag = Auftrag.GetAuftrag(this.fach.AuftragID); if (!label.Name.Contains("1")) this.auftrag = Auftrag.GetAuftrag(this.fach.AuftragID);
else this.auftrag = null; else this.auftrag = null;
FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(person, maschine, false, this.auftrag, this.fach); //FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(person, maschine, false, this.auftrag, this.fach);
if (nauftrag.ShowDialog() == DialogResult.OK) //if (nauftrag.ShowDialog() == DialogResult.OK)
{ //{
this.auftrag = nauftrag.Auftrag; // this.auftrag = nauftrag.Auftrag;
this.fach = nauftrag.fach; // this.fach = nauftrag.fach;
//this.fach.AuftragID = nauftrag.Auftrag.AuftragID; // //this.fach.AuftragID = nauftrag.Auftrag.AuftragID;
//this.fach.KundeID = nauftrag.Auftrag.KundeID; // //this.fach.KundeID = nauftrag.Auftrag.KundeID;
//this.fach.Lieferdatum = nauftrag.Auftrag.Liefertag; // //this.fach.Lieferdatum = nauftrag.Auftrag.Liefertag;
//this.fach.Liefertag = (Liefertag)nauftrag.Auftrag.Liefertag.DayOfWeek; // //this.fach.Liefertag = (Liefertag)nauftrag.Auftrag.Liefertag.DayOfWeek;
//if (nauftrag.extraAuftrag == null) { this.fach.ExtraAuftragID = null; this.fach.ExtraKundeID = null; } // //if (nauftrag.extraAuftrag == null) { this.fach.ExtraAuftragID = null; this.fach.ExtraKundeID = null; }
//else { this.fach.ExtraAuftragID = nauftrag.extraAuftrag.AuftragID; this.fach.ExtraKundeID = nauftrag.extraAuftrag.KundeID; } // //else { this.fach.ExtraAuftragID = nauftrag.extraAuftrag.AuftragID; this.fach.ExtraKundeID = nauftrag.extraAuftrag.KundeID; }
//this.fach.Gewaschen = (DateTime)nauftrag.Auftrag.Erstellt; // //this.fach.Gewaschen = (DateTime)nauftrag.Auftrag.Erstellt;
label.Tag = this.fach; // label.Tag = this.fach;
Refresh_Form(this); // Refresh_Form(this);
} //}
} }
private void Kunde_hinzufügen_MouseDoubleClick(object sender, MouseEventArgs e) private void Kunde_hinzufügen_MouseDoubleClick(object sender, MouseEventArgs e)
{ {
Label label = (Label)sender; Label label = (Label)sender;
this.fach = (Fach)label.Tag; this.fach = (Fach)label.Tag;
FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(person, maschine, false, null, null); //FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(person, maschine, false, null, null);
if (nauftrag.ShowDialog() == DialogResult.OK) //if (nauftrag.ShowDialog() == DialogResult.OK)
{ //{
this.fach.AuftragID = nauftrag.Auftrag.AuftragID; // this.fach.AuftragID = nauftrag.Auftrag.AuftragID;
this.fach.KundeID = nauftrag.Auftrag.KundeID; // this.fach.KundeID = nauftrag.Auftrag.KundeID;
this.fach.Lieferdatum = nauftrag.Auftrag.Liefertag; // this.fach.Lieferdatum = nauftrag.Auftrag.Liefertag;
this.fach.Liefertag = (Liefertag)nauftrag.Auftrag.Liefertag.DayOfWeek; // this.fach.Liefertag = (Liefertag)nauftrag.Auftrag.Liefertag.DayOfWeek;
label.Tag = this.fach; // label.Tag = this.fach;
Fach_Bearbeiten(label); // Fach_Bearbeiten(label);
} //}
} }
//Fach bearbeiten bei Click auf Label Tag oder Waschprogramm. //Fach bearbeiten bei Click auf Label Tag oder Waschprogramm.

View File

@ -56,7 +56,6 @@ namespace Deckungsbeitrag
this.rBDI = new System.Windows.Forms.RadioButton(); this.rBDI = new System.Windows.Forms.RadioButton();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.comboBoxTyp = new System.Windows.Forms.ComboBox(); this.comboBoxTyp = new System.Windows.Forms.ComboBox();
this.buttonExtraKunde = new System.Windows.Forms.Button();
this.pictureBoxWalli = new System.Windows.Forms.PictureBox(); this.pictureBoxWalli = new System.Windows.Forms.PictureBox();
this.textBoxCont = new System.Windows.Forms.TextBox(); this.textBoxCont = new System.Windows.Forms.TextBox();
this.dGArtikel = new System.Windows.Forms.DataGridView(); this.dGArtikel = new System.Windows.Forms.DataGridView();
@ -445,26 +444,6 @@ namespace Deckungsbeitrag
this.comboBoxTyp.Size = new System.Drawing.Size(142, 33); this.comboBoxTyp.Size = new System.Drawing.Size(142, 33);
this.comboBoxTyp.TabIndex = 1; this.comboBoxTyp.TabIndex = 1;
// //
// buttonExtraKunde
//
this.buttonExtraKunde.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonExtraKunde.BackColor = System.Drawing.Color.Yellow;
this.buttonExtraKunde.Enabled = false;
this.buttonExtraKunde.FlatAppearance.BorderSize = 0;
this.buttonExtraKunde.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonExtraKunde.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonExtraKunde.ForeColor = System.Drawing.Color.Black;
this.buttonExtraKunde.Location = new System.Drawing.Point(7, 533);
this.buttonExtraKunde.Margin = new System.Windows.Forms.Padding(2);
this.buttonExtraKunde.Name = "buttonExtraKunde";
this.buttonExtraKunde.Size = new System.Drawing.Size(120, 41);
this.buttonExtraKunde.TabIndex = 29;
this.buttonExtraKunde.Text = "+Auftrag";
this.buttonExtraKunde.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonExtraKunde.UseVisualStyleBackColor = false;
this.buttonExtraKunde.Visible = false;
this.buttonExtraKunde.Click += new System.EventHandler(this.buttonExtraKunde_Click);
//
// pictureBoxWalli // pictureBoxWalli
// //
this.pictureBoxWalli.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBoxWalli.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -584,7 +563,6 @@ namespace Deckungsbeitrag
this.ClientSize = new System.Drawing.Size(709, 585); this.ClientSize = new System.Drawing.Size(709, 585);
this.Controls.Add(this.dGArtikel); this.Controls.Add(this.dGArtikel);
this.Controls.Add(this.textBoxCont); this.Controls.Add(this.textBoxCont);
this.Controls.Add(this.buttonExtraKunde);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.comboBoxTyp); this.Controls.Add(this.comboBoxTyp);
this.Controls.Add(this.rBDI); this.Controls.Add(this.rBDI);
@ -654,7 +632,6 @@ namespace Deckungsbeitrag
private System.Windows.Forms.RadioButton rBDI; private System.Windows.Forms.RadioButton rBDI;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox comboBoxTyp; private System.Windows.Forms.ComboBox comboBoxTyp;
private System.Windows.Forms.Button buttonExtraKunde;
private System.Windows.Forms.PictureBox pictureBoxWalli; private System.Windows.Forms.PictureBox pictureBoxWalli;
private System.Windows.Forms.TextBox textBoxCont; private System.Windows.Forms.TextBox textBoxCont;
private System.Windows.Forms.DataGridView dGArtikel; private System.Windows.Forms.DataGridView dGArtikel;

View File

@ -38,46 +38,35 @@ namespace Deckungsbeitrag
{ {
InitializeComponent(); InitializeComponent();
} }
public FormNeuerAuftrag(Benutzer benutzer, Maschine maschine, bool extra, Auftrag auftrag, Fach fach) : this()
{
this.benutzer = benutzer;
this.maschine = maschine;
this.extra = extra;
this.fach = fach;
if (auftrag == null) this.extraAuftrag = auftrag;
else this.Auftrag = auftrag;
}
public FormNeuerAuftrag(Benutzer benutzer) : this() public FormNeuerAuftrag(Benutzer benutzer) : this()
{ {
this.benutzer = benutzer; this.benutzer = benutzer;
this.Auftrag = new Auftrag();
} }
public FormNeuerAuftrag(Benutzer benutzer, DateTime? letzterLiefertag) : this(benutzer) public FormNeuerAuftrag(Benutzer benutzer, DateTime? letzterLiefertag) : this(benutzer)
{ {
this.letzterLiefertag = letzterLiefertag; this.letzterLiefertag = letzterLiefertag;
this.Auftrag = new Auftrag();
//this.knd = Open_List(); //this.knd = Open_List();
} }
private void FormNeuerAuftrag_Load(object sender, EventArgs e) private void FormNeuerAuftrag_Load(object sender, EventArgs e)
{ {
this.kunde = Funktionen.KundenAuswahl();
//TODO: Umbauen damit kein Fehler wenn KundenAuswahl negativ endet.
this.label1.Text = this.textBoxZusatz.Text.Length.ToString() + "/" + this.textBoxZusatz.MaxLength.ToString(); this.label1.Text = this.textBoxZusatz.Text.Length.ToString() + "/" + this.textBoxZusatz.MaxLength.ToString();
sortimentListe = (List<Sortiment>)Funktionen.SortimentLesen("Liste"); sortimentListe = (List<Sortiment>)Funktionen.SortimentLesen("Liste");
//TODO: Funktion versuchen was diese bewirkt.
this.dGArtikel.ForeColor = Color.Black; this.dGArtikel.ForeColor = Color.Black;
this.dTPLiefertag.Value = DateTime.Today.AddDays(1);
this.textBoxKundeName.Enabled = false;
this.textBoxKndNr.Enabled = false;
// RadioButtons und ComboBoxen laden.
Get_RadioButtons();
comboBox_Load();
//Unterscheidung zwischen BenutzerRollen. Verschiedene Controls werden gesperrt, angezeigt oder verändert //Unterscheidung zwischen BenutzerRollen. Verschiedene Controls werden gesperrt, angezeigt oder verändert
if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Master) if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Master)
{ {
this.comboBoxTyp.Enabled = true; this.comboBoxTyp.Enabled = true;
this.buttonExtraKunde.Enabled = false;
this.buttonExtraKunde.BackColor = Color.Gray;
this.comboBoxTyp.SelectedIndex = 2; this.comboBoxTyp.SelectedIndex = 2;
} }
else else
@ -85,59 +74,33 @@ namespace Deckungsbeitrag
this.comboBoxTyp.Enabled = false; this.comboBoxTyp.Enabled = false;
foreach(Control c in this.groupBoxSonder.Controls) { if(c.GetType() != typeof(Label)) c.Enabled = false; } foreach(Control c in this.groupBoxSonder.Controls) { if(c.GetType() != typeof(Label)) c.Enabled = false; }
this.dGArtikel.Enabled = this.dGArtikel.Visible = false; this.dGArtikel.Enabled = this.dGArtikel.Visible = false;
//this.pictureBoxWalli.Visible = true;
this.comboBoxTyp.SelectedIndex = 1; this.comboBoxTyp.SelectedIndex = 1;
} }
this.kunde = Funktionen.KundenAuswahl();
// Falls KundenAuswahl null liefert wird Form geschlossen oder wenn Waschstrasse neu geladen.
if (this.kunde != null) DatenLaden();
else
{
// Wenn NICHT Waschstrasse dann Fenster schließen.
if (benutzer.Rolle == BenutzerRolle.Waschstrasse) FormNeuerAuftrag_Load(this, e);
else this.Close();
}
} }
/// <summary> /// <summary>
/// Div Controls werden geladen. Darunter RadioButtons, ComboBox und GridView. /// Kundendaten Liefertag werden eingefügt.
/// </summary> /// </summary>
private void Load_Controls() private void DatenLaden()
{ {
Get_RadioButtons(); this.textBoxKndNr.Text = kunde.KundeNummer;
comboBox_Load(); this.textBoxKundeName.Text = kunde.Suchtext;
if (letzterLiefertag.HasValue) this.dTPLiefertag.Value = letzterLiefertag.Value;
if (Auftrag == null) else this.dTPLiefertag.Value = DateTime.Today.AddDays(1);
{
this.dTPLiefertag.Value = DateTime.Today.AddDays(1);
this.comboBoxAufgabe.SelectedIndex = -1;
this.comboBoxBenutzer.SelectedIndex = -1;
}
else
{
if (kunde == null) kunde = Kunde.GetKunde(string.Empty, Auftrag.KundeID, string.Empty);
this.textBoxKndNr.Text = kunde.KundeNummer;
this.textBoxKundeName.Text = kunde.Suchtext;
this.textBoxKundeName.Enabled = false;
this.textBoxKndNr.Enabled = false;
if (letzterLiefertag.HasValue) this.dTPLiefertag.Value = letzterLiefertag.Value;
else this.dTPLiefertag.Value = DateTime.Today.AddDays(1);
this.textBoxCont.Text = Auftrag.Container.ToString();
this.textBoxZusatz.Text = Auftrag.ZusatzInfo;
dTPLiefertag_Leave(this.dTPLiefertag, EventArgs.Empty); dTPLiefertag_Leave(this.dTPLiefertag, EventArgs.Empty);
textBoxCont_TextChanged(this.textBoxCont, EventArgs.Empty); textBoxCont_TextChanged(this.textBoxCont, EventArgs.Empty);
if (Auftrag.ArbeiterID != null)
{
foreach (Benutzer b in comboBoxBenutzer.Items) if (b.BenutzerID == Auftrag.ArbeiterID) this.comboBoxBenutzer.SelectedItem = b;
}
if (Auftrag.Typ == AuftragTyp.Sonder)
{
foreach (Aufgabe auf in comboBoxAufgabe.Items)
{
if (auf.AufgabeID == Auftrag.AufgabeID)
{
this.comboBoxAufgabe.SelectedItem = auf;
if (auf.Bezeichnung == "STH" || auf.Bezeichnung == "STV" || auf.Bezeichnung == "STA") Load_Gridview(kunde.KundeNummer.ToString(), auf);
}
}
}
}
} }
private void Get_RadioButtons() private void Get_RadioButtons()
{ {
@ -233,8 +196,9 @@ namespace Deckungsbeitrag
this.textBoxKndNr.Focus(); this.textBoxKndNr.Focus();
return; return;
} }
else Auftrag = new Auftrag();
//AUFTRAG DATEN ÜBERGEBEN //AUFTRAG DATEN ÜBERGEBEN
Auftrag.KundeID = (int)kunde.KundeID; Auftrag.KundeID = (int)kunde.KundeID;
Auftrag.Liefertag = this.dTPLiefertag.Value; Auftrag.Liefertag = this.dTPLiefertag.Value;
Auftrag.Container = int.Parse(this.textBoxCont.Text); Auftrag.Container = int.Parse(this.textBoxCont.Text);
@ -400,6 +364,7 @@ namespace Deckungsbeitrag
} }
} }
// Wenn Waschstrasse bleibt Fenster offen.
if(benutzer.Rolle != BenutzerRolle.Waschstrasse) if(benutzer.Rolle != BenutzerRolle.Waschstrasse)
{ {
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
@ -525,11 +490,11 @@ namespace Deckungsbeitrag
private void buttonExtraKunde_Click(object sender, EventArgs e) private void buttonExtraKunde_Click(object sender, EventArgs e)
{ {
FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(benutzer, maschine, true, this.extraAuftrag, null); //FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(benutzer, maschine, true, this.extraAuftrag, null);
if (nauftrag.ShowDialog() == DialogResult.OK) //if (nauftrag.ShowDialog() == DialogResult.OK)
{ //{
this.extraAuftrag = nauftrag.Auftrag; // this.extraAuftrag = nauftrag.Auftrag;
} //}
} }

View File

@ -28,11 +28,11 @@ namespace Deckungsbeitrag
public static Auftrag _auftrag; public static Auftrag _auftrag;
public static Kunde _adresse; public static Kunde _adresse;
private int currentPage = 0; private int currentPage = 0;
public int totalPages = 0; private int totalPages = 0;
int i = 0; int i = 0;
int j = 0; int j = 0;
public bool printOK; private bool printOK;
public static bool _nocont; private static bool _nocont;
public Funktionen() public Funktionen()
{ {

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben: // indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.5")] [assembly: AssemblyVersion("1.0.0.6")]
[assembly: AssemblyFileVersion("1.0.0.5")] [assembly: AssemblyFileVersion("1.0.0.6")]

View File

@ -448,12 +448,6 @@
"Entry" "Entry"
{ {
"MsmKey" = "8:_UNDEFINED" "MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_5CDE0A18B0E8657CBCF9143673DB464A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72" "OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
@ -613,6 +607,12 @@
"OwnerKey" = "8:_6A4E9AB7C92A8099AD635862468BFCBE" "OwnerKey" = "8:_6A4E9AB7C92A8099AD635862468BFCBE"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_5CDE0A18B0E8657CBCF9143673DB464A"
"MsmSig" = "8:_UNDEFINED"
}
} }
"Configurations" "Configurations"
{ {
@ -631,6 +631,22 @@
"PrivateKeyFile" = "8:" "PrivateKeyFile" = "8:"
"TimeStampServer" = "8:" "TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2" "InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2"
{
"Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.7.2"
}
}
}
} }
"Release" "Release"
{ {
@ -647,6 +663,14 @@
"PrivateKeyFile" = "8:" "PrivateKeyFile" = "8:"
"TimeStampServer" = "8:" "TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2" "InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
}
} }
} }
"Deployable" "Deployable"
@ -1589,15 +1613,15 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SetupVerwaltung" "ProductName" = "8:SetupVerwaltung"
"ProductCode" = "8:{0010D709-9AE3-468C-8F68-EC695EB61666}" "ProductCode" = "8:{11E91F34-1C8C-4E2A-8F36-BBFA3DD61B37}"
"PackageCode" = "8:{7292D802-12D6-4878-9DF4-D6087974A7AE}" "PackageCode" = "8:{3C3E1999-97F5-419F-AC11-5A8C13158757}"
"UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}" "UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}"
"AspNetVersion" = "8:" "AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE" "RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE" "RemovePreviousVersions" = "11:FALSE"
"DetectNewerInstalledVersion" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE" "InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.5" "ProductVersion" = "8:1.0.6"
"Manufacturer" = "8:Kilian Wirl GmbH" "Manufacturer" = "8:Kilian Wirl GmbH"
"ARPHELPTELEPHONE" = "8:" "ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:" "ARPHELPLINK" = "8:"
@ -1607,7 +1631,7 @@
"Keywords" = "8:" "Keywords" = "8:"
"ARPCOMMENTS" = "8:" "ARPCOMMENTS" = "8:"
"ARPURLINFOABOUT" = "8:" "ARPURLINFOABOUT" = "8:"
"ARPPRODUCTICON" = "8:" "ARPPRODUCTICON" = "8:_C9B6A80501F441EF8F136C44B8658363"
"ARPIconIndex" = "3:0" "ARPIconIndex" = "3:0"
"SearchPath" = "8:" "SearchPath" = "8:"
"UseSystemSearchPath" = "11:TRUE" "UseSystemSearchPath" = "11:TRUE"