Umbau NeuerAuftrag

This commit is contained in:
Kilian Wirl 2025-12-04 10:24:07 +01:00
parent 78cff24d2b
commit 35507860ed
8 changed files with 137 additions and 1815 deletions

View File

@ -221,7 +221,7 @@ namespace Deckungsbeitrag
//WENN STATUS HERRICHTEN DANN ITEMS UPDATEN
//LISTVIEWITEMS UPDATEN
if (auftrag.Typ == AuftragTyp.Sonder)
if (auftrag.Typ >= AuftragTyp.Inventur)
{
//LISTVIEWITEMS UPDATEN
foreach (ListViewItem item in this.listViewArtikel.Items)

View File

@ -139,7 +139,7 @@ namespace Deckungsbeitrag
OLV_Load(this.objectListViewAuftrag, auftraglist);
// Lade die ListView für Sonderaufträge wie STV, STH, oder INVENTUR
sonderlist = Auftrag.GetExpeditLists((int)AuftragTyp.Sonder);
sonderlist = Auftrag.GetExpeditLists((int)AuftragTyp.Inventur);
if (sonderlist.Count == 0) { this.tabControlAuftragList.TabPages.Remove(tabPageSonder); }
else { OLV_Load(this.objectListViewSonder, sonderlist); if(this.tabControlAuftragList.TabPages.Count < 2) this.tabControlAuftragList.TabPages.Insert(1, tabPageSonder); }
@ -422,7 +422,27 @@ namespace Deckungsbeitrag
case AuftragTyp.Standart:
if (meldung.NoCleanContainer() == DialogResult.OK) return;
break;
case AuftragTyp.Sonder:
case AuftragTyp.Inventur:
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
this.auftrag.Status = AuftragStatus.Fertig;
this.auftrag.Save();
this.auftrag = null;
Load_Etikett_GroupBox();
}
else return;
break;
case AuftragTyp.Standverminderung:
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
this.auftrag.Status = AuftragStatus.Fertig;
this.auftrag.Save();
this.auftrag = null;
Load_Etikett_GroupBox();
}
else return;
break;
case AuftragTyp.Standerhöhung:
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
this.auftrag.Status = AuftragStatus.Fertig;

View File

@ -616,7 +616,7 @@ namespace Deckungsbeitrag
this.objectListViewAuftrag.BeginUpdate();
List<Auftrag> alist = new List<Auftrag>();
alist = Auftrag.GetExpeditLists(status);
alist = Auftrag.GetStatusList(status);
if (alist.Count == 0) meldung.KeineAufträge();
else Load_OLV(alist); // Load_ListView(alist);

View File

@ -31,22 +31,14 @@ namespace Deckungsbeitrag
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormNeuerAuftrag));
this.dTPLiefertag = new System.Windows.Forms.DateTimePicker();
this.comboBoxBenutzer = new System.Windows.Forms.ComboBox();
this.labelFahrer = new System.Windows.Forms.Label();
this.comboBoxAufgabe = new System.Windows.Forms.ComboBox();
this.labelAktion = new System.Windows.Forms.Label();
this.textBoxZusatz = new System.Windows.Forms.TextBox();
this.labelZusatz = new System.Windows.Forms.Label();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBoxKndNr = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBoxKundeName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.groupBoxSonder = new System.Windows.Forms.GroupBox();
this.pictureBoxMinus = new System.Windows.Forms.PictureBox();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.rBMO = new System.Windows.Forms.RadioButton();
@ -56,7 +48,6 @@ namespace Deckungsbeitrag
this.rBDI = new System.Windows.Forms.RadioButton();
this.label6 = new System.Windows.Forms.Label();
this.comboBoxTyp = new System.Windows.Forms.ComboBox();
this.pictureBoxWalli = new System.Windows.Forms.PictureBox();
this.textBoxCont = new System.Windows.Forms.TextBox();
this.dGArtikel = new System.Windows.Forms.DataGridView();
this.KundeArtikelID = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -69,10 +60,8 @@ namespace Deckungsbeitrag
this.StandBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FehlmengeBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KorrekturBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBoxSonder.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxWalli)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
this.SuspendLayout();
//
@ -90,78 +79,6 @@ namespace Deckungsbeitrag
this.dTPLiefertag.ValueChanged += new System.EventHandler(this.dTPLiefertag_ValueChanged);
this.dTPLiefertag.Leave += new System.EventHandler(this.dTPLiefertag_Leave);
//
// comboBoxBenutzer
//
this.comboBoxBenutzer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.comboBoxBenutzer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxBenutzer.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.comboBoxBenutzer.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxBenutzer.FormattingEnabled = true;
this.comboBoxBenutzer.Location = new System.Drawing.Point(122, 38);
this.comboBoxBenutzer.Margin = new System.Windows.Forms.Padding(2);
this.comboBoxBenutzer.Name = "comboBoxBenutzer";
this.comboBoxBenutzer.Size = new System.Drawing.Size(145, 33);
this.comboBoxBenutzer.TabIndex = 1;
//
// labelFahrer
//
this.labelFahrer.AutoSize = true;
this.labelFahrer.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelFahrer.Location = new System.Drawing.Point(120, 10);
this.labelFahrer.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelFahrer.Name = "labelFahrer";
this.labelFahrer.Size = new System.Drawing.Size(147, 20);
this.labelFahrer.TabIndex = 7;
this.labelFahrer.Text = "Zuständige Person:";
//
// comboBoxAufgabe
//
this.comboBoxAufgabe.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.comboBoxAufgabe.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxAufgabe.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.comboBoxAufgabe.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxAufgabe.FormattingEnabled = true;
this.comboBoxAufgabe.Location = new System.Drawing.Point(12, 38);
this.comboBoxAufgabe.Margin = new System.Windows.Forms.Padding(2);
this.comboBoxAufgabe.Name = "comboBoxAufgabe";
this.comboBoxAufgabe.Size = new System.Drawing.Size(106, 33);
this.comboBoxAufgabe.TabIndex = 0;
this.comboBoxAufgabe.SelectedValueChanged += new System.EventHandler(this.comboBoxAufgabe_SelectedValueChanged);
//
// labelAktion
//
this.labelAktion.AutoSize = true;
this.labelAktion.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelAktion.Location = new System.Drawing.Point(12, 10);
this.labelAktion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelAktion.Name = "labelAktion";
this.labelAktion.Size = new System.Drawing.Size(74, 20);
this.labelAktion.TabIndex = 9;
this.labelAktion.Text = "Aufgabe:";
//
// textBoxZusatz
//
this.textBoxZusatz.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxZusatz.Location = new System.Drawing.Point(12, 102);
this.textBoxZusatz.Margin = new System.Windows.Forms.Padding(2);
this.textBoxZusatz.MaxLength = 100;
this.textBoxZusatz.Multiline = true;
this.textBoxZusatz.Name = "textBoxZusatz";
this.textBoxZusatz.Size = new System.Drawing.Size(255, 101);
this.textBoxZusatz.TabIndex = 2;
this.textBoxZusatz.TextChanged += new System.EventHandler(this.textBoxZusatz_TextChanged);
//
// labelZusatz
//
this.labelZusatz.AutoSize = true;
this.labelZusatz.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelZusatz.Location = new System.Drawing.Point(8, 75);
this.labelZusatz.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelZusatz.Name = "labelZusatz";
this.labelZusatz.Size = new System.Drawing.Size(62, 20);
this.labelZusatz.TabIndex = 11;
this.labelZusatz.Text = "Zusatz:";
//
// buttonSpeichern
//
this.buttonSpeichern.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -170,7 +87,7 @@ namespace Deckungsbeitrag
this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSpeichern.ForeColor = System.Drawing.Color.White;
this.buttonSpeichern.Location = new System.Drawing.Point(463, 530);
this.buttonSpeichern.Location = new System.Drawing.Point(495, 311);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(2);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(120, 41);
@ -189,7 +106,7 @@ namespace Deckungsbeitrag
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.White;
this.buttonAbbrechen.Location = new System.Drawing.Point(587, 530);
this.buttonAbbrechen.Location = new System.Drawing.Point(619, 311);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(2);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(114, 41);
@ -199,27 +116,15 @@ namespace Deckungsbeitrag
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.buttonAbbrechen_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(219, 205);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 15;
this.label1.Text = "000/000";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// textBoxKndNr
//
this.textBoxKndNr.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxKndNr.Location = new System.Drawing.Point(9, 43);
this.textBoxKndNr.Margin = new System.Windows.Forms.Padding(2);
this.textBoxKndNr.Name = "textBoxKndNr";
this.textBoxKndNr.Size = new System.Drawing.Size(132, 31);
this.textBoxKndNr.Size = new System.Drawing.Size(105, 31);
this.textBoxKndNr.TabIndex = 0;
this.textBoxKndNr.Click += new System.EventHandler(this.textBoxKndNr_Click);
this.textBoxKndNr.Leave += new System.EventHandler(this.textBoxKndNr_Leave);
this.textBoxKndNr.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBoxKndNr_PreviewKeyDown);
//
// label2
@ -276,23 +181,6 @@ namespace Deckungsbeitrag
this.label5.TabIndex = 24;
this.label5.Text = "Container schmutzig:";
//
// groupBoxSonder
//
this.groupBoxSonder.Controls.Add(this.label1);
this.groupBoxSonder.Controls.Add(this.labelZusatz);
this.groupBoxSonder.Controls.Add(this.textBoxZusatz);
this.groupBoxSonder.Controls.Add(this.labelAktion);
this.groupBoxSonder.Controls.Add(this.comboBoxAufgabe);
this.groupBoxSonder.Controls.Add(this.labelFahrer);
this.groupBoxSonder.Controls.Add(this.comboBoxBenutzer);
this.groupBoxSonder.Location = new System.Drawing.Point(9, 301);
this.groupBoxSonder.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxSonder.Name = "groupBoxSonder";
this.groupBoxSonder.Padding = new System.Windows.Forms.Padding(2);
this.groupBoxSonder.Size = new System.Drawing.Size(278, 224);
this.groupBoxSonder.TabIndex = 28;
this.groupBoxSonder.TabStop = false;
//
// pictureBoxMinus
//
this.pictureBoxMinus.BackColor = System.Drawing.Color.Red;
@ -424,7 +312,7 @@ namespace Deckungsbeitrag
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(141, 17);
this.label6.Location = new System.Drawing.Point(114, 17);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(95, 20);
@ -438,27 +326,12 @@ namespace Deckungsbeitrag
this.comboBoxTyp.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.comboBoxTyp.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxTyp.FormattingEnabled = true;
this.comboBoxTyp.Location = new System.Drawing.Point(145, 42);
this.comboBoxTyp.Location = new System.Drawing.Point(118, 42);
this.comboBoxTyp.Margin = new System.Windows.Forms.Padding(2);
this.comboBoxTyp.Name = "comboBoxTyp";
this.comboBoxTyp.Size = new System.Drawing.Size(142, 33);
this.comboBoxTyp.Size = new System.Drawing.Size(169, 33);
this.comboBoxTyp.TabIndex = 1;
//
// pictureBoxWalli
//
this.pictureBoxWalli.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pictureBoxWalli.BackColor = System.Drawing.Color.White;
this.pictureBoxWalli.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxWalli.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxWalli.Image")));
this.pictureBoxWalli.Location = new System.Drawing.Point(307, 12);
this.pictureBoxWalli.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxWalli.Name = "pictureBoxWalli";
this.pictureBoxWalli.Size = new System.Drawing.Size(395, 513);
this.pictureBoxWalli.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBoxWalli.TabIndex = 30;
this.pictureBoxWalli.TabStop = false;
this.pictureBoxWalli.UseWaitCursor = true;
this.pictureBoxWalli.Visible = false;
this.comboBoxTyp.SelectedValueChanged += new System.EventHandler(this.comboBoxTyp_SelectedValueChanged);
//
// textBoxCont
//
@ -474,9 +347,8 @@ namespace Deckungsbeitrag
//
// dGArtikel
//
this.dGArtikel.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.dGArtikel.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.dGArtikel.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;
this.dGArtikel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dGArtikel.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.KundeArtikelID,
@ -490,8 +362,9 @@ namespace Deckungsbeitrag
this.FehlmengeBearbeitet,
this.KorrekturBearbeitet});
this.dGArtikel.Location = new System.Drawing.Point(307, 12);
this.dGArtikel.MinimumSize = new System.Drawing.Size(0, 284);
this.dGArtikel.Name = "dGArtikel";
this.dGArtikel.Size = new System.Drawing.Size(395, 513);
this.dGArtikel.Size = new System.Drawing.Size(427, 284);
this.dGArtikel.TabIndex = 32;
this.dGArtikel.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataGridView_CellEnter);
this.dGArtikel.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dGArtikel_CellValidating);
@ -502,6 +375,7 @@ namespace Deckungsbeitrag
this.KundeArtikelID.Name = "KundeArtikelID";
this.KundeArtikelID.ReadOnly = true;
this.KundeArtikelID.Visible = false;
this.KundeArtikelID.Width = 103;
//
// KundeID
//
@ -509,49 +383,58 @@ namespace Deckungsbeitrag
this.KundeID.Name = "KundeID";
this.KundeID.ReadOnly = true;
this.KundeID.Visible = false;
this.KundeID.Width = 74;
//
// ArtikelNR
//
this.ArtikelNR.HeaderText = "Art. Nr.";
this.ArtikelNR.Name = "ArtikelNR";
this.ArtikelNR.ReadOnly = true;
this.ArtikelNR.Width = 48;
//
// ArtikelName
//
this.ArtikelName.HeaderText = "Art. Name";
this.ArtikelName.Name = "ArtikelName";
this.ArtikelName.ReadOnly = true;
this.ArtikelName.Width = 73;
//
// Stand
//
this.Stand.HeaderText = "Stand";
this.Stand.Name = "Stand";
this.Stand.ReadOnly = true;
this.Stand.Width = 60;
//
// Fehlmenge
//
this.Fehlmenge.HeaderText = "Fehlmenge";
this.Fehlmenge.Name = "Fehlmenge";
this.Fehlmenge.Width = 84;
//
// Korrektur
//
this.Korrektur.HeaderText = "Korrektur";
this.Korrektur.Name = "Korrektur";
this.Korrektur.Width = 75;
//
// StandBearbeitet
//
this.StandBearbeitet.HeaderText = "Stand Bearbeitet";
this.StandBearbeitet.Name = "StandBearbeitet";
this.StandBearbeitet.Width = 102;
//
// FehlmengeBearbeitet
//
this.FehlmengeBearbeitet.HeaderText = "Fehlmenge Bearbeitet";
this.FehlmengeBearbeitet.Name = "FehlmengeBearbeitet";
this.FehlmengeBearbeitet.Width = 124;
//
// KorrekturBearbeitet
//
this.KorrekturBearbeitet.HeaderText = "Korrektur Bearbeitet";
this.KorrekturBearbeitet.Name = "KorrekturBearbeitet";
this.KorrekturBearbeitet.Width = 115;
//
// FormNeuerAuftrag
//
@ -560,7 +443,7 @@ namespace Deckungsbeitrag
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.CancelButton = this.buttonAbbrechen;
this.ClientSize = new System.Drawing.Size(709, 585);
this.ClientSize = new System.Drawing.Size(741, 366);
this.Controls.Add(this.dGArtikel);
this.Controls.Add(this.textBoxCont);
this.Controls.Add(this.label6);
@ -570,7 +453,6 @@ namespace Deckungsbeitrag
this.Controls.Add(this.rBDO);
this.Controls.Add(this.rBFR);
this.Controls.Add(this.rBMO);
this.Controls.Add(this.groupBoxSonder);
this.Controls.Add(this.pictureBoxMinus);
this.Controls.Add(this.pictureBoxPlus);
this.Controls.Add(this.label5);
@ -582,23 +464,20 @@ namespace Deckungsbeitrag
this.Controls.Add(this.buttonAbbrechen);
this.Controls.Add(this.buttonSpeichern);
this.Controls.Add(this.dTPLiefertag);
this.Controls.Add(this.pictureBoxWalli);
this.ForeColor = System.Drawing.Color.White;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(0, 405);
this.Name = "FormNeuerAuftrag";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "NEUER AUFTRAG";
this.Load += new System.EventHandler(this.FormNeuerAuftrag_Load);
this.groupBoxSonder.ResumeLayout(false);
this.groupBoxSonder.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxWalli)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -607,15 +486,8 @@ namespace Deckungsbeitrag
#endregion
private System.Windows.Forms.DateTimePicker dTPLiefertag;
private System.Windows.Forms.ComboBox comboBoxBenutzer;
private System.Windows.Forms.Label labelFahrer;
private System.Windows.Forms.ComboBox comboBoxAufgabe;
private System.Windows.Forms.Label labelAktion;
private System.Windows.Forms.TextBox textBoxZusatz;
private System.Windows.Forms.Label labelZusatz;
private System.Windows.Forms.Button buttonSpeichern;
private System.Windows.Forms.Button buttonAbbrechen;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxKndNr;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBoxKundeName;
@ -624,7 +496,6 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBoxPlus;
private System.Windows.Forms.PictureBox pictureBoxMinus;
private System.Windows.Forms.GroupBox groupBoxSonder;
private System.Windows.Forms.RadioButton rBMO;
private System.Windows.Forms.RadioButton rBFR;
private System.Windows.Forms.RadioButton rBDO;
@ -632,7 +503,6 @@ namespace Deckungsbeitrag
private System.Windows.Forms.RadioButton rBDI;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox comboBoxTyp;
private System.Windows.Forms.PictureBox pictureBoxWalli;
private System.Windows.Forms.TextBox textBoxCont;
private System.Windows.Forms.DataGridView dGArtikel;
private System.Windows.Forms.DataGridViewTextBoxColumn KundeArtikelID;

View File

@ -51,7 +51,6 @@ namespace Deckungsbeitrag
private void FormNeuerAuftrag_Load(object sender, EventArgs e)
{
this.label1.Text = this.textBoxZusatz.Text.Length.ToString() + "/" + this.textBoxZusatz.MaxLength.ToString();
sortimentListe = (List<Sortiment>)Funktionen.SortimentLesen("Liste");
this.dGArtikel.ForeColor = Color.Black;
this.dTPLiefertag.Value = DateTime.Today.AddDays(1);
@ -67,13 +66,14 @@ namespace Deckungsbeitrag
if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Master)
{
this.comboBoxTyp.Enabled = true;
this.comboBoxTyp.SelectedIndex = 2;
this.comboBoxTyp.SelectedIndex = 1;
}
else
{
this.comboBoxTyp.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.Width = textBoxKundeName.Right + 10;
this.Height = 405;
this.comboBoxTyp.SelectedIndex = 1;
}
@ -122,22 +122,11 @@ namespace Deckungsbeitrag
}
private void comboBox_Load()
{
List<Aufgabe> aufgabenlist = Aufgabe.GetList(2);
foreach (Aufgabe aufgabe in aufgabenlist) this.comboBoxAufgabe.AutoCompleteCustomSource.Add(aufgabe.Bezeichnung);
this.comboBoxAufgabe.DataSource = aufgabenlist;
this.comboBoxAufgabe.DisplayMember = "Bezeichnung";
this.comboBoxAufgabe.SelectedIndex = -1;
List<Benutzer> benutzerlist = Benutzer.GetArbeiterList();
foreach (Benutzer benutzer in benutzerlist) this.comboBoxBenutzer.AutoCompleteCustomSource.Add(benutzer.Vorname);
this.comboBoxBenutzer.DataSource = benutzerlist;
this.comboBoxBenutzer.DisplayMember = "Vorname";
this.comboBoxBenutzer.SelectedIndex = -1;
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragTyp));
}
private void Load_Gridview(string kundeid, Aufgabe auf)
private void Load_Gridview(string kundeid, AuftragTyp auftragTyp)
{
List<KundeArtikel> artikelListe = KundeArtikel.GetList(kundeid);
//List<Sortiment> resultList = null;
@ -153,12 +142,12 @@ namespace Deckungsbeitrag
if (col.Name.Contains("Bearbeitet")) col.Visible = false;
if (col.Name == "Fehlmenge")
{
if (auf.Bezeichnung == "STA") col.Visible = true;
if (auftragTyp == AuftragTyp.Inventur) col.Visible = true;
else col.Visible = false;
}
if (col.Name == "Korrektur")
{
if(auf.Bezeichnung != "STA") col.Visible = true;
if(auftragTyp >= AuftragTyp.Standerhöhung) col.Visible = true;
else col.Visible = false;
}
}
@ -172,8 +161,25 @@ namespace Deckungsbeitrag
// Alle Spaltenbreiten an den Zellinhalt anpassen
this.dGArtikel.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
this.dGArtikel.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
// Alle Zeilenhöhen an Zellinhalt anpassen
this.dGArtikel.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
this.dGArtikel.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells);
int totalWidth = dGArtikel.RowHeadersVisible ? dGArtikel.RowHeadersWidth : 0;
foreach (DataGridViewColumn col in dGArtikel.Columns)
{
if (col.Visible) totalWidth += col.Width;
}
int totalHeight = dGArtikel.ColumnHeadersVisible ? dGArtikel.ColumnHeadersHeight : 0;
foreach (DataGridViewRow row in dGArtikel.Rows)
{
if (row.Visible) totalHeight += row.Height;
}
totalHeight += dGArtikel.ColumnHeadersHeight;
dGArtikel.ClientSize = new Size(totalWidth, totalHeight);
}
}
@ -213,20 +219,12 @@ namespace Deckungsbeitrag
{
if (meldung.AuftragVorhanden(Auftrag) == DialogResult.Yes)
{
//BEI BENUTZER WASCHSTRASSE DEAKTIVIERT
if (benutzer.Rolle != BenutzerRolle.Waschstrasse)
{
if (!string.IsNullOrWhiteSpace(this.comboBoxAufgabe.Text)) Auftrag.AufgabeID = Aufgabe.GetAufgabeID(this.comboBoxAufgabe.Text);
else Auftrag.AufgabeID = null;
if (!string.IsNullOrWhiteSpace(textBoxZusatz.Text)) Auftrag.ZusatzInfo = this.textBoxZusatz.Text;
if (!string.IsNullOrWhiteSpace(this.comboBoxBenutzer.Text)) Auftrag.ArbeiterID = this.comboBoxBenutzer.SelectedItem != null ? (int?)((Benutzer)this.comboBoxBenutzer.SelectedItem).BenutzerID : null;
}
if (benutzer.Rolle == BenutzerRolle.Verwaltung || benutzer.Rolle == BenutzerRolle.Admin) Auftrag.Status = AuftragStatus.Herrichten;
else Auftrag.Status = AuftragStatus.Aufgelegt;
//Wenn SONDERAUFTRAG(STH,STV,STA) dann ARTIKEL speichern.
if (Auftrag.Typ == AuftragTyp.Sonder)
if (Auftrag.Typ >= AuftragTyp.Inventur)
{
int tosave = 0;
int saved = 0;
@ -287,20 +285,12 @@ namespace Deckungsbeitrag
}
else
{
//BEI BENUTZER WASCHSTRASSE DEAKTIVIERT
if (benutzer.Rolle != BenutzerRolle.Waschstrasse)
{
if (!string.IsNullOrWhiteSpace(this.comboBoxAufgabe.Text)) Auftrag.AufgabeID = Aufgabe.GetAufgabeID(this.comboBoxAufgabe.Text);
else Auftrag.AufgabeID = null;
if (!string.IsNullOrWhiteSpace(textBoxZusatz.Text)) Auftrag.ZusatzInfo = this.textBoxZusatz.Text;
if (!string.IsNullOrWhiteSpace(this.comboBoxBenutzer.Text)) Auftrag.ArbeiterID = this.comboBoxBenutzer.SelectedItem != null ? (int?)((Benutzer)this.comboBoxBenutzer.SelectedItem).BenutzerID : null;
}
if (benutzer.Rolle == BenutzerRolle.Verwaltung || benutzer.Rolle == BenutzerRolle.Admin) Auftrag.Status = AuftragStatus.Herrichten;
else Auftrag.Status = AuftragStatus.Aufgelegt;
//Wenn SONDERAUFTRAG(STH,STV,STA) dann ARTIKEL speichern.
if (Auftrag.Typ == AuftragTyp.Sonder)
if (Auftrag.Typ >= AuftragTyp.Inventur)
{
int tosave = 0;
int saved = 0;
@ -321,7 +311,7 @@ namespace Deckungsbeitrag
{
if (int.TryParse(artikel.Cells[6].Value.ToString(), out int result))
{
if (Aufgabe.GetAufgabe(null, (int?)Auftrag.AufgabeID).Bezeichnung == "STV") negieren = true;
if (Auftrag.Typ == AuftragTyp.Standverminderung) negieren = true;
stand.Korrektur = (negieren && stand.Korrektur > 0) ? -result : result;
stand.KorrekturBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
@ -390,10 +380,6 @@ namespace Deckungsbeitrag
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void textBoxZusatz_TextChanged(object sender, EventArgs e)
{
this.label1.Text = this.textBoxZusatz.Text.Length.ToString() + "/" + this.textBoxZusatz.MaxLength.ToString();
}
private void textBoxCont_TextChanged(object sender, EventArgs e)
{
if (this.textBoxCont.Text == "0") { this.pictureBoxMinus.Enabled = false; this.pictureBoxMinus.BackColor = Color.Gray; }
@ -438,64 +424,6 @@ namespace Deckungsbeitrag
{
this.textBoxKndNr.Clear();
//Process.Start("C:\\Windows\\WinSxS\\amd64_microsoft-windows-osk_31bf3856ad364e35_10.0.22621.3672_none_8a93c823d58f9d77\\osk.exe");
}
//Wenn die Textbox verlassen wird, wir die Eingabe überprüft und weiter Schritte eingeleitet
private void textBoxKndNr_Leave(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBoxKndNr.Text))
{
//kunde = Kunde.GetKunde(textBoxKndNr.Text, null, null);
if (Kunde.GetKunde(textBoxKndNr.Text, null, null) == null)
{
if (MessageBox.Show($"Kunde konnte nicht gefunden werden. Möchtest du in der Liste suchen?", "Frage", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
FormListe liste = new FormListe(null, 0);
if (liste.ShowDialog() == DialogResult.OK)
{
kunde = liste.kunde;
}
}
else
{
this.textBoxKndNr.Clear();
this.textBoxKndNr.Focus();
return;
}
}
else this.kunde = Kunde.GetKunde(textBoxKndNr.Text, null, null);
textBoxKndNr.Text = kunde.KundeNummer;
textBoxKundeName.Text = kunde.Suchtext;
textBoxKundeName.Enabled = false;
string sortNr = kunde.KundeNummer;
Load_Gridview(sortNr, null);
}
else
{
if (textBoxKndNr.Focused)
{
if (MessageBox.Show($"Möchtest du den Kunden händisch eingeben?", "Frage", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
this.textBoxKundeName.Focus();
kunde = null;
}
}
}
}
//Wird verwendet wenn ein zusätzlicher Auftrag(Kunde) in ein Fach gelegt wird
private void buttonExtraKunde_Click(object sender, EventArgs e)
{
//FormNeuerAuftrag nauftrag = new FormNeuerAuftrag(benutzer, maschine, true, this.extraAuftrag, null);
//if (nauftrag.ShowDialog() == DialogResult.OK)
//{
// this.extraAuftrag = nauftrag.Auftrag;
//}
}
//Wenn der Kunde nicht gefunden wird und händisch eingegeben wird, wird beim verlassen der Textbox der Kunde als DIV ZIELKUNDE erstellt.
@ -515,17 +443,6 @@ namespace Deckungsbeitrag
if (e.KeyValue == 9) textBoxKundeName.Focus();
}
private void comboBoxAufgabe_SelectedValueChanged(object sender, EventArgs e)
{
if (comboBoxAufgabe.SelectedIndex == 3 || comboBoxAufgabe.SelectedIndex == 1)
{
if (this.kunde != null) Load_Gridview(this.kunde.KundeID.ToString(), Aufgabe.GetAufgabe(this.comboBoxAufgabe.Text.ToString(), null));
}
if (comboBoxAufgabe.SelectedIndex == 2)
{
if (this.kunde != null) Load_Gridview(this.kunde.KundeID.ToString(), Aufgabe.GetAufgabe(this.comboBoxAufgabe.Text.ToString(), null));
}
}
private void DataGridView_CellEnter(object sender, DataGridViewCellEventArgs e)
{
}
@ -548,5 +465,29 @@ namespace Deckungsbeitrag
}
}
}
private void comboBoxTyp_SelectedValueChanged(object sender, EventArgs e)
{
if((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Inventur)
{
if (this.kunde != null) Load_Gridview(this.kunde.KundeID.ToString(), (AuftragTyp)comboBoxTyp.SelectedValue);
this.dGArtikel.Enabled = this.dGArtikel.Visible = true;
this.Width = this.dGArtikel.Right + 25;
this.Height = this.dGArtikel.Bottom + this.buttonSpeichern.Height + 60;
}
if ((AuftragTyp)comboBoxTyp.SelectedValue >= AuftragTyp.Standerhöhung)
{
if (this.kunde != null) Load_Gridview(this.kunde.KundeID.ToString(), (AuftragTyp)comboBoxTyp.SelectedValue);
this.dGArtikel.Enabled = this.dGArtikel.Visible = true;
this.Width = this.dGArtikel.Right + 25;
this.Height = this.dGArtikel.Bottom + this.buttonSpeichern.Height + 60;
}
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Standart)
{
this.dGArtikel.Enabled = this.dGArtikel.Visible = false;
this.Width = textBoxKundeName.Right + 30;
this.Height = 405;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,9 @@ namespace DatenDB
{
Unbekannt = 0,
Standart = 1,
Sonder = 2
Inventur = 2,
Standerhöhung = 3,
Standverminderung = 4
}
@ -97,7 +99,22 @@ namespace DatenDB
DatenbankConnection.GetConnection().Close();
return resultList;
}
public static List<Auftrag> GetStatusList(int? status)
{
DatenbankConnection.GetConnection().Open();
List<Auftrag> resultList = new List<Auftrag>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (status == null) command.CommandText = $"select {COLUMNS} from {TABLE} where status <= 7 order by status desc, liefertag asc";
else command.CommandText = $"select {COLUMNS} from {TABLE} where status = {status} order by status desc, liefertag asc";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new Auftrag(reader));
reader.Close();
DatenbankConnection.GetConnection().Close();
return resultList;
}
public static List<Auftrag> GetExpeditLists(int? typ)
{
DatenbankConnection.GetConnection().Open();
@ -105,9 +122,7 @@ namespace DatenDB
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (typ == null) command.CommandText = $"select {COLUMNS} from {TABLE} where status <= 7 order by status desc, liefertag asc";
else if (typ <= 2) command.CommandText = $"select {COLUMNS} from {TABLE} where typ = {typ} and status < 7 order by status desc, liefertag asc";
else command.CommandText = $"select {COLUMNS} from {TABLE} where status = {typ} order by status desc, liefertag asc";
command.CommandText = $"select {COLUMNS} from {TABLE} where typ >= {typ} and status < 7 order by status desc, liefertag asc";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new Auftrag(reader));
@ -202,12 +217,12 @@ namespace DatenDB
/// Die Aufgabe (STV, STH, INV) wird angezeigt wenn vorhanden.
/// </summary>
private string _auftragaufgabe;
[OLVColumn("Aufgabe", DisplayIndex = 6, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)]
[OLVIgnore]//[OLVColumn("Aufgabe", DisplayIndex = 6, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)]
public string AuftragAufgabe
{
get
{
if (this.Typ == AuftragTyp.Sonder) return _auftragaufgabe = Aufgabe.GetAufgabe(null, AufgabeID).Bezeichnung;
if (this.Typ >= AuftragTyp.Inventur) return _auftragaufgabe = Aufgabe.GetAufgabe(null, AufgabeID).Bezeichnung;
else return null;
}
@ -296,7 +311,7 @@ namespace DatenDB
{
get
{
if(Typ == AuftragTyp.Sonder)
if(Typ >= AuftragTyp.Inventur)
{
if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty;
else return _fertig = "Auftrag abschließen";
@ -318,7 +333,7 @@ namespace DatenDB
[OLVColumn("Zusatz", IsVisible = false)]
public string ZusatzInfo { get; set; }
[OLVColumn("Typ", IsVisible = false)]
[OLVColumn("Typ", IsVisible = true, DisplayIndex = 6)]
public AuftragTyp Typ { get; set; }
/// <summary>

View File

@ -17,12 +17,27 @@ namespace DatenDB
DO = 4,
FR = 5,
SA = 6,
STV = 7
STV = 7,
LAGER = 8
}
public class Fach
{
private const string COLUMNS = "fach_id, maschine_id, kunde_id, wprogramm_id, gewicht, extra, gewaschen, extrakunde_id, liefertag, auftrag_id, extraauftrag_id, tischsummary, containersummary";
private const string TABLE = "kundenverwaltung.fach";
public int? FachID { get; set; }
public int MaschineID { get; set; }
public int KundeID { get; set; }
public int WProgrammID { get; set; }
public double? Gewicht { get; set; }
public DateTime Gewaschen { get; set; }
public int? Extra { get; set; }
public Liefertag Liefertag { get; set; } = Liefertag.MO;
public int? ExtraKundeID { get; set; }
public DateTime? Lieferdatum { get; set; }
public int? AuftragID { get; set; }
public int? ExtraAuftragID { get; set; }
public bool TischSummary { get; set; }
public bool ContainerSummary { get; set; }
public static List<Fach> GetVerlauf(int? mID)
{
@ -88,20 +103,6 @@ namespace DatenDB
return result;
}
public int? FachID { get; set; }
public int MaschineID { get; set; }
public int KundeID { get; set; }
public int WProgrammID { get; set; }
public double? Gewicht { get; set; }
public DateTime Gewaschen { get; set; }
public int? Extra { get; set; }
public Liefertag Liefertag { get; set; } = Liefertag.MO;
public int? ExtraKundeID { get; set; }
public DateTime? Lieferdatum { get; set; }
public int? AuftragID { get; set; }
public int? ExtraAuftragID { get; set; }
public bool TischSummary { get; set; }
public bool ContainerSummary { get; set; }
public Fach(NpgsqlDataReader reader)