Compare commits

..

No commits in common. "dbfd17bad3b33d5071400e20ed46337e4c11d7f2" and "62f39cad514e0f32bc1cc1d0a65f4c5990a46afc" have entirely different histories.

36 changed files with 1148 additions and 1226 deletions

View File

@ -1,39 +0,0 @@
namespace Deckungsbeitrag.AA_Forms
{
partial class CustomMessageBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "CustomMessageBox";
}
#endregion
}
}

View File

@ -1,20 +0,0 @@
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 Deckungsbeitrag.AA_Forms
{
public partial class CustomMessageBox : Form
{
public CustomMessageBox()
{
InitializeComponent();
}
}
}

View File

@ -80,7 +80,7 @@
this.tLPAuftrag.Dock = System.Windows.Forms.DockStyle.Fill;
this.tLPAuftrag.ForeColor = System.Drawing.Color.Black;
this.tLPAuftrag.Location = new System.Drawing.Point(0, 0);
this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4);
this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tLPAuftrag.Name = "tLPAuftrag";
this.tLPAuftrag.RowCount = 4;
this.tLPAuftrag.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F));
@ -182,7 +182,7 @@
this.fLP_T5.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T5.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T5.Location = new System.Drawing.Point(1108, 66);
this.fLP_T5.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.fLP_T5.Name = "fLP_T5";
this.fLP_T5.Size = new System.Drawing.Size(271, 551);
this.fLP_T5.TabIndex = 19;
@ -195,7 +195,7 @@
this.fLP_T4.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T4.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T4.Location = new System.Drawing.Point(832, 66);
this.fLP_T4.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.fLP_T4.Name = "fLP_T4";
this.fLP_T4.Size = new System.Drawing.Size(268, 551);
this.fLP_T4.TabIndex = 18;
@ -208,7 +208,7 @@
this.fLP_T3.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T3.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T3.Location = new System.Drawing.Point(556, 66);
this.fLP_T3.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.fLP_T3.Name = "fLP_T3";
this.fLP_T3.Size = new System.Drawing.Size(268, 551);
this.fLP_T3.TabIndex = 17;
@ -221,7 +221,7 @@
this.fLP_T2.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T2.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T2.Location = new System.Drawing.Point(280, 66);
this.fLP_T2.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.fLP_T2.Name = "fLP_T2";
this.fLP_T2.Size = new System.Drawing.Size(268, 551);
this.fLP_T2.TabIndex = 16;
@ -309,7 +309,7 @@
this.fLP_T1.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T1.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T1.Location = new System.Drawing.Point(4, 66);
this.fLP_T1.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.fLP_T1.Name = "fLP_T1";
this.fLP_T1.Size = new System.Drawing.Size(268, 551);
this.fLP_T1.TabIndex = 15;
@ -320,7 +320,7 @@
this.textBoxScan.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxScan.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxScan.Location = new System.Drawing.Point(4, 687);
this.textBoxScan.Margin = new System.Windows.Forms.Padding(4);
this.textBoxScan.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBoxScan.Name = "textBoxScan";
this.textBoxScan.Size = new System.Drawing.Size(268, 46);
this.textBoxScan.TabIndex = 25;

View File

@ -42,6 +42,8 @@
this.labelContainer = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.buttonSWS = new System.Windows.Forms.Button();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.comboBoxPriority = new System.Windows.Forms.ComboBox();
@ -87,17 +89,17 @@
// buttonFertig
//
this.buttonFertig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFertig.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonFertig.BackColor = System.Drawing.Color.Turquoise;
this.buttonFertig.FlatAppearance.BorderSize = 0;
this.buttonFertig.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFertig.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFertig.ForeColor = System.Drawing.Color.Black;
this.buttonFertig.Location = new System.Drawing.Point(489, 615);
this.buttonFertig.Location = new System.Drawing.Point(286, 615);
this.buttonFertig.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonFertig.Name = "buttonFertig";
this.buttonFertig.Size = new System.Drawing.Size(300, 50);
this.buttonFertig.Size = new System.Drawing.Size(267, 50);
this.buttonFertig.TabIndex = 14;
this.buttonFertig.Text = "Speichern/Abschließen";
this.buttonFertig.Text = "Auftrag abschließen";
this.buttonFertig.UseVisualStyleBackColor = false;
this.buttonFertig.Click += new System.EventHandler(this.buttonFertig_Click);
//
@ -109,10 +111,10 @@
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.Black;
this.buttonAbbrechen.Location = new System.Drawing.Point(795, 615);
this.buttonAbbrechen.Location = new System.Drawing.Point(830, 615);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(300, 50);
this.buttonAbbrechen.Size = new System.Drawing.Size(267, 50);
this.buttonAbbrechen.TabIndex = 0;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
@ -225,6 +227,40 @@
this.label6.TabIndex = 32;
this.label6.Text = "schmutzig";
//
// buttonSWS
//
this.buttonSWS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSWS.BackColor = System.Drawing.Color.Yellow;
this.buttonSWS.FlatAppearance.BorderSize = 0;
this.buttonSWS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSWS.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSWS.ForeColor = System.Drawing.Color.Black;
this.buttonSWS.Location = new System.Drawing.Point(14, 615);
this.buttonSWS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonSWS.Name = "buttonSWS";
this.buttonSWS.Size = new System.Drawing.Size(267, 50);
this.buttonSWS.TabIndex = 34;
this.buttonSWS.Text = "Sonderetikett drucken";
this.buttonSWS.UseVisualStyleBackColor = false;
this.buttonSWS.Click += new System.EventHandler(this.buttonSWS_Click);
//
// buttonSpeichern
//
this.buttonSpeichern.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSpeichern.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonSpeichern.FlatAppearance.BorderSize = 0;
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.Black;
this.buttonSpeichern.Location = new System.Drawing.Point(558, 615);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(267, 50);
this.buttonSpeichern.TabIndex = 36;
this.buttonSpeichern.Text = "Änderungen speichern";
this.buttonSpeichern.UseVisualStyleBackColor = false;
this.buttonSpeichern.Click += new System.EventHandler(this.buttonSpeichern_Click);
//
// label7
//
this.label7.AutoSize = true;
@ -364,7 +400,7 @@
this.oLVArtikel.View = System.Windows.Forms.View.Details;
this.oLVArtikel.CellEditFinished += new BrightIdeasSoftware.CellEditEventHandler(this.oLVArtikel_CellEditFinished);
this.oLVArtikel.CellEditStarting += new BrightIdeasSoftware.CellEditEventHandler(this.oLVArtikel_CellEditStarting);
this.oLVArtikel.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.OLVArtikel_ItemCheck);
this.oLVArtikel.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.oLVArtikel_ItemCheck);
this.oLVArtikel.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.oLVArtikel_ItemChecked);
this.oLVArtikel.SizeChanged += new System.EventHandler(this.oLVArtikel_SizeChanged);
//
@ -385,6 +421,8 @@
this.Controls.Add(this.comboBoxPriority);
this.Controls.Add(this.label10);
this.Controls.Add(this.label7);
this.Controls.Add(this.buttonSpeichern);
this.Controls.Add(this.buttonSWS);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.pictureBoxMinus);
@ -433,6 +471,8 @@
private System.Windows.Forms.Label labelContainer;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button buttonSWS;
private System.Windows.Forms.Button buttonSpeichern;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ComboBox comboBoxPriority;

View File

@ -21,8 +21,7 @@ namespace Deckungsbeitrag
{
public partial class FormAuftragDetail : Form
{
private Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>();
private Dictionary<int, int> auftragDictionary = new Dictionary<int, int>();
private Dictionary<string, int[]> dictionary = new Dictionary<string, int[]>();
public Auftrag auftrag;
public Benutzer benutzer;
public List<AuftragArtikel> artikelList;
@ -37,7 +36,7 @@ namespace Deckungsbeitrag
//WENN AUFTRAG SPEICHERN
private bool _tosave = false;
public bool Tosave
public bool tosave
{
get { return _tosave; }
set
@ -45,15 +44,15 @@ namespace Deckungsbeitrag
_tosave = value;
if (_tosave)
{
buttonFertig.Enabled = true;
buttonFertig.BackColor = Color.FromArgb(0,192,0);
buttonSpeichern.Enabled = true;
buttonSpeichern.BackColor = Color.FromArgb(0,192,0);
}
}
}
//WENN AUFTRAG ABZUSCHLIESSEN
private bool _toclose = false;
public bool Toclose
public bool toclose
{
get { return _toclose; }
set
@ -74,6 +73,9 @@ namespace Deckungsbeitrag
//this.BackColor = Properties.Settings.Default.Wirlblau;
labelContainer_TextChanged(this.labelContainer, EventArgs.Empty);
//SPEICHERN UND ABSCHLIESSEN BUTTONS WERDEN FUNKTIONSLOS UND GRAU
buttonSpeichern.Enabled = buttonFertig.Enabled = false;
buttonSpeichern.BackColor = buttonFertig.BackColor = Color.Gray;
}
public FormAuftragDetail(Auftrag auftrag, Benutzer benutzer) : this()
{
@ -105,13 +107,13 @@ namespace Deckungsbeitrag
if (this.auftrag.Typ != AuftragTyp.Inventur || (this.auftrag.Typ == AuftragTyp.Inventur & this.auftrag.Status == AuftragStatus.Herrichten)) Load_OLV();
else
{
if (this.auftrag.Status == AuftragStatus.Warten) buttonFertig.Visible = false;
if (this.auftrag.Status == AuftragStatus.Warten) buttonSpeichern.Visible = buttonFertig.Visible = buttonSWS.Visible = false;
Load_UCInventur(this.auftrag);
}
this.ClientSize = new Size(this.oLVArtikel.Right + 10, this.ClientSize.Height);
//WENN STATUS VORBEREITET BUTTON FERTIG ENABLEN
if (auftrag.Status == AuftragStatus.Vorbereitet) { buttonFertig.Enabled = true; buttonFertig.BackColor = Color.FromArgb(0, 192, 0); Toclose = true; }
if (auftrag.Status == AuftragStatus.Vorbereitet) { buttonFertig.Enabled = true; buttonFertig.BackColor = Color.FromArgb(0, 192, 0); toclose = true; }
}
private void Load_UCInventur(Auftrag _auftrag)
@ -173,11 +175,11 @@ namespace Deckungsbeitrag
this.comboBoxFahrer.DataSource = benutzerliste;
this.comboBoxFahrer.ValueMember = "BenutzerName";
this.comboBoxPriority.DataSource = Enum.GetValues(typeof(Priority));
this.comboBoxPriority.DataSource = Enum.GetValues(typeof(AuftragPriority));
}
private void comboBox_SelectedValueChanged(object sender, EventArgs e)
{
Tosave = true;
tosave = true;
}
private void labelContainer_TextChanged(object sender, EventArgs e)
{
@ -185,68 +187,11 @@ namespace Deckungsbeitrag
else { this.pictureBoxMinus.Enabled = this.pictureBoxDirtMinus.Enabled = true; this.pictureBoxMinus.BackColor = this.pictureBoxDirtMinus.BackColor = Color.Red; }
}
//ÄNDERUNGEN SPEICHERN
private void AuftragSpeichern()
{
auftrag.Liefertag = dTPLiefertag.Value;
auftrag.ContainerClean = int.Parse(this.labelContainer.Text);
auftrag.Container = int.Parse(this.labelContDirt.Text);
auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID;
auftrag.Priority = this.comboBoxPriority.SelectedIndex == -1 ? Priority.None : ((Priority)this.comboBoxPriority.SelectedItem);
auftrag.ZusatzInfo = this.textBoxZusatz.Text;
auftrag.Save();
if (auftrag.Typ == AuftragTyp.Regelmäßig || (auftrag.Typ == AuftragTyp.Inventur & auftrag.Status == AuftragStatus.Herrichten))
{
foreach (var kvp in auftragDictionary)
{
AuftragArtikel aufart = AuftragArtikel.GetArtikel(kvp.Key);
aufart.Anzahl = (int)kvp.Value;
if (aufart.Anzahl == 0) aufart.Erledigt = true;
else aufart.Erledigt = false;
aufart.Save();
}
//foreach (OLVListItem item in this.oLVArtikel.Items)
//{
// AuftragArtikel art = (AuftragArtikel)item.RowObject;
// if (item.Checked) art.Erledigt = true;
// else art.Erledigt = false;
// art.Save();
//}
if (auftrag.Typ == AuftragTyp.Inventur)
{
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
kndart.Reklamation = kvp.Value[0];
kndart.Fehlmenge = kvp.Value[1];
kndart.Stand = kvp.Value[2];
kndart.Korrektur = kvp.Value[3];
kndart.Save();
}
WriteToCSV(dictionary);
}
}
Tosave = false;
}
//SCHMUTZWÄSCHESCHEIN DRUCKEN
private void EtikettDrucken()
{
if (MessageBox.Show("Möchtest du JETZT Etiketten für die erfolgten Änderung drucken?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
if (Funktionen.SonderEtikett_Drucken(this.auftrag, dictionary) == DialogResult.OK)
{
etikettgedruckt = true;
}
}
}
#region ToSave
/// <summary>
/// TOSAVE
/// </summary>
//BEI CLICK AUF CONTAINER +/- SPEICHERN WIRD AKITV
private void Container_Click(object sender, EventArgs e)
@ -267,7 +212,7 @@ namespace Deckungsbeitrag
if (pb.Name.ToString().Contains("Minus")) cont--;
this.labelContainer.Text = cont.ToString();
}
Tosave = true;
tosave = true;
}
//BEI CLICK AUF DATUM SPEICHERN WIRD AKTIV
@ -279,20 +224,76 @@ namespace Deckungsbeitrag
if (ctr.Name.Contains("dTP"))
{
ctr.Enabled = true;
Tosave = true;
tosave = true;
}
}
}
//WENN LISTVIEW NICHT FOCUSED (FORM.LOAD) TOSAVE BLEIBT FALSE
private void OLVArtikel_ItemCheck(object sender, ItemCheckEventArgs e)
private void oLVArtikel_ItemCheck(object sender, ItemCheckEventArgs e)
{
ObjectListView olv = (ObjectListView)sender;
if (e.NewValue != e.CurrentValue) { Tosave = true; }
if (e.NewValue != e.CurrentValue) { tosave = true; }
}
/// <summary>
/// TOCLOSE
/// </summary>
private void oLVArtikel_ItemChecked(object sender, ItemCheckedEventArgs e)
{
ObjectListView olv = (ObjectListView)sender;
if (olv.Items.Count == olv.CheckedItems.Count) toclose = true;
foreach(OLVListItem item in olv.CheckedItems)
{
AuftragArtikel auftragArtikel = (AuftragArtikel)item.RowObject;
auftragArtikel.Erledigt = true;
auftragArtikel.Save();
}
}
/// <summary>
/// BUTTONS
/// </summary>
//ÄNDERUNGEN SPEICHERN
private void buttonSpeichern_Click(object sender, EventArgs e)
{
if (tosave)
{
auftrag.Liefertag = dTPLiefertag.Value;
auftrag.ContainerClean = int.Parse(this.labelContainer.Text);
auftrag.Container = int.Parse(this.labelContDirt.Text);
auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID;
auftrag.Priority = this.comboBoxPriority.SelectedIndex == -1 ? AuftragPriority.None : ((AuftragPriority)this.comboBoxPriority.SelectedItem);
auftrag.ZusatzInfo = this.textBoxZusatz.Text;
auftrag.Save();
if (auftrag.Typ == AuftragTyp.Regelmäßig || (auftrag.Typ == AuftragTyp.Inventur & auftrag.Status == AuftragStatus.Herrichten))
{
foreach (OLVListItem item in this.oLVArtikel.Items)
{
AuftragArtikel art = (AuftragArtikel)item.RowObject;
if (item.Checked) art.Erledigt = true;
else art.Erledigt = false;
art.Save();
}
if (auftrag.Typ == AuftragTyp.Inventur)
{
WriteToCSV(dictionary);
}
}
tosave = false;
}
this.DialogResult = DialogResult.OK;
this.Close();
}
#endregion
#region Button-Click
//AUFTRAG ABBRECHEN
private void buttonAbbrechen_Click(object sender, EventArgs e)
{
@ -314,52 +315,26 @@ namespace Deckungsbeitrag
this.DialogResult = DialogResult.Cancel;
this.Close();
}
//AUFTRAG ABSCHLIESSEN
private void buttonFertig_Click(object sender, EventArgs e)
{
EtikettDrucken();
if (Tosave && etikettgedruckt) AuftragSpeichern();
else Toclose = false;
if (Toclose)
if (toclose)
{
if (int.Parse(this.labelContainer.Text) == 0)
{
switch (auftrag.Typ)
{
case AuftragTyp.Geschäft:
meldung.NoCleanContainer();
return;
case AuftragTyp.Standart:
meldung.NoCleanContainer();
return;
case AuftragTyp.Inventur:
break;
case AuftragTyp.SOLL_Erhoehung:
break;
case AuftragTyp.SOLL_Verminderung:
break;
case AuftragTyp.Regelmäßig:
break;
case AuftragTyp.AufAbruf:
meldung.NoCleanContainer();
return;
case AuftragTyp.Laufzettel:
break;
default:
break;
}
}
if (auftrag.Typ < AuftragTyp.Standerhöhung || auftrag.Typ > AuftragTyp.Regelmäßig)
if (int.Parse(this.labelContainer.Text) == 0) if (meldung.NoCleanContainer() == DialogResult.OK) return;
if (int.Parse(this.labelContainer.Text) != auftrag.ContainerClean)
{
switch (meldung.DifferentCleanContainer())
{
case DialogResult.Cancel:
return;
break;
case DialogResult.Yes:
{
auftrag.ContainerClean = int.Parse(this.labelContainer.Text);
auftrag.Liefertag = dTPLiefertag.Value;
//WENN BEARBEITET UND AUSGEDRUCKT WIRD GEDRUCKT VERÄNDERT UND ERSTELLT IST URSPRUNGSDATUM
auftrag.Gedruckt = DateTime.Now;
auftrag.GedrucktVon = benutzer.BenutzerID;
auftrag.Status = AuftragStatus.Fertig;
@ -371,15 +346,25 @@ namespace Deckungsbeitrag
}
else nocont = false;
Funktionen.Etikett_Drucken(auftrag, nocont);
DialogResult result = Funktionen.Etikett_Drucken(auftrag, nocont);
if (result == DialogResult.OK)
{
this.auftrag.Save();
this.Close();
}
}
break;
case DialogResult.No:
{
auftrag.ContainerClean = int.Parse(this.labelContainer.Text);
auftrag.Liefertag = dTPLiefertag.Value;
//WENN BEARBEITET UND NICHT GEDRUCKT WIRD ERSTELLT VERÄNDERT UND GEDRUCKT IST URSPRUNGSDATUM
auftrag.Erstellt = DateTime.Now;
auftrag.ErstelltVon = (int)benutzer.BenutzerID;
auftrag.Status = AuftragStatus.Fertig;
this.auftrag.Save();
this.Close();
}
break;
default:
@ -391,10 +376,8 @@ namespace Deckungsbeitrag
auftrag.Erledigt = DateTime.Now;
auftrag.ErledigtVon = (int)benutzer.BenutzerID;
auftrag.Status = AuftragStatus.Fertig;
auftrag.Save();
}
auftrag.Save();
// Wenn Inventur wird Fertig-File erstellt.
if (auftrag.Typ == AuftragTyp.Inventur)
{
string loadPath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
@ -407,36 +390,35 @@ namespace Deckungsbeitrag
File.Delete(Path.Combine(loadPath, invFiles[0]));
}
}
Toclose = Tosave = false;
this.DialogResult = DialogResult.OK;
this.Close();
toclose = tosave = false;
}
this.DialogResult = DialogResult.OK;
this.Close();
}
#endregion
/// <summary>
/// TOCLOSE
/// </summary>
private void oLVArtikel_ItemChecked(object sender, ItemCheckedEventArgs e)
//SCHMUTZWÄSCHESCHEIN DRUCKEN
private void buttonSWS_Click(object sender, EventArgs e)
{
ObjectListView olv = (ObjectListView)sender;
if (olv.Items.Count == olv.CheckedItems.Count) Toclose = true;
foreach(OLVListItem item in olv.CheckedItems)
//TODO: Bestand von allen Artikeln speichern und für Druck vorbereiten.
//TODO: Eventuell die Zahlen in CSV speichern und von dort für Druck verwenden?!
//TODO: Erstellen von SonderAuftrag und Drucken von Etikett testen.
if (MessageBox.Show("Möchtest du Etiketten für die Änderung drucken?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
AuftragArtikel auftragArtikel = (AuftragArtikel)item.RowObject;
auftragArtikel.Erledigt = true;
auftragArtikel.Save();
}
}
Funktionen.SonderEtikett_Drucken(this.auftrag, dictionary);
etikettgedruckt = true;
}
}
/// <summary>
/// SonderAuftrag in CSV-Liste eintragen. Jede Änderung wird in eine Zeile eingetragen. Rek./NW/Rest
/// </summary>
/// <param name="kndart"></param>
private void WriteToCSV(Dictionary<int, int[]> dictionary)
private void WriteToCSV(Dictionary<string, int[]> dictionary)
{
Kunde _knd = Kunde.GetKunde(null, auftrag.KundeID, null);
Benutzer _user = this.benutzer;
@ -477,9 +459,7 @@ namespace Deckungsbeitrag
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
Artikel _artikel = Artikel.GetArtikel(null, kndart.ArtikelID);
string artikelKey = _artikel.Bezeichnung; // z.B. "ART1"
string artikelKey = kvp.Key; // z.B. "ART1"
int[] artbestand = kvp.Value; // z.B. [3, 0, 5]
int artikelIndex = Array.IndexOf(artikelArray, artikelKey);
@ -511,6 +491,11 @@ namespace Deckungsbeitrag
}
/// <summary>
/// UNUSED THINGS
/// </summary>
//PRINT PAGE FÜR DRUCK
private void FormAuftragDetail_Shown(object sender, EventArgs e)
{
fb = new UCFeedback(benutzer);
@ -553,18 +538,12 @@ namespace Deckungsbeitrag
ObjectListView olv = (ObjectListView)sender;
AuftragArtikel auftragArtikel = (AuftragArtikel)e.RowObject;
int newValue = (int)e.NewValue;
if (e.Column.Text == "Anzahl") diff = (int)e.Value - ((int)e.NewValue);
if (diff > 0) tosave = true;
if (this.auftrag.Typ == AuftragTyp.SOLL_Verminderung) if (newValue > 0) newValue = newValue * -1;
if (e.Column.Text == "Anzahl") diff = (int)e.Value - (newValue);
if (diff != 0) Tosave = true;
if (auftragDictionary.TryGetValue((int)auftragArtikel.AuftragArtikelID, out int val))
{
val = newValue;
if (newValue == 0) e.ListViewItem.Checked = true;
}
else auftragDictionary.Add((int)auftragArtikel.AuftragArtikelID, newValue);
auftragArtikel.Anzahl = (int)e.NewValue;
auftragArtikel.Save();
if (auftragArtikel.Anzahl == 0) e.ListViewItem.Checked = true;
KundeArtikel kndart = KundeArtikel.GetKundeArtikelVonArtikelID(this.kunde.KundeID, auftragArtikel.ArtikelID);
@ -573,15 +552,20 @@ namespace Deckungsbeitrag
int stand = kndart.Stand;
int korrektur = kndart.Korrektur;
KorrigiereBestand(diff, ref reklamation, ref fehlmenge, ref stand, ref korrektur);
if (dictionary.TryGetValue((int)kndart.KundeArtikelID, out int[] value))
kndart.Reklamation = reklamation;
kndart.Fehlmenge = fehlmenge;
kndart.Stand = stand;
kndart.Korrektur = korrektur;
kndart.Save();
if (dictionary.TryGetValue(kndart.ArtikelName, out int[] value))
{
for (int i = 0; i < value.Length; i++)
{
value[i] += bestand[i];
}
}
else dictionary.Add((int)kndart.KundeArtikelID, bestand);
else dictionary.Add(kndart.ArtikelName, bestand);
//WriteToCSV(kndart);
this.ResumeLayout();
this.Cursor = Cursors.Default;
@ -592,7 +576,7 @@ namespace Deckungsbeitrag
bestand = new int[4];
if (diff == 0)
return;
if (diff < 0 || this.auftrag.Typ == AuftragTyp.SOLL_Erhoehung) { bestand[2] = diff; stand += diff; return; }
if (diff < 0) { bestand[2] = diff; stand += diff; return; }
int rest = diff * 1;
@ -628,7 +612,7 @@ namespace Deckungsbeitrag
}
private void oLVArtikel_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
Tosave = true;
tosave = true;
}
private void FormAuftragDetail_Resize(object sender, EventArgs e)
@ -645,20 +629,21 @@ namespace Deckungsbeitrag
private void FormAuftragDetail_FormClosing(object sender, FormClosingEventArgs e)
{
if (Tosave)
if (tosave)
{
if (MessageBox.Show("Möchtest du die Änderungen wirklich verwerfen?", "ÄNDERUNGEN VERWERFEN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
if (MessageBox.Show("Möchtest du die Änderungen wirklich verwerfen?", "ÄNDERUNGEN VERWERFEN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
e.Cancel = true;
return;
this.DialogResult = DialogResult.Cancel;
this.Close();
}
else { e.Cancel = true; return; }
}
}
}
}
//CHANGES: 1. Es wird ab sofort nur ein Button zum Speichern und Abschließen bereitgestellt. System entscheidet was getan wird.
//CHANGES: 2. Änderungen werden nur gespeichert wenn ein Etikett gedruckt wurde.
//CHANGES: 3. Abschließen nur möglich wenn alle Artikel auf 0 sind (Checked) und gespeichert wurde.
//CHANGES: Bei Druckabbruch wird die geänderte Zahl NICHT zurückgesetzt. (Das muss händisch erfolgen)
//CHANGES: Wenn die Zahlen zurückgesetzt werden sollen, muss AuftragDetail geschlossen werden.
//CHANGES: Wenn die reduzierte Anzahl bei SOLL-Verminderung nicht negativ ist, wird diese negativ gemacht. So wird ein möglicher Fehler ausgebessert.
//DONE: Korrigiere Bestand: Wenn -Zahl dann Stand - Zahl.
//DONE: Speichern etc. durchgehen und adaptieren
//DONE: Feedback Button hinzufügen
//DONE: ComboBox Fahrer und Priorität implementieren
//DONE: Container schmutzig bearbeitbar machen

View File

@ -39,6 +39,9 @@
this.buttonSWS_Drucken = new System.Windows.Forms.Button();
this.chartFehlmenge = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.groupBoxKndInfo = new System.Windows.Forms.GroupBox();
this.tableLayoutPanelInfo = new System.Windows.Forms.TableLayoutPanel();
this.labelAnmerkung = new System.Windows.Forms.Label();
this.labelAufgabe = new System.Windows.Forms.Label();
this.buttonTourenListe = new System.Windows.Forms.Button();
this.buttonStats = new System.Windows.Forms.Button();
this.buttonEinstellung = new System.Windows.Forms.Button();
@ -54,12 +57,9 @@
this.tabPageVorbereitet = new System.Windows.Forms.TabPage();
this.objectListViewVorbereitet = new BrightIdeasSoftware.ObjectListView();
this.buttonNW = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.labelAnmerkung = new System.Windows.Forms.Label();
this.labelAufgabe = new System.Windows.Forms.Label();
this.labelZusatz = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.chartFehlmenge)).BeginInit();
this.groupBoxKndInfo.SuspendLayout();
this.tableLayoutPanelInfo.SuspendLayout();
this.tabPageRampe.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).BeginInit();
this.tabPageSonder.SuspendLayout();
@ -71,7 +71,6 @@
this.tabControlAuftragList.SuspendLayout();
this.tabPageVorbereitet.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).BeginInit();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// buttonNeuerAuftrag
@ -174,7 +173,7 @@
// groupBoxKndInfo
//
this.groupBoxKndInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxKndInfo.Controls.Add(this.flowLayoutPanel1);
this.groupBoxKndInfo.Controls.Add(this.tableLayoutPanelInfo);
this.groupBoxKndInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBoxKndInfo.ForeColor = System.Drawing.Color.Red;
this.groupBoxKndInfo.Location = new System.Drawing.Point(916, 452);
@ -187,6 +186,42 @@
this.groupBoxKndInfo.VisibleChanged += new System.EventHandler(this.GroupBoxKndInfo_VisibleChanged);
this.groupBoxKndInfo.Paint += new System.Windows.Forms.PaintEventHandler(this.GroupBoxKndInfo_Paint);
//
// tableLayoutPanelInfo
//
this.tableLayoutPanelInfo.ColumnCount = 1;
this.tableLayoutPanelInfo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanelInfo.Controls.Add(this.labelAnmerkung, 0, 0);
this.tableLayoutPanelInfo.Controls.Add(this.labelAufgabe, 0, 1);
this.tableLayoutPanelInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelInfo.Location = new System.Drawing.Point(3, 26);
this.tableLayoutPanelInfo.Name = "tableLayoutPanelInfo";
this.tableLayoutPanelInfo.RowCount = 2;
this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanelInfo.Size = new System.Drawing.Size(287, 154);
this.tableLayoutPanelInfo.TabIndex = 0;
//
// labelAnmerkung
//
this.labelAnmerkung.AutoSize = true;
this.labelAnmerkung.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelAnmerkung.ForeColor = System.Drawing.Color.Red;
this.labelAnmerkung.Location = new System.Drawing.Point(3, 0);
this.labelAnmerkung.Name = "labelAnmerkung";
this.labelAnmerkung.Size = new System.Drawing.Size(281, 77);
this.labelAnmerkung.TabIndex = 0;
this.labelAnmerkung.Text = "label2";
//
// labelAufgabe
//
this.labelAufgabe.AutoSize = true;
this.labelAufgabe.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelAufgabe.Location = new System.Drawing.Point(3, 77);
this.labelAufgabe.Name = "labelAufgabe";
this.labelAufgabe.Size = new System.Drawing.Size(281, 77);
this.labelAufgabe.TabIndex = 1;
this.labelAufgabe.Text = "label3";
//
// buttonTourenListe
//
this.buttonTourenListe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -481,49 +516,6 @@
this.buttonNW.UseVisualStyleBackColor = true;
this.buttonNW.Click += new System.EventHandler(this.ButtonNW_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.labelAnmerkung);
this.flowLayoutPanel1.Controls.Add(this.labelAufgabe);
this.flowLayoutPanel1.Controls.Add(this.labelZusatz);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 26);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(287, 154);
this.flowLayoutPanel1.TabIndex = 0;
//
// labelAnmerkung
//
this.labelAnmerkung.AutoSize = true;
this.labelAnmerkung.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelAnmerkung.ForeColor = System.Drawing.Color.Red;
this.labelAnmerkung.Location = new System.Drawing.Point(3, 0);
this.labelAnmerkung.Name = "labelAnmerkung";
this.labelAnmerkung.Size = new System.Drawing.Size(70, 25);
this.labelAnmerkung.TabIndex = 2;
this.labelAnmerkung.Text = "label2";
//
// labelAufgabe
//
this.labelAufgabe.AutoSize = true;
this.labelAufgabe.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelAufgabe.Location = new System.Drawing.Point(3, 25);
this.labelAufgabe.Name = "labelAufgabe";
this.labelAufgabe.Size = new System.Drawing.Size(70, 25);
this.labelAufgabe.TabIndex = 3;
this.labelAufgabe.Text = "label3";
//
// labelZusatz
//
this.labelZusatz.AutoSize = true;
this.labelZusatz.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelZusatz.Location = new System.Drawing.Point(3, 50);
this.labelZusatz.Name = "labelZusatz";
this.labelZusatz.Size = new System.Drawing.Size(70, 25);
this.labelZusatz.TabIndex = 4;
this.labelZusatz.Text = "label4";
//
// FormExpedit
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -555,6 +547,8 @@
this.Resize += new System.EventHandler(this.FormExpedit_Resize);
((System.ComponentModel.ISupportInitialize)(this.chartFehlmenge)).EndInit();
this.groupBoxKndInfo.ResumeLayout(false);
this.tableLayoutPanelInfo.ResumeLayout(false);
this.tableLayoutPanelInfo.PerformLayout();
this.tabPageRampe.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).EndInit();
this.tabPageSonder.ResumeLayout(false);
@ -566,8 +560,6 @@
this.tabControlAuftragList.ResumeLayout(false);
this.tabPageVorbereitet.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).EndInit();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
@ -581,6 +573,9 @@
private System.Windows.Forms.Button buttonReklamation;
private System.Windows.Forms.DataVisualization.Charting.Chart chartFehlmenge;
private System.Windows.Forms.GroupBox groupBoxKndInfo;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelInfo;
private System.Windows.Forms.Label labelAnmerkung;
private System.Windows.Forms.Label labelAufgabe;
private System.Windows.Forms.Button buttonTourenListe;
private System.Windows.Forms.TabPage tabPageRampe;
private BrightIdeasSoftware.ObjectListView objectListViewRampe;
@ -594,9 +589,5 @@
private System.Windows.Forms.TabPage tabPageVorbereitet;
private BrightIdeasSoftware.ObjectListView objectListViewVorbereitet;
private System.Windows.Forms.Button buttonNW;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Label labelAnmerkung;
private System.Windows.Forms.Label labelAufgabe;
private System.Windows.Forms.Label labelZusatz;
}
}

View File

@ -161,23 +161,7 @@ namespace Deckungsbeitrag
#region Button_Click-Events
private async void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{
DialogResult result = DialogResult.Cancel;
AuftragTyp? auftragTyp = null;
result = MessageBox.Show("Welchen Auftrag möchtest du erstellen?\n\n[JA] => Geschäft\n[NEIN] => Standart", "FRAGE", MessageBoxButtons.YesNoCancel);
switch (result)
{
case DialogResult.Yes:
auftragTyp = AuftragTyp.Geschäft;
break;
case DialogResult.No:
auftragTyp = AuftragTyp.Standart;
break;
default:
return;
}
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(benutzer, this.letzterLiefertag, auftragTyp);
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(benutzer, this.letzterLiefertag, AuftragTyp.Standart);
if (neuerAuftrag.ShowDialog() == DialogResult.OK)
{
this.letzterLiefertag = neuerAuftrag.letzterLiefertag;
@ -371,6 +355,7 @@ namespace Deckungsbeitrag
dirtCol.ShowTextInHeader = false;
dirtCol.MinimumWidth = dirtCol.MaximumWidth = 80;
}
var cleanCol = Find("Sauber");
if (cleanCol != null)
{
@ -401,12 +386,6 @@ namespace Deckungsbeitrag
fertigCol.MinimumWidth = fertigCol.MaximumWidth = 80;
}
// --- Tour-Column ---
var tourCol = Find("Tour");
if (tourCol != null)
{
if (this.benutzer.Rolle != BenutzerRolle.Expedit || this.benutzer.Rolle != BenutzerRolle.Frottee) tourCol.IsEditable = true;
}
}
private void Olv_CellToolTipShowing(object sender, ToolTipShowingEventArgs e)
{
@ -512,15 +491,9 @@ namespace Deckungsbeitrag
labelAufgabe.Visible = true;
}
else { labelAufgabe.Visible = false; }
if (auftrag.ZusatzInfo != null)
{
labelZusatz.Text = auftrag.ZusatzInfo;
labelZusatz.Visible = true;
}
else { labelZusatz.Visible = false; }
// GroupBox einblenden wenn notwendig.
if (labelAufgabe.Visible || labelAnmerkung.Visible || chartFehlmenge.Visible || labelZusatz.Visible) this.groupBoxKndInfo.Visible = true;
if (labelAufgabe.Visible || labelAnmerkung.Visible || chartFehlmenge.Visible) this.groupBoxKndInfo.Visible = true;
else this.groupBoxKndInfo.Visible = false;
}
@ -587,7 +560,7 @@ namespace Deckungsbeitrag
}
break;
default:
if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.SOLL_Erhoehung || _auftrag.Typ == AuftragTyp.SOLL_Verminderung || _auftrag.Typ == AuftragTyp.Inventur)
if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.Standerhöhung || _auftrag.Typ == AuftragTyp.Standverminderung || _auftrag.Typ == AuftragTyp.Inventur)
{
FormAuftragDetail auftragDetail = new FormAuftragDetail(_auftrag, this.benutzer);
if (auftragDetail.ShowDialog() == DialogResult.OK)
@ -943,12 +916,12 @@ namespace Deckungsbeitrag
}
}
break;
case var t when t == "Tour":
{ //TODO: Mit Tour statt Fahrer durchgehen.
case var t when t == "Fahrer":
{
if (e.NewValue != null)
{
this.auftrag.TourID = ((Tour)e.NewValue).TourID;
this.auftrag.Priority = ((Tour)e.NewValue).Priority;
this.auftrag.ArbeiterID = ((Benutzer)e.NewValue).BenutzerID;
this.auftrag.Priority = Funktionen.GetPriority((Benutzer)e.NewValue);
}
}
break;
@ -986,24 +959,19 @@ namespace Deckungsbeitrag
e.Cancel = true;
return;
}
if (meldung.GetFrage(this, $"Möchtest du die gewählte Zelle wirklich bearbeiten?", false) == DialogResult.No) { e.Cancel = true; return; }
else if (meldung.GetFrage(this, $"Möchtest du die gewählte Zelle wirklich bearbeiten?", false) == DialogResult.No) { e.Cancel = true; return; }
if (e.Column.AspectName == "Tour")
if (e.Column.AspectName == "Fahrer")
{
Saison saison = Saison.GetAktivSaison();
List<Tour> list = Tour.GetSaisonListe(saison);
var row = (View_Auftrag_Expedit)e.RowObject;
var aktuelleTour = list.Find(x => x.TourID == row.TourID);
ComboBox touren = new ComboBox
List<Benutzer> list = Benutzer.GetFahrerList();
ComboBox fahrer = new ComboBox
{
Bounds = e.CellBounds,
DropDownStyle = ComboBoxStyle.DropDownList,
DisplayMember = "Bezeichnung",
DataSource = list,
DisplayMember = "BenutzerName",
DataSource = list
};
e.Control = touren;
e.Control = fahrer;
}
if (e.Control is NumericUpDown num) num.Select(0, int.MaxValue);
}
@ -1094,14 +1062,14 @@ namespace Deckungsbeitrag
{
if (liste == null || liste == ListenArt.Auftragliste) listAuftragToday = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Vorbereitet, minStatusFilter: AuftragStatus.Gewaschen);
if (liste == null || liste == ListenArt.Geschäftliste) listAuftragGeschaeft = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Abgeholt, typFilter: AuftragTyp.Geschäft);
if (liste == null || liste == ListenArt.Vorbereitetliste) listVorbereitet = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Vorbereitet, minTypFilter: AuftragTyp.Geschäft);
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Laufzettel, minTypFilter: AuftragTyp.Inventur);
if (liste == null || liste == ListenArt.Vorbereitetliste) listVorbereitet = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Vorbereitet);
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Einmalig, minTypFilter: AuftragTyp.Inventur);
if (liste == null || liste == ListenArt.Rampenliste) listRampe = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Abgeholt, typFilter: AuftragTyp.Standart);
}
else
{
if (liste == null || liste == ListenArt.Auftragliste) listAuftragToday = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Vorbereitet, minStatusFilter: AuftragStatus.Gewaschen, frottee: true);
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Laufzettel, minTypFilter: AuftragTyp.Inventur, frottee: true);
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Einmalig, minTypFilter: AuftragTyp.Inventur, frottee: true);
}
}
@ -1334,5 +1302,4 @@ namespace Deckungsbeitrag
//CHANGES: Im Tab Vorbereitet wird beim Ändern der sauberen Containeranzahl gefragt ob die Etiketten neu gedruckt werden sollen.
//CHANGES: Im Tab Rampe wird bei DoppelClick der Auftrag als gewaschen markiert und im Tab Aufträge heute sichtbar.
//CHANGES: Wenn ein anderer Fahrer ausgewählt wird, wird auch die Priority laut dem Fahrer geändert.
//CHANGES: NumericUpDown markiert automatisch den Inhalt. Erleichtert die Eingabe.
//CHANGES: Wenn Expedit NeuerAuftrag aufruft wird gefragt welcher Auftrag gewünscht ist. Geschäftkunde = Geschäft (Notwendig bis ausschließlich Fahrer die Standardaufträge erstellen)
//CHANGES: NumericUpDown markiert automatisch den Inhalt. Erleichtert die Eingabe.

View File

@ -363,11 +363,6 @@ namespace Deckungsbeitrag
}
int buttons = flowPanel.Controls.OfType<Button>().Count();
if (buttons % 2 != 0) // zahl % 2 == 1 für ungerade
{
buttons += 1; // 5 → 6
}
// Berechnen der Buttonbreite laut Panelbreit durch Buttonanzahl. (Zweireihig und deshalb durch 2)
Size btnsize = new Size((int)((double)flowPanel.ClientSize.Width / ((double)buttons / (double)2)), (flowPanel.ClientSize.Height / 2) - (flowPanel.Margin.All * 3));

View File

@ -369,7 +369,6 @@ namespace Deckungsbeitrag
this.buttonSWS_Drucken.TabIndex = 36;
this.buttonSWS_Drucken.Text = "SWS-Drucken";
this.buttonSWS_Drucken.UseVisualStyleBackColor = false;
this.buttonSWS_Drucken.Visible = false;
this.buttonSWS_Drucken.Click += new System.EventHandler(this.ButtonDrucken_Click);
//
// pictureBoxEntwurf
@ -402,7 +401,7 @@ namespace Deckungsbeitrag
this.tabPageUmsatz.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageUmsatz.Name = "tabPageUmsatz";
this.tabPageUmsatz.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageUmsatz.Size = new System.Drawing.Size(1001, 734);
this.tabPageUmsatz.Size = new System.Drawing.Size(925, 692);
this.tabPageUmsatz.TabIndex = 0;
this.tabPageUmsatz.Text = "Umsatz";
//

View File

@ -59,11 +59,10 @@ namespace Deckungsbeitrag
this.listViewKunde.HideSelection = false;
this.listViewKunde.HotTracking = true;
this.listViewKunde.HoverSelection = true;
this.listViewKunde.Location = new System.Drawing.Point(12, 54);
this.listViewKunde.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.listViewKunde.Location = new System.Drawing.Point(14, 68);
this.listViewKunde.MultiSelect = false;
this.listViewKunde.Name = "listViewKunde";
this.listViewKunde.Size = new System.Drawing.Size(527, 573);
this.listViewKunde.Size = new System.Drawing.Size(592, 715);
this.listViewKunde.TabIndex = 1;
this.listViewKunde.UseCompatibleStateImageBehavior = false;
this.listViewKunde.View = System.Windows.Forms.View.Details;
@ -91,13 +90,11 @@ namespace Deckungsbeitrag
//
this.textBoxKunde.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxKunde.ForeColor = System.Drawing.Color.Silver;
this.textBoxKunde.Location = new System.Drawing.Point(12, 16);
this.textBoxKunde.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxKunde.Location = new System.Drawing.Point(14, 20);
this.textBoxKunde.Name = "textBoxKunde";
this.textBoxKunde.Size = new System.Drawing.Size(159, 30);
this.textBoxKunde.Size = new System.Drawing.Size(178, 35);
this.textBoxKunde.TabIndex = 0;
this.textBoxKunde.Text = "Hier eingeben";
this.textBoxKunde.TextChanged += new System.EventHandler(this.TextBoxKunde_TextChanged);
this.textBoxKunde.Enter += new System.EventHandler(this.TextBoxKunde_Enter);
this.textBoxKunde.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListViewKunde_KeyDown);
this.textBoxKunde.Leave += new System.EventHandler(this.TextBoxKunde_Leave);
@ -106,10 +103,10 @@ namespace Deckungsbeitrag
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(184, 18);
this.label1.Location = new System.Drawing.Point(207, 22);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(304, 32);
this.label1.Size = new System.Drawing.Size(369, 40);
this.label1.TabIndex = 2;
this.label1.Text = "KundeNr. oder Name eingeben.\r\nKunde nicht vorhanden? Starte die Eingabe mit (?).";
//
@ -121,10 +118,9 @@ namespace Deckungsbeitrag
this.buttonOK.FlatAppearance.BorderSize = 0;
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonOK.Location = new System.Drawing.Point(84, 85);
this.buttonOK.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonOK.Location = new System.Drawing.Point(94, 106);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(381, 50);
this.buttonOK.Size = new System.Drawing.Size(429, 63);
this.buttonOK.TabIndex = 15;
this.buttonOK.Text = "Kunde übernehmen";
this.buttonOK.UseVisualStyleBackColor = false;
@ -138,10 +134,9 @@ namespace Deckungsbeitrag
this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0;
this.buttonNeuerAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeuerAuftrag.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerAuftrag.Location = new System.Drawing.Point(160, 574);
this.buttonNeuerAuftrag.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonNeuerAuftrag.Location = new System.Drawing.Point(180, 718);
this.buttonNeuerAuftrag.Name = "buttonNeuerAuftrag";
this.buttonNeuerAuftrag.Size = new System.Drawing.Size(222, 42);
this.buttonNeuerAuftrag.Size = new System.Drawing.Size(250, 52);
this.buttonNeuerAuftrag.TabIndex = 16;
this.buttonNeuerAuftrag.Text = "Neuer Auftrag";
this.buttonNeuerAuftrag.UseVisualStyleBackColor = false;
@ -149,10 +144,10 @@ namespace Deckungsbeitrag
//
// FormListe
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.ClientSize = new System.Drawing.Size(551, 642);
this.ClientSize = new System.Drawing.Size(620, 802);
this.Controls.Add(this.buttonNeuerAuftrag);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.label1);
@ -160,10 +155,9 @@ namespace Deckungsbeitrag
this.Controls.Add(this.listViewKunde);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(564, 54);
this.MinimumSize = new System.Drawing.Size(632, 56);
this.Name = "FormListe";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

View File

@ -39,7 +39,7 @@ namespace Deckungsbeitrag
readonly string knd_col = "KundenNr,Suchtext,KundenName,Ort";
readonly string auf_col = "Aufgabe,Beschreibung";
readonly string auftrag_col = "Kunde,Liefertag,Container";
public Timer timer;
private Timer timer;
private readonly string kndService;
@ -73,9 +73,12 @@ namespace Deckungsbeitrag
private void FormListe_Load(object sender, EventArgs e)
{
timer = new Timer();
timer.Interval = 700; // 0,7 Sekunden
timer.Tick += Timer_Tick;
// Timer für Wartezeit bis TextChanged eintritt.
//timer = new Timer
//{
// Interval = 2000 // 0,7 Sekunden
//};
//timer.Tick += Timer_Tick;
this.buttonOK.Visible = this.buttonOK.Enabled = false;
@ -325,6 +328,9 @@ namespace Deckungsbeitrag
{
this.textBoxKunde.ForeColor = Color.Black;
this.textBoxKunde.Clear();
//GetKeyboard();
}
private void TextBoxKunde_TextChanged(object sender, EventArgs e)
{

View File

@ -7,7 +7,6 @@ using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
@ -26,10 +25,10 @@ namespace Deckungsbeitrag
public FormLogin()
{
InitializeComponent();
this.Text += Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
private void buttonAnmelden_Click(object sender, EventArgs e)
}
private void buttonAnmelden_Click(object sender, EventArgs e)
{
if(string.IsNullOrWhiteSpace(this.textBoxPasswort.Text)) textBoxBenutzer_Leave(sender, e);
try
@ -61,6 +60,7 @@ namespace Deckungsbeitrag
break;
case -3:
MessageBox.Show(lex.Message, "Registrieren", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
if (Program.ShowOnBoarding(string.Empty, onBoardingArt) == DialogResult.Cancel) Application.Exit();
this.buttonRegistrieren.Visible = true;
this.buttonAnmelden.Enabled = false;
this.groupBox1.Height = 146;
@ -112,7 +112,7 @@ namespace Deckungsbeitrag
if (MessageBox.Show($"Benutzer {this.textBoxBenutzer.Text} wurde erfolgreich angelegt.\n\nMöchtest du einen eigenen Benutzername angeben?\n\n[JA] -> Neuen Benutzername anlegen\n[NEIN] -> Alten Benutzername behalten", "Hinweis", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
string eingabe = Interaction.InputBox("Welchen Benutzername möchtest du verwenden?\n\nBenutzername:", "Neuer Benutzername", "");
if (!string.IsNullOrWhiteSpace(eingabe)) person.BenutzerName = eingabe;
person.BenutzerName = eingabe;
if (person.Save() != 1) MessageBox.Show("Benutzername konnte nicht gespeichert werden. Melde dich bei deinem Vorgesetzten.", "SPEICHERFEHLER", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
this.textBoxBenutzer.Focus();

View File

@ -53,11 +53,9 @@ namespace Deckungsbeitrag
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox1.ForeColor = System.Drawing.Color.White;
this.groupBox1.Location = new System.Drawing.Point(27, 32);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Location = new System.Drawing.Point(18, 21);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Size = new System.Drawing.Size(694, 154);
this.groupBox1.Size = new System.Drawing.Size(463, 100);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Login-Daten";
@ -65,10 +63,9 @@ namespace Deckungsbeitrag
// textBoxPwdWh
//
this.textBoxPwdWh.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxPwdWh.Location = new System.Drawing.Point(278, 169);
this.textBoxPwdWh.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBoxPwdWh.Location = new System.Drawing.Point(185, 110);
this.textBoxPwdWh.Name = "textBoxPwdWh";
this.textBoxPwdWh.Size = new System.Drawing.Size(394, 35);
this.textBoxPwdWh.Size = new System.Drawing.Size(264, 26);
this.textBoxPwdWh.TabIndex = 5;
this.textBoxPwdWh.UseSystemPasswordChar = true;
//
@ -77,20 +74,18 @@ namespace Deckungsbeitrag
this.labelPwdWh.AutoSize = true;
this.labelPwdWh.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelPwdWh.ForeColor = System.Drawing.Color.White;
this.labelPwdWh.Location = new System.Drawing.Point(39, 174);
this.labelPwdWh.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelPwdWh.Location = new System.Drawing.Point(26, 113);
this.labelPwdWh.Name = "labelPwdWh";
this.labelPwdWh.Size = new System.Drawing.Size(230, 29);
this.labelPwdWh.Size = new System.Drawing.Size(153, 20);
this.labelPwdWh.TabIndex = 4;
this.labelPwdWh.Text = "Passwort bestätigen";
//
// textBoxPasswort
//
this.textBoxPasswort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxPasswort.Location = new System.Drawing.Point(278, 95);
this.textBoxPasswort.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBoxPasswort.Location = new System.Drawing.Point(185, 62);
this.textBoxPasswort.Name = "textBoxPasswort";
this.textBoxPasswort.Size = new System.Drawing.Size(394, 35);
this.textBoxPasswort.Size = new System.Drawing.Size(264, 26);
this.textBoxPasswort.TabIndex = 3;
this.textBoxPasswort.UseSystemPasswordChar = true;
this.textBoxPasswort.Enter += new System.EventHandler(this.textBoxPasswort_Enter);
@ -101,20 +96,18 @@ namespace Deckungsbeitrag
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(158, 100);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Location = new System.Drawing.Point(105, 65);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(112, 29);
this.label2.Size = new System.Drawing.Size(74, 20);
this.label2.TabIndex = 2;
this.label2.Text = "Passwort";
//
// textBoxBenutzer
//
this.textBoxBenutzer.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxBenutzer.Location = new System.Drawing.Point(278, 46);
this.textBoxBenutzer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBoxBenutzer.Location = new System.Drawing.Point(185, 30);
this.textBoxBenutzer.Name = "textBoxBenutzer";
this.textBoxBenutzer.Size = new System.Drawing.Size(394, 35);
this.textBoxBenutzer.Size = new System.Drawing.Size(264, 26);
this.textBoxBenutzer.TabIndex = 1;
this.textBoxBenutzer.Enter += new System.EventHandler(this.textBoxBenutzer_Enter);
this.textBoxBenutzer.Leave += new System.EventHandler(this.textBoxBenutzer_Leave);
@ -124,10 +117,9 @@ namespace Deckungsbeitrag
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(158, 51);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Location = new System.Drawing.Point(105, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(108, 29);
this.label1.Size = new System.Drawing.Size(74, 20);
this.label1.TabIndex = 0;
this.label1.Text = "Benutzer";
//
@ -140,11 +132,10 @@ namespace Deckungsbeitrag
this.buttonAnmelden.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAnmelden.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAnmelden.ForeColor = System.Drawing.Color.White;
this.buttonAnmelden.Location = new System.Drawing.Point(495, 212);
this.buttonAnmelden.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buttonAnmelden.Location = new System.Drawing.Point(330, 138);
this.buttonAnmelden.Name = "buttonAnmelden";
this.buttonAnmelden.Padding = new System.Windows.Forms.Padding(3);
this.buttonAnmelden.Size = new System.Drawing.Size(225, 63);
this.buttonAnmelden.Padding = new System.Windows.Forms.Padding(2);
this.buttonAnmelden.Size = new System.Drawing.Size(150, 41);
this.buttonAnmelden.TabIndex = 1;
this.buttonAnmelden.Text = "Anmelden";
this.buttonAnmelden.UseVisualStyleBackColor = false;
@ -160,10 +151,9 @@ 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(261, 212);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buttonAbbrechen.Location = new System.Drawing.Point(174, 138);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(225, 63);
this.buttonAbbrechen.Size = new System.Drawing.Size(150, 41);
this.buttonAbbrechen.TabIndex = 2;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
@ -177,10 +167,9 @@ namespace Deckungsbeitrag
this.buttonRegistrieren.FlatAppearance.BorderSize = 0;
this.buttonRegistrieren.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRegistrieren.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonRegistrieren.Location = new System.Drawing.Point(27, 214);
this.buttonRegistrieren.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.buttonRegistrieren.Location = new System.Drawing.Point(18, 139);
this.buttonRegistrieren.Name = "buttonRegistrieren";
this.buttonRegistrieren.Size = new System.Drawing.Size(225, 63);
this.buttonRegistrieren.Size = new System.Drawing.Size(150, 41);
this.buttonRegistrieren.TabIndex = 3;
this.buttonRegistrieren.Text = "Registrieren";
this.buttonRegistrieren.UseVisualStyleBackColor = false;
@ -189,11 +178,11 @@ namespace Deckungsbeitrag
// FormLogin
//
this.AcceptButton = this.buttonAnmelden;
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
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(738, 294);
this.ClientSize = new System.Drawing.Size(492, 191);
this.Controls.Add(this.buttonRegistrieren);
this.Controls.Add(this.buttonAbbrechen);
this.Controls.Add(this.buttonAnmelden);
@ -201,12 +190,10 @@ namespace Deckungsbeitrag
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormLogin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "LOGIN Version: ";
this.Load += new System.EventHandler(this.FormLogin_Load);
this.Shown += new System.EventHandler(this.FormLogin_Shown);
this.groupBox1.ResumeLayout(false);

View File

@ -48,7 +48,6 @@ namespace Deckungsbeitrag
this.tSBTourenplanung = new System.Windows.Forms.ToolStripButton();
this.toolStripBeenden = new System.Windows.Forms.ToolStripButton();
this.panelMain = new System.Windows.Forms.Panel();
this.buttonSonderAuftrag = new System.Windows.Forms.Button();
this.groupBoxAuftrag = new System.Windows.Forms.GroupBox();
this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView();
this.rBAufAbruf = new System.Windows.Forms.RadioButton();
@ -58,6 +57,7 @@ namespace Deckungsbeitrag
this.rBAlle = new System.Windows.Forms.RadioButton();
this.buttonAufAbruf = new System.Windows.Forms.Button();
this.buttonAusgeliefert = new System.Windows.Forms.Button();
this.buttonNeuerRegAuft = new System.Windows.Forms.Button();
this.panelProgress = new System.Windows.Forms.Panel();
this.buttonKundeArtikelUpdate = new System.Windows.Forms.Button();
this.progressBarKundeArtikelUpdate = new System.Windows.Forms.ProgressBar();
@ -93,6 +93,8 @@ namespace Deckungsbeitrag
this.label12 = new System.Windows.Forms.Label();
this.groupBoxSaison = new System.Windows.Forms.GroupBox();
this.comboBoxSaison = new System.Windows.Forms.ComboBox();
this.buttonNeuerStand = new System.Windows.Forms.Button();
this.buttonNeueInventur = new System.Windows.Forms.Button();
this.buttonNeueAufgabe = new System.Windows.Forms.Button();
this.buttonNeuerAuftrag = new System.Windows.Forms.Button();
this.buttonNeuerUser = new System.Windows.Forms.Button();
@ -472,12 +474,14 @@ namespace Deckungsbeitrag
//
this.panelMain.AllowDrop = true;
this.panelMain.BackColor = System.Drawing.Color.White;
this.panelMain.Controls.Add(this.buttonSonderAuftrag);
this.panelMain.Controls.Add(this.groupBoxAuftrag);
this.panelMain.Controls.Add(this.buttonNeuerRegAuft);
this.panelMain.Controls.Add(this.panelProgress);
this.panelMain.Controls.Add(this.buttonTourenliste);
this.panelMain.Controls.Add(this.groupBoxContAnz);
this.panelMain.Controls.Add(this.groupBoxSaison);
this.panelMain.Controls.Add(this.buttonNeuerStand);
this.panelMain.Controls.Add(this.buttonNeueInventur);
this.panelMain.Controls.Add(this.buttonNeueAufgabe);
this.panelMain.Controls.Add(this.buttonNeuerAuftrag);
this.panelMain.Controls.Add(this.buttonNeuerUser);
@ -492,27 +496,6 @@ namespace Deckungsbeitrag
this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.PanelMain_Paint);
this.panelMain.Resize += new System.EventHandler(this.PanelMain_Resize);
//
// buttonSonderAuftrag
//
this.buttonSonderAuftrag.BackColor = System.Drawing.Color.CadetBlue;
this.buttonSonderAuftrag.Enabled = false;
this.buttonSonderAuftrag.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonSonderAuftrag.FlatAppearance.BorderSize = 0;
this.buttonSonderAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSonderAuftrag.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSonderAuftrag.ForeColor = System.Drawing.Color.Black;
this.buttonSonderAuftrag.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonSonderAuftrag.Location = new System.Drawing.Point(11, 79);
this.buttonSonderAuftrag.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonSonderAuftrag.Name = "buttonSonderAuftrag";
this.buttonSonderAuftrag.Size = new System.Drawing.Size(333, 50);
this.buttonSonderAuftrag.TabIndex = 72;
this.buttonSonderAuftrag.Text = "Neuer Sonderauftrag";
this.buttonSonderAuftrag.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonSonderAuftrag.UseVisualStyleBackColor = false;
this.buttonSonderAuftrag.Visible = false;
this.buttonSonderAuftrag.Click += new System.EventHandler(this.buttonSonderAuftrag_Click);
//
// groupBoxAuftrag
//
this.groupBoxAuftrag.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -563,8 +546,9 @@ namespace Deckungsbeitrag
// rBAufAbruf
//
this.rBAufAbruf.AutoSize = true;
this.rBAufAbruf.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rBAufAbruf.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rBAufAbruf.Location = new System.Drawing.Point(13, 167);
this.rBAufAbruf.Location = new System.Drawing.Point(59, 167);
this.rBAufAbruf.Margin = new System.Windows.Forms.Padding(4);
this.rBAufAbruf.Name = "rBAufAbruf";
this.rBAufAbruf.Size = new System.Drawing.Size(115, 29);
@ -577,8 +561,9 @@ namespace Deckungsbeitrag
// rBAusgeliefert
//
this.rBAusgeliefert.AutoSize = true;
this.rBAusgeliefert.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rBAusgeliefert.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rBAusgeliefert.Location = new System.Drawing.Point(13, 130);
this.rBAusgeliefert.Location = new System.Drawing.Point(36, 130);
this.rBAusgeliefert.Margin = new System.Windows.Forms.Padding(4);
this.rBAusgeliefert.Name = "rBAusgeliefert";
this.rBAusgeliefert.Size = new System.Drawing.Size(136, 29);
@ -591,8 +576,9 @@ namespace Deckungsbeitrag
// rBFertig
//
this.rBFertig.AutoSize = true;
this.rBFertig.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rBFertig.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rBFertig.Location = new System.Drawing.Point(13, 94);
this.rBFertig.Location = new System.Drawing.Point(95, 94);
this.rBFertig.Margin = new System.Windows.Forms.Padding(4);
this.rBFertig.Name = "rBFertig";
this.rBFertig.Size = new System.Drawing.Size(82, 29);
@ -605,8 +591,9 @@ namespace Deckungsbeitrag
// rBVorbereitet
//
this.rBVorbereitet.AutoSize = true;
this.rBVorbereitet.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rBVorbereitet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rBVorbereitet.Location = new System.Drawing.Point(13, 57);
this.rBVorbereitet.Location = new System.Drawing.Point(44, 57);
this.rBVorbereitet.Margin = new System.Windows.Forms.Padding(4);
this.rBVorbereitet.Name = "rBVorbereitet";
this.rBVorbereitet.Size = new System.Drawing.Size(128, 29);
@ -619,8 +606,9 @@ namespace Deckungsbeitrag
// rBAlle
//
this.rBAlle.AutoSize = true;
this.rBAlle.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rBAlle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rBAlle.Location = new System.Drawing.Point(13, 20);
this.rBAlle.Location = new System.Drawing.Point(115, 20);
this.rBAlle.Margin = new System.Windows.Forms.Padding(4);
this.rBAlle.Name = "rBAlle";
this.rBAlle.Size = new System.Drawing.Size(66, 29);
@ -670,6 +658,27 @@ namespace Deckungsbeitrag
this.buttonAusgeliefert.Visible = false;
this.buttonAusgeliefert.Click += new System.EventHandler(this.ButtonAusgeliefert_Click);
//
// buttonNeuerRegAuft
//
this.buttonNeuerRegAuft.BackColor = System.Drawing.Color.CadetBlue;
this.buttonNeuerRegAuft.Enabled = false;
this.buttonNeuerRegAuft.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeuerRegAuft.FlatAppearance.BorderSize = 0;
this.buttonNeuerRegAuft.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeuerRegAuft.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerRegAuft.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerRegAuft.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerRegAuft.Location = new System.Drawing.Point(1053, 17);
this.buttonNeuerRegAuft.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeuerRegAuft.Name = "buttonNeuerRegAuft";
this.buttonNeuerRegAuft.Size = new System.Drawing.Size(333, 50);
this.buttonNeuerRegAuft.TabIndex = 71;
this.buttonNeuerRegAuft.Text = "Regelmäßiger Auftrag";
this.buttonNeuerRegAuft.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeuerRegAuft.UseVisualStyleBackColor = false;
this.buttonNeuerRegAuft.Visible = false;
this.buttonNeuerRegAuft.Click += new System.EventHandler(this.ButtonRegAuftrag_Click);
//
// panelProgress
//
this.panelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -723,7 +732,7 @@ namespace Deckungsbeitrag
this.buttonTourenliste.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonTourenliste.ForeColor = System.Drawing.Color.Black;
this.buttonTourenliste.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonTourenliste.Location = new System.Drawing.Point(11, 141);
this.buttonTourenliste.Location = new System.Drawing.Point(11, 80);
this.buttonTourenliste.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonTourenliste.Name = "buttonTourenliste";
this.buttonTourenliste.Size = new System.Drawing.Size(333, 50);
@ -1210,6 +1219,48 @@ namespace Deckungsbeitrag
this.comboBoxSaison.TabIndex = 66;
this.comboBoxSaison.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSaison_SelectedIndexChanged);
//
// buttonNeuerStand
//
this.buttonNeuerStand.BackColor = System.Drawing.Color.MediumTurquoise;
this.buttonNeuerStand.Enabled = false;
this.buttonNeuerStand.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeuerStand.FlatAppearance.BorderSize = 0;
this.buttonNeuerStand.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeuerStand.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerStand.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerStand.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerStand.Location = new System.Drawing.Point(707, 17);
this.buttonNeuerStand.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeuerStand.Name = "buttonNeuerStand";
this.buttonNeuerStand.Size = new System.Drawing.Size(333, 50);
this.buttonNeuerStand.TabIndex = 65;
this.buttonNeuerStand.Text = "Neue Standveränderung";
this.buttonNeuerStand.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeuerStand.UseVisualStyleBackColor = false;
this.buttonNeuerStand.Visible = false;
this.buttonNeuerStand.Click += new System.EventHandler(this.ButtonNeuerStand_Click);
//
// buttonNeueInventur
//
this.buttonNeueInventur.BackColor = System.Drawing.Color.Turquoise;
this.buttonNeueInventur.Enabled = false;
this.buttonNeueInventur.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeueInventur.FlatAppearance.BorderSize = 0;
this.buttonNeueInventur.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeueInventur.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeueInventur.ForeColor = System.Drawing.Color.Black;
this.buttonNeueInventur.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeueInventur.Location = new System.Drawing.Point(357, 17);
this.buttonNeueInventur.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeueInventur.Name = "buttonNeueInventur";
this.buttonNeueInventur.Size = new System.Drawing.Size(333, 50);
this.buttonNeueInventur.TabIndex = 64;
this.buttonNeueInventur.Text = "Neue Inventur";
this.buttonNeueInventur.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeueInventur.UseVisualStyleBackColor = false;
this.buttonNeueInventur.Visible = false;
this.buttonNeueInventur.Click += new System.EventHandler(this.ButtonNeueInventur_Click);
//
// buttonNeueAufgabe
//
this.buttonNeueAufgabe.BackColor = System.Drawing.Color.DarkOrange;
@ -1220,7 +1271,7 @@ namespace Deckungsbeitrag
this.buttonNeueAufgabe.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeueAufgabe.ForeColor = System.Drawing.Color.Black;
this.buttonNeueAufgabe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeueAufgabe.Location = new System.Drawing.Point(11, 265);
this.buttonNeueAufgabe.Location = new System.Drawing.Point(11, 206);
this.buttonNeueAufgabe.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeueAufgabe.Name = "buttonNeueAufgabe";
this.buttonNeueAufgabe.Size = new System.Drawing.Size(333, 50);
@ -1262,7 +1313,7 @@ namespace Deckungsbeitrag
this.buttonNeuerUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerUser.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerUser.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerUser.Location = new System.Drawing.Point(11, 203);
this.buttonNeuerUser.Location = new System.Drawing.Point(11, 143);
this.buttonNeuerUser.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeuerUser.Name = "buttonNeuerUser";
this.buttonNeuerUser.Size = new System.Drawing.Size(333, 50);
@ -1532,6 +1583,8 @@ namespace Deckungsbeitrag
private System.Windows.Forms.ToolStripButton tSBHilfe;
private System.Windows.Forms.Button buttonNeuerUser;
private System.Windows.Forms.Button buttonNeueAufgabe;
private System.Windows.Forms.Button buttonNeueInventur;
private System.Windows.Forms.Button buttonNeuerStand;
private System.Windows.Forms.ToolStripButton tSBTourenplanung;
private System.Windows.Forms.ComboBox comboBoxSaison;
private System.Windows.Forms.GroupBox groupBoxSaison;
@ -1575,7 +1628,7 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Button buttonKundeArtikelUpdate;
private System.Windows.Forms.ProgressBar progressBarKundeArtikelUpdate;
private System.Windows.Forms.Panel panelProgress;
private System.Windows.Forms.Button buttonSonderAuftrag;
private System.Windows.Forms.Button buttonNeuerRegAuft;
}
}

View File

@ -55,7 +55,6 @@ namespace Deckungsbeitrag
private UCInventur uCInventur;
private readonly Screen screen = Screen.PrimaryScreen;
private Kunde kunde;
private Tour tour;
#endregion
public FormMain()
{
@ -105,18 +104,6 @@ namespace Deckungsbeitrag
GetInventuren();
GetSaison();
}
else
{
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
Saison saison = Saison.GetAktivSaison();
if (saison.Bezeichnung == "Zwischensaison")
{
var data = ShowTourenplan();
tour = Tour.GetTour(saison.SaisonId, data.tour);
}
}
}
if (this.groupBoxContAnz.Visible)
{
@ -139,19 +126,18 @@ namespace Deckungsbeitrag
private void FormMain_Shown(object sender, EventArgs e)
{
if (this.benutzer.Rolle != BenutzerRolle.Fahrer)
// Meldung wenn Updates oder Imports erledigt wurden.
if (Program.Artikelliste_Importiert | Program.Kundenliste_Importiert | Program.Software_Updated)
{
// Meldung wenn Updates oder Imports erledigt wurden.
if (Program.Artikelliste_Importiert | Program.Kundenliste_Importiert | Program.Software_Updated)
{
string[] updates = new string[3];
updates[0] = Program.Artikelliste_Importiert ? "Artikelliste: ✅" : "Artikelliste: ❌";
updates[1] = Program.Kundenliste_Importiert ? "Kundenliste: ✅" : "Kundenliste: ❌";
updates[2] = Program.Software_Updated ? "Software: ✅" : "Sofware: ❌";
MessageBox.Show($"Folgende Updates wurden heute durchgeführt:\n\n{updates[0]}\n{updates[1]}\n{updates[2]}", "UPDATES DURCHGEFÜHRT", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
string[] updates = new string[3];
updates[0] = Program.Artikelliste_Importiert ? "Artikelliste: ✅" : "Artikelliste: ❌";
updates[1] = Program.Kundenliste_Importiert ? "Kundenliste: ✅" : "Kundenliste: ❌";
updates[2] = Program.Software_Updated ? "Software: ✅" : "Sofware: ❌";
MessageBox.Show($"Folgende Updates wurden heute durchgeführt:\n\n{updates[0]}\n{updates[1]}\n{updates[2]}", "UPDATES DURCHGEFÜHRT", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// OnBoarding nur bei den Fahrern anzeigen. Bis die anderen Fertig sind.
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) ZeigeOnboarding();
this.ResumeLayout();
this.Cursor = Cursors.Default;
@ -186,8 +172,9 @@ namespace Deckungsbeitrag
try
{
_settings.LocationButtonNeueAufgabe = this.buttonNeueAufgabe.Location;
_settings.LocationButtonSonderAuftrag = this.buttonSonderAuftrag.Location;
_settings.LocationButtonNeueInventur = this.buttonNeueInventur.Location;
_settings.LocationButtonNeuerAuftrag = this.buttonNeuerAuftrag.Location;
_settings.LocationButtonNeuerStand = this.buttonNeuerStand.Location;
_settings.LocationButtonNeuerUser = this.buttonNeuerUser.Location;
_settings.LocationGroupBoxContainer = this.groupBoxContAnz.Location;
@ -207,16 +194,6 @@ namespace Deckungsbeitrag
}
#endregion
private (DateTime? datum, string[] touren, string tour) ShowTourenplan()
{
FormShowUserControl showUserControl = new FormShowUserControl("Tourenplan", this.benutzer, this.kunde);
if (showUserControl.ShowDialog() == DialogResult.OK)
{
var data = showUserControl.lieferDaten;
return (data.datum, data.touren, data.text);
}
return (null, null, null);
}
#region ToolStripButton-Events
private void Get_Border_Paint(object sender, PaintEventArgs e)
@ -364,8 +341,11 @@ namespace Deckungsbeitrag
/// <param name="e"></param>
private void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{
onBoardingArt = OnboardingSchritt.NeuerAuftrag;
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) ZeigeOnboarding();
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standart);
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; ButtonNeueInventur_Click(this.buttonNeueInventur, null); }
}
private void ButtonScannTest_Click(object sender, EventArgs e)
{
@ -378,6 +358,44 @@ namespace Deckungsbeitrag
FormNeueAufgabe neueAufgabe = new FormNeueAufgabe();
neueAufgabe.ShowDialog();
}
private void ButtonNeuerStand_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag;
DialogResult result = meldung.GetFrage(this, "Möchtest du eine Standverminderung oder Standerhöhung erstellen? \n\n [JA = Standverminerung | NEIN = Standerhöhung]", true);
switch (result)
{
case DialogResult.Cancel:
return;
case DialogResult.Yes:
neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standverminderung); neuerAuftrag.ShowDialog();
break;
case DialogResult.No:
neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standerhöhung); neuerAuftrag.ShowDialog();
break;
default:
break;
}
}
private void ButtonNeueInventur_Click(object sender, EventArgs e)
{
onBoardingArt = OnboardingSchritt.NeueInventur;
ZeigeOnboarding();
Kunde kunde = null;
FormListe liste = new FormListe(null, (int)Listentyp.Reklamationliste, "Miete");
if (liste.ShowDialog() == DialogResult.OK)
{
kunde = liste.kunde;
uCInventur = new UCInventur(kunde, this.benutzer);
uCInventur.UCInventur_Update += () => { this.GetInventuren(); };
uCInventur.UCInventur_Delete += Do_UCInventur_Delete;
this.panelMain.Controls.Add(uCInventur);
uCInventur.Location = new Point(100, 100);
uCInventur.BringToFront();
RegisterDragEvents(uCInventur);
}
}
/// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN
@ -398,7 +416,7 @@ namespace Deckungsbeitrag
++tosave;
Auftrag a = (Auftrag)item.RowObject;
a.ArbeiterID = this.benutzer.BenutzerID;
a.Erledigt = DateTime.Now;
a.ErledigtVon = this.benutzer.BenutzerID;
a.Status = AuftragStatus.Ausgeliefert;
@ -423,7 +441,6 @@ namespace Deckungsbeitrag
newAuftrag.Status = AuftragStatus.Herrichten;
newAuftrag.ErstelltVon = (int)this.benutzer.BenutzerID;
newAuftrag.Erstellt = DateTime.Now;
newAuftrag.TourID = a.TourID;
// Werte des alten Auftrags zurücksetzen.
newAuftrag.Erledigt = null;
@ -527,15 +544,15 @@ namespace Deckungsbeitrag
this.buttonKundeArtikelUpdate.BringToFront();
Application.UseWaitCursor = false;
}
private void buttonSonderAuftrag_Click(object sender, EventArgs e)
private void ButtonRegAuftrag_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, null);
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Regelmäßig);
neuerAuftrag.ShowDialog();
}
#endregion
#region GroupBox Auftrag
#region Auftrag GroupBox
/// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN
/// RadioButtons für Auftragsverwaltung & Laden der Auftragsliste nach Status.
@ -589,8 +606,7 @@ namespace Deckungsbeitrag
try
{
await conn.OpenAsync();
//TODO: Richtige Liste holen, wahrscheinlich mit TourID von ShowTourenplan.
if (status == null & this.benutzer.Rolle == BenutzerRolle.Fahrer) alist = await Auftrag.GetFahrerListAsync(tour.TourID, conn);
if (status == null & this.benutzer.Rolle == BenutzerRolle.Fahrer) alist = await Auftrag.GetFahrerListAsync(this.benutzer.BenutzerID, conn);
else alist = await Auftrag.GetStatusListAsync(status, conn);
}
finally
@ -600,7 +616,7 @@ namespace Deckungsbeitrag
conn.Dispose();
}
if (alist.Count == 0) { meldung.KeineAufträge(); this.groupBoxAuftrag.Visible = false; }
if (alist.Count == 0) meldung.KeineAufträge();
else Load_OLV(alist); // Load_ListView(alist);
this.objectListViewAuftrag.EndUpdate();
@ -1065,25 +1081,6 @@ namespace Deckungsbeitrag
}
#endregion
private void GetNeueInventur()
{
onBoardingArt = OnboardingSchritt.NeueInventur;
ZeigeOnboarding();
Kunde kunde = null;
FormListe liste = new FormListe(null, (int)Listentyp.Reklamationliste, "Miete");
if (liste.ShowDialog() == DialogResult.OK)
{
kunde = liste.kunde;
uCInventur = new UCInventur(kunde, this.benutzer);
uCInventur.UCInventur_Update += () => { this.GetInventuren(); };
uCInventur.UCInventur_Delete += Do_UCInventur_Delete;
this.panelMain.Controls.Add(uCInventur);
uCInventur.Location = new Point(100, 100);
uCInventur.BringToFront();
RegisterDragEvents(uCInventur);
}
}
private async void GetInventuren()
{
foreach (UCInventur uci in panelMain.Controls.OfType<UCInventur>())
@ -1472,7 +1469,6 @@ namespace Deckungsbeitrag
textBox1.Width = (int)size.Width + 10; // +10 als Puffer
}
}
}
}
//CHANGES: Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren.

View File

@ -51,11 +51,10 @@ namespace Deckungsbeitrag
this.comboBoxFahrer = new System.Windows.Forms.ComboBox();
this.buttonEinstellung = new System.Windows.Forms.Button();
this.panelRegAuftrag = new System.Windows.Forms.Panel();
this.textBoxText = new System.Windows.Forms.TextBox();
this.pictureBoxAddArtikel = new System.Windows.Forms.PictureBox();
this.label8 = new System.Windows.Forms.Label();
this.comboBoxArtikel = new System.Windows.Forms.ComboBox();
this.labelText = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.comboBoxRhythmus = new System.Windows.Forms.ComboBox();
this.fLPArtikel = new System.Windows.Forms.FlowLayoutPanel();
this.pictureBoxMinus = new System.Windows.Forms.PictureBox();
@ -173,7 +172,7 @@ namespace Deckungsbeitrag
//
this.label5.AutoSize = true;
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(7, 407);
this.label5.Location = new System.Drawing.Point(7, 340);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(196, 25);
this.label5.TabIndex = 24;
@ -312,7 +311,7 @@ namespace Deckungsbeitrag
// textBoxCont
//
this.textBoxCont.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxCont.Location = new System.Drawing.Point(281, 383);
this.textBoxCont.Location = new System.Drawing.Point(281, 316);
this.textBoxCont.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxCont.Name = "textBoxCont";
this.textBoxCont.Size = new System.Drawing.Size(50, 49);
@ -325,11 +324,11 @@ namespace Deckungsbeitrag
//
this.label1.AutoSize = true;
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(7, 333);
this.label1.Location = new System.Drawing.Point(8, 409);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(59, 25);
this.label1.Size = new System.Drawing.Size(125, 25);
this.label1.TabIndex = 33;
this.label1.Text = "Tour:";
this.label1.Text = "Zustellfahrer:";
//
// comboBoxFahrer
//
@ -338,10 +337,10 @@ namespace Deckungsbeitrag
this.comboBoxFahrer.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.comboBoxFahrer.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxFahrer.FormattingEnabled = true;
this.comboBoxFahrer.Location = new System.Drawing.Point(92, 320);
this.comboBoxFahrer.Location = new System.Drawing.Point(157, 393);
this.comboBoxFahrer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comboBoxFahrer.Name = "comboBoxFahrer";
this.comboBoxFahrer.Size = new System.Drawing.Size(291, 38);
this.comboBoxFahrer.Size = new System.Drawing.Size(224, 38);
this.comboBoxFahrer.TabIndex = 34;
this.comboBoxFahrer.Validating += new System.ComponentModel.CancelEventHandler(this.ComboBoxFahrer_Validating);
//
@ -367,10 +366,9 @@ namespace Deckungsbeitrag
this.panelRegAuftrag.Controls.Add(this.pictureBoxAddArtikel);
this.panelRegAuftrag.Controls.Add(this.label8);
this.panelRegAuftrag.Controls.Add(this.comboBoxArtikel);
this.panelRegAuftrag.Controls.Add(this.labelText);
this.panelRegAuftrag.Controls.Add(this.label7);
this.panelRegAuftrag.Controls.Add(this.comboBoxRhythmus);
this.panelRegAuftrag.Controls.Add(this.fLPArtikel);
this.panelRegAuftrag.Controls.Add(this.textBoxText);
this.panelRegAuftrag.Enabled = false;
this.panelRegAuftrag.Location = new System.Drawing.Point(409, -2);
this.panelRegAuftrag.Margin = new System.Windows.Forms.Padding(4);
@ -380,16 +378,6 @@ namespace Deckungsbeitrag
this.panelRegAuftrag.Visible = false;
this.panelRegAuftrag.EnabledChanged += new System.EventHandler(this.PanelRegAuftrag_EnabledChanged);
//
// textBoxText
//
this.textBoxText.Location = new System.Drawing.Point(25, 52);
this.textBoxText.Multiline = true;
this.textBoxText.Name = "textBoxText";
this.textBoxText.Size = new System.Drawing.Size(518, 459);
this.textBoxText.TabIndex = 48;
this.textBoxText.Visible = false;
this.textBoxText.VisibleChanged += new System.EventHandler(this.TextBoxText_VisibleChanged);
//
// pictureBoxAddArtikel
//
this.pictureBoxAddArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -423,7 +411,6 @@ namespace Deckungsbeitrag
this.comboBoxArtikel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.comboBoxArtikel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxArtikel.FormattingEnabled = true;
this.comboBoxArtikel.IntegralHeight = false;
this.comboBoxArtikel.Location = new System.Drawing.Point(25, 132);
this.comboBoxArtikel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comboBoxArtikel.Name = "comboBoxArtikel";
@ -431,15 +418,15 @@ namespace Deckungsbeitrag
this.comboBoxArtikel.TabIndex = 37;
this.comboBoxArtikel.SelectedIndexChanged += new System.EventHandler(this.ComboBoxArtikel_SelectedIndexChanged);
//
// labelText
// label7
//
this.labelText.AutoSize = true;
this.labelText.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelText.Location = new System.Drawing.Point(20, 25);
this.labelText.Name = "labelText";
this.labelText.Size = new System.Drawing.Size(105, 25);
this.labelText.TabIndex = 36;
this.labelText.Text = "Rhythmus:";
this.label7.AutoSize = true;
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(20, 25);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(105, 25);
this.label7.TabIndex = 36;
this.label7.Text = "Rhythmus:";
//
// comboBoxRhythmus
//
@ -472,7 +459,7 @@ namespace Deckungsbeitrag
//
this.pictureBoxMinus.BackColor = System.Drawing.Color.Red;
this.pictureBoxMinus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxMinus.Image")));
this.pictureBoxMinus.Location = new System.Drawing.Point(232, 382);
this.pictureBoxMinus.Location = new System.Drawing.Point(232, 315);
this.pictureBoxMinus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBoxMinus.Name = "pictureBoxMinus";
this.pictureBoxMinus.Size = new System.Drawing.Size(51, 50);
@ -485,7 +472,7 @@ namespace Deckungsbeitrag
//
this.pictureBoxPlus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxPlus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlus.Image")));
this.pictureBoxPlus.Location = new System.Drawing.Point(332, 382);
this.pictureBoxPlus.Location = new System.Drawing.Point(332, 315);
this.pictureBoxPlus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBoxPlus.Name = "pictureBoxPlus";
this.pictureBoxPlus.Size = new System.Drawing.Size(51, 50);
@ -574,11 +561,10 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Button buttonEinstellung;
private System.Windows.Forms.Panel panelRegAuftrag;
private System.Windows.Forms.FlowLayoutPanel fLPArtikel;
private System.Windows.Forms.Label labelText;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox comboBoxRhythmus;
private System.Windows.Forms.PictureBox pictureBoxAddArtikel;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.ComboBox comboBoxArtikel;
private System.Windows.Forms.TextBox textBoxText;
}
}

View File

@ -1,5 +1,4 @@
using BrightIdeasSoftware;
using DatenDB;
using DatenDB;
using Deckungsbeitrag.AA_Forms;
using Deckungsbeitrag.AA_Klassen;
using Deckungsbeitrag.UserControls;
@ -39,11 +38,11 @@ namespace Deckungsbeitrag
public DateTime? letzterLiefertag;
public DataGridViewCell aktivCell;
private readonly string userid;
private readonly AuftragTyp? auftragtyp = AuftragTyp.Standart;
private readonly AuftragTyp auftragtyp = AuftragTyp.Standart;
private string eingabe = string.Empty;
private readonly OnboardingSchritt onBoardingArt = OnboardingSchritt.NeuerAuftrag;
string[] touren;
private Tour tour;
string tour;
string kundeName = string.Empty;
#endregion
@ -53,18 +52,17 @@ namespace Deckungsbeitrag
{
InitializeComponent();
this.Text += " Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
public FormNeuerAuftrag(Benutzer benutzer) : this()
{
this.benutzer = benutzer;
}
public FormNeuerAuftrag(Benutzer benutzer, AuftragTyp? auftragTyp) : this(benutzer)
public FormNeuerAuftrag(Benutzer benutzer, AuftragTyp auftragTyp) : this(benutzer)
{
this.auftragtyp = auftragTyp;
}
public FormNeuerAuftrag(Benutzer benutzer, DateTime? letzterLiefertag, AuftragTyp? auftragTyp) : this(benutzer, auftragTyp)
public FormNeuerAuftrag(Benutzer benutzer, DateTime? letzterLiefertag, AuftragTyp auftragTyp) : this(benutzer, auftragTyp)
{
this.letzterLiefertag = letzterLiefertag;
}
@ -85,8 +83,7 @@ namespace Deckungsbeitrag
if (this.auftragtyp == AuftragTyp.Regelmäßig) {kndService = "Geschäft"; labelLiefertag.Text = "Erster Liefertag:"; }
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) kndService = "Geschäft";
if (this.auftragtyp == null || this.auftragtyp == AuftragTyp.Geschäft) SonderDatenLaden(kndService);
else DatenLaden(kndService);
DatenLaden(kndService);
}
private async void FormNeuerAuftrag_HelpButtonClicked(object sender, CancelEventArgs e)
{
@ -95,25 +92,16 @@ namespace Deckungsbeitrag
ZeigeOnboarding();
}
private void SonderDatenLaden(string kndService)
{
// Kunde laden
if (!GetKunde(kndService)) { CloseForm(DialogResult.Cancel); return; }
// ComboBox Typ & Fahrer wird mit Items geladen
ComboBoxTyp_Load();
ComboBoxFahrer_Load();
}
/// <summary>
/// Kundendaten Liefertag werden eingefügt.
/// </summary>
private void DatenLaden(string kndService)
{
this.SuspendLayout();
// Kunde laden
if (!GetKunde(kndService)) { CloseForm(DialogResult.Cancel); return; }
GetKunde(kndService);
// Containeranzahl laden
if (int.TryParse(Interaction.InputBox($"Wieviel Container hast du beim Kunde {kundeName} abgeholt?", "CONTAINERANZAHL", "1"), out int i)) this.textBoxCont.Text = i.ToString();
else { CloseForm(DialogResult.Cancel); return; }
GetContainerAnzahl();
// NextLiefertag laden
GetNextLiefertag();
@ -122,20 +110,13 @@ namespace Deckungsbeitrag
ComboBoxTyp_Load();
ComboBoxFahrer_Load();
this.ResumeLayout();
}
private bool GetKunde(string kndService)
{
this.kunde = Funktionen.Open_List(kndService);
if (this.kunde == null) { CloseForm(DialogResult.Cancel); return false; }
this.textBoxKndNr.Text = kunde.KundeNummer;
this.kundeName = this.textBoxKundeName.Text = this.kunde.Suchtext ?? this.kunde.KundeName;
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
if (this.benutzer.Tour == tour) this.comboBoxFahrer.SelectedItem = this.comboBoxFahrer.Items.Cast<Benutzer>().FirstOrDefault(t => t.Tour == tour);
else this.comboBoxFahrer.SelectedItem = this.comboBoxFahrer.Items.Cast<Benutzer>().FirstOrDefault(t => t.Tour == tour);
}
else this.comboBoxFahrer.SelectedIndex = -1;
// Textboxen mit Kundedaten füllen
this.textBoxKundeName.Enabled = false;
this.textBoxKndNr.Enabled = false;
return true;
}
private void GetNextLiefertag()
{
@ -170,14 +151,13 @@ namespace Deckungsbeitrag
{
this.DialogResult = DialogResult.Cancel;
this.Close();
return;
}
}
else
{
// Wenn ShowTourenplan Daten retour gibt, werden diese geladen.
nextLiefertag = (DateTime)data.datum;
tour = Tour.GetTour(Saison.SaisonId, data.tour);
tour = data.tour ?? null;
}
}
@ -190,6 +170,32 @@ namespace Deckungsbeitrag
// Der Richtige RadioButton wird als aktiv markiert.
DTPLiefertag_Leave(this.dTPLiefertag, EventArgs.Empty);
}
private void GetKunde(string kndService)
{
try
{
this.kunde = Funktionen.Open_List(kndService);
this.textBoxKndNr.Text = kunde.KundeNummer;
this.kundeName = this.textBoxKundeName.Text = this.kunde.Suchtext ?? this.kunde.KundeName;
this.textBoxKundeName.Enabled = false;
this.textBoxKndNr.Enabled = false;
}
catch (Exception)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
private void GetContainerAnzahl()
{
int anzahl = 0;
if (int.TryParse(Interaction.InputBox($"Wieviel Container hast du beim Kunde {kundeName} abgeholt?", "CONTAINERANZAHL", "1"), out int i)) anzahl = i;
this.textBoxCont.Text = anzahl.ToString();
}
private (DateTime? datum, string[] touren, string tour) ShowTourenplan()
{
FormShowUserControl showUserControl = new FormShowUserControl("Tourenplan", this.benutzer, this.kunde);
@ -202,6 +208,10 @@ namespace Deckungsbeitrag
}
#region ComboBox-Events
/// <summary>
/// ComboBox wird mit AuftragTyp geladen.
/// SelectedItem wird gewählt. Wenn Kunde Service ist Geschäft dann Geschäft, sonst Prop. auftragtyp.
/// </summary>
private void ComboBoxTyp_Load()
{
try
@ -210,16 +220,18 @@ namespace Deckungsbeitrag
this.comboBoxTyp.SelectedValueChanged -= ComboBoxTyp_SelectedValueChanged;
// Items werden von AuftragTyp geladen.
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragTyp));
this.comboBoxTyp.DropDownWidth = GetDropDownWidth(this.comboBoxTyp);
// Wenn der Kunde ein Geschäftskunde ist, wird AuftragTyp.Geschäft ausgewählt. Andernfalls wird der AuftragTyp aus dem Konstruktor gewählt.
this.comboBoxTyp.SelectedValueChanged += ComboBoxTyp_SelectedValueChanged;
if (kunde.Service == "Geschäft") this.comboBoxTyp.SelectedItem = AuftragTyp.Geschäft;
else this.comboBoxTyp.SelectedItem = auftragtyp;
if (this.auftragtyp == null) this.comboBoxTyp.SelectedIndex = -1;
else
{
this.comboBoxTyp.SelectedItem = auftragtyp;
}
//if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
//{
// this.comboBoxTyp.Enabled = true;
//}
//else this.comboBoxTyp.Enabled = false;
this.ResumeLayout(false);
}
catch (Exception ex)
@ -229,22 +241,19 @@ namespace Deckungsbeitrag
throw;
}
}
/// <summary>
/// ComboBox wird mit Fahrerliste geladen.
/// Wenn Prop. tour ist leer wird Benutzername angezeigt, sonst Tourbezeichnung.
/// </summary>
private void ComboBoxFahrer_Load()
{
List<Benutzer> benutzerliste = Benutzer.GetFahrerList();
this.comboBoxFahrer.DataSource = benutzerliste;
Saison saison = Saison.GetAktivSaison();
this.comboBoxFahrer.Validating -= ComboBoxFahrer_Validating;
List<Tour> tourliste = Tour.GetSaisonListe(saison);
this.comboBoxFahrer.DataSource = tourliste;
this.comboBoxFahrer.DisplayMember = "Bezeichnung";
this.comboBoxFahrer.ValueMember = "TourID";
this.comboBoxFahrer.DropDownWidth = GetDropDownWidth(this.comboBoxFahrer);
// ComboBox-Auswahl vordefinieren.
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
this.comboBoxFahrer.SelectedValue = tour.TourID;
}
else this.comboBoxFahrer.SelectedIndex = -1;
this.comboBoxFahrer.Validating += ComboBoxFahrer_Validating;
if (saison.Bezeichnung == "Zwischensaison") this.comboBoxFahrer.DisplayMember = "BenutzerName";
else this.comboBoxFahrer.DisplayMember = "Tour";
}
private void ComboBoxTyp_SelectedValueChanged(object sender, EventArgs e)
{
@ -257,74 +266,54 @@ namespace Deckungsbeitrag
return;
}
}
if (comboBoxTyp.SelectedValue != null)
switch ((AuftragTyp)comboBoxTyp.SelectedValue)
{
switch ((AuftragTyp)comboBoxTyp.SelectedValue)
{
case AuftragTyp.Geschäft: // Wird derzeit wenig verwendet da die Auswahl in DatenLaden nach KundenService erfolgt.
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = true;
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Standart:
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = true;
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Inventur:
this.textBoxText.Visible = false;
this.DialogResult = DialogResult.Abort;
this.Close();
break;
case AuftragTyp.SOLL_Erhoehung:
if (this.kunde == null) return;
this.textBoxText.Visible = false;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.labelText.Text = "Rhythmus:";
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.SOLL_Verminderung:
if (this.kunde == null) return;
this.textBoxText.Visible = false;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.labelText.Text = "Rhythmus:";
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.Regelmäßig:
this.textBoxText.Visible = false;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.labelText.Text = "Rhythmus:";
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.AufAbruf:
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = true;
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Laufzettel:
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.textBoxText.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.labelText.Text = "Laufzetteltext:";
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
this.textBoxText.BringToFront();
break;
default:
break;
}
PanelRegAuftrag_EnabledChanged(this.panelRegAuftrag, null);
}
else
{
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
case AuftragTyp.Geschäft: // Wird derzeit wenig verwendet da die Auswahl in DatenLaden nach KundenService erfolgt.
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Standart:
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Inventur:
this.DialogResult = DialogResult.Abort;
this.Close();
break;
case AuftragTyp.Standerhöhung:
if (this.kunde == null) return;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.Standverminderung:
if (this.kunde == null) return;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.Regelmäßig:
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.AufAbruf:
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
case AuftragTyp.Einmalig:
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
default:
break;
}
}
private void ComboBoxArtikel_SelectedIndexChanged(object sender, EventArgs e)
@ -337,7 +326,7 @@ namespace Deckungsbeitrag
do
{
if (index > 0) if (MessageBox.Show("Bitte nur ganze Zahlen eingeben.", "ACHTUNG", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel) return;
anzahl = Interaction.InputBox($"Wieviel Stück sollen geliefert oder eingezogen werden?\n\nStück:", "Artikelanzahl", "");
anzahl = Interaction.InputBox($"Wieviel Stück sollen geliefert werden?\n\nStück:", "Artikelanzahl", "");
index++;
} while (!int.TryParse(anzahl, out artAnzahl));
@ -349,17 +338,18 @@ namespace Deckungsbeitrag
}
private void ComboBoxFahrer_Validating(object sender, CancelEventArgs e)
{
ComboBox cb = sender as ComboBox;
if (cb.SelectedIndex == -1) return;
if (cb.SelectedItem is Tour selected && selected.TourID == tour.TourID) return;
if (((ComboBox)sender).SelectedIndex == -1) return;
if (((Benutzer)((ComboBox)sender).SelectedItem).BenutzerID == this.benutzer.BenutzerID) return;
if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Expedit) return;
if (meldung.GetFrage(this, "Möchtest du den Auftrag wirklich einer anderen Tour zuteilen?", false) == DialogResult.No) { ((ComboBox)sender).SelectedIndex = -1; e.Cancel = true; }
if (meldung.GetFrage(this, "Möchtest du den Auftrag wirklich einem anderen Fahrer zuteilen?", false) == DialogResult.No) { ((ComboBox)sender).SelectedIndex = -1; e.Cancel = true; }
else
{
eingabe = Interaction.InputBox("Warum möchtest du den Auftrag einem anderen Fahrer zuteilen?\n\nGrund:", "Sonderzuteilung", "");
if (string.IsNullOrWhiteSpace(eingabe)) e.Cancel = true;
else eingabe += " / ";
}
}
#endregion
/// <summary>
/// ComboBox Artikel & Rhythmus wird geladen.
@ -375,39 +365,37 @@ namespace Deckungsbeitrag
int dropdownWidth = comboBoxArtikel.DropDownWidth;
if (panel.Enabled)
{
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Regelmäßig)
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Regelmäßig || (AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Einmalig)
{
List<Artikel> artikelListe;
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Regelmäßig) artikelListe = Artikel.GetRegArtikelList();
else artikelListe = Artikel.GetArtikelList("Alle");
if (artikelListe.Count == 0)
{
MessageBox.Show("Auswahl für den gewählten Kunden nicht verfügbar.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.comboBoxTyp.SelectedIndex = -1;
return;
}
comboBoxArtikel.DataSource = artikelListe;
comboBoxArtikel.DisplayMember = "ComboBoxAnzeige";
comboBoxArtikel.DropDownWidth = GetDropDownWidth(comboBoxArtikel);
comboBoxArtikel.DisplayMember = "Bezeichnung";
foreach (Artikel art in artikelListe)
{
int bezWidth = TextRenderer.MeasureText(art.Bezeichnung, comboBoxArtikel.Font).Width;
if (dropdownWidth < bezWidth) dropdownWidth = bezWidth;
}
comboBoxArtikel.DropDownWidth = dropdownWidth;
comboBoxArtikel.SelectedIndex = -1;
comboBoxRhythmus.DataSource = Enum.GetValues(typeof(RegRhythmen));
comboBoxRhythmus.SelectedIndex = -1;
comboBoxRhythmus.Enabled = true;
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Einmalig) comboBoxRhythmus.Enabled = false;
}
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.SOLL_Erhoehung || (AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.SOLL_Verminderung || (AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.IST_Erhoehung)
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Standerhöhung || (AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.Standverminderung)
{
List<KundeArtikel> kndartikel = KundeArtikel.GetList(this.kunde.KundeID.ToString());
if (kndartikel.Count == 0)
{
MessageBox.Show("Auswahl für den gewählten Kunden nicht verfügbar.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.comboBoxTyp.SelectedIndex = -1;
return;
}
comboBoxArtikel.DataSource = kndartikel;
comboBoxArtikel.DisplayMember = "ComboBoxAnzeige";
comboBoxArtikel.DropDownWidth = GetDropDownWidth(comboBoxArtikel);
comboBoxArtikel.DisplayMember = "ArtikelName";
foreach (KundeArtikel art in kndartikel)
{
int bezWidth = TextRenderer.MeasureText(art.ArtikelName, comboBoxArtikel.Font).Width;
if (dropdownWidth < bezWidth) dropdownWidth = bezWidth;
}
comboBoxArtikel.DropDownWidth = dropdownWidth;
comboBoxArtikel.SelectedIndex = -1;
comboBoxRhythmus.Enabled = false;
@ -416,18 +404,6 @@ namespace Deckungsbeitrag
comboBoxArtikel.SelectedIndexChanged += ComboBoxArtikel_SelectedIndexChanged;
}
private int GetDropDownWidth(ComboBox cb)
{
int maxLenght = 0;
foreach (object item in cb.Items)
{
int bezWidth = TextRenderer.MeasureText(cb.GetItemText(item), cb.Font).Width;
if (maxLenght < bezWidth) maxLenght = bezWidth;
}
return maxLenght;
}
#endregion
#region Click Events
private void ButtonAbbrechen_Click(object sender, EventArgs e)
@ -449,18 +425,18 @@ namespace Deckungsbeitrag
this.Auftrag = Aktualisieren(kunde);
// Wenn Fahrer den Auftrag speichert
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) { FahrerAuftraegeSpeichern(this.Auftrag); return; }
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) { FahrerAuftraegeSpeichern(this.Auftrag); }
// Wenn Expedit/Waschstrasse/Verwaltung/Admin den Auftrag speichert
switch ((AuftragTyp)comboBoxTyp.SelectedItem)
{
case AuftragTyp.SOLL_Erhoehung: SpezialAuftragSpeichern(Auftrag);
case AuftragTyp.Standerhöhung: SpezialAuftragSpeichern(Auftrag);
return;
case AuftragTyp.SOLL_Verminderung: SpezialAuftragSpeichern(Auftrag);
case AuftragTyp.Standverminderung: SpezialAuftragSpeichern(Auftrag);
return;
case AuftragTyp.Regelmäßig: SpezialAuftragSpeichern(Auftrag);
return;
case AuftragTyp.IST_Erhoehung: SpezialAuftragSpeichern(Auftrag);
case AuftragTyp.Einmalig: SpezialAuftragSpeichern(Auftrag);
return;
default:
break;
@ -564,23 +540,19 @@ namespace Deckungsbeitrag
private Auftrag Aktualisieren(Kunde knd)
{
int? arbeiterID;
DateTime liefertag;
string zusatz = string.Empty;
// ZusatzInfo wird geladen.
// Wenn textBoxText wurde eingetragen (Auftrag Laufzettel)
if (!string.IsNullOrWhiteSpace(textBoxText.Text)) zusatz = textBoxText.Text;
// Wenn Kundennummer ist Div.Barzahler(in FormListe wenn mit ? am Anfang) wird individueller Kundename eingetrage
// Wenn Fahrerwechsel durchgeführt wird Grund eingetragen
if (knd.KundeNummer == "2320000") zusatz += string.IsNullOrWhiteSpace(knd.Suchtext) ? "Kunde: " + knd.KundeName : "Kunde: " + knd.Suchtext;
else if (!string.IsNullOrWhiteSpace(eingabe)) zusatz += "Fahrerwechsel: " + eingabe;
Tour selectedTour = this.comboBoxFahrer.SelectedIndex == -1 ? null : (Tour)this.comboBoxFahrer.SelectedItem;
// Wenn Kundennummer ist Div.Barzahler(in FormListe wenn mit ? am Anfang) wird individueller Kundename als Zusatzinfo gespeichert.
if (knd.KundeNummer == "2320000") zusatz = string.IsNullOrWhiteSpace(knd.Suchtext) ? "Kunde: " + knd.KundeName : "Kunde: " + knd.Suchtext;
else if (!string.IsNullOrWhiteSpace(eingabe)) zusatz = "Fahrerwechsel: " + eingabe;
Auftrag _auftrag = new Auftrag
{
AuftragID = this.Auftrag?.AuftragID,
KundeID = (int)knd.KundeID,
ArbeiterID = arbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID,
AufgabeID = knd.Aufgabe != null ? knd.Aufgabe : null,
Liefertag = liefertag = this.dTPLiefertag.Value,
Container = int.TryParse(this.textBoxCont.Text, out int i) ? i : 0,
@ -588,28 +560,28 @@ namespace Deckungsbeitrag
Erstellt = DateTime.Now,
Typ = (AuftragTyp)comboBoxTyp.SelectedItem,
Abteilungen = AbteilungsStatus.Keine,
Status = this.benutzer.Rolle == BenutzerRolle.Fahrer ? AuftragStatus.Abgeholt : AuftragStatus.Herrichten, // Wenn Fahrer Auftrag erstellt dann abgeholt sonst Herrichten.
Rhythmus = this.comboBoxRhythmus.Enabled ? (RegRhythmen)this.comboBoxRhythmus.SelectedItem : RegRhythmen.Unbekannt, // Wenn Rhythmus ist nicht Enabled dann RegRhythmus Unbekannt.
TourID = selectedTour?.TourID, // Wenn Tour hinterlegt dann TourID speichern.
ArbeiterID = selectedTour?.BenutzerID, // Wenn Tour hinterlegt dann BenutzerID der Tour speichern. KANN AUCH null SEIN!!
Priority = selectedTour == null ? Priority.None : selectedTour.Priority, // Wenn Tour hinterlegt dann Priority der Tour speichern.
Priority = Funktionen.GetPriority((Benutzer)this.comboBoxFahrer.SelectedItem),
Status = this.benutzer.Rolle == BenutzerRolle.Fahrer ? AuftragStatus.Abgeholt : AuftragStatus.Herrichten,
Rhythmus = this.comboBoxRhythmus.Enabled ? (RegRhythmen)this.comboBoxRhythmus.SelectedItem : RegRhythmen.Unbekannt,
//TourID = this.Auftrag == null ? GetTour(arbeiterID, liefertag) : this.Auftrag.TourID,
ZusatzInfo = zusatz,
};
return _auftrag;
}
//private int? GetTour(int? arbeiterID, DateTime liefertag)
//{
// Tour tour;
// do
// {
// tour = Tour.FindeTour(null, arbeiterID, liefertag);
// if (tour == null) Funktionen.UpdateOrSaveTour(Auftrag.TourID, Auftrag);
private int? GetTour(int? arbeiterID, DateTime liefertag)
{
Tour tour;
do
{
tour = Tour.FindeTour(null, arbeiterID, liefertag);
if (tour == null) Funktionen.UpdateOrSaveTour(Auftrag.TourID, Auftrag);
// } while (tour == null);
} while (tour == null);
// return tour.TourID;
//}
return tour.TourID;
}
private void SpezialAuftragSpeichern(Auftrag Auftrag)
{
if (Auftrag.FindeAuftrag(true).Gefunden)
@ -690,6 +662,7 @@ namespace Deckungsbeitrag
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
this.Auftrag = null;
DatenLaden(string.Empty);
}
}
@ -752,22 +725,6 @@ namespace Deckungsbeitrag
//this.Close(); // Onboarding beendet
}
}
private void TextBoxText_VisibleChanged(object sender, EventArgs e)
{
if (textBoxText.Visible)
{
foreach (Control ctr in this.panelRegAuftrag.Controls) if (!ctr.Name.Contains("Text")) ctr.Enabled = false;
}
else foreach (Control ctr in this.panelRegAuftrag.Controls) if (!ctr.Name.Contains("Text")) ctr.Enabled = true;
}
private void CloseForm(DialogResult result)
{
this.DialogResult = result;
this.Close();
}
}
}
//CHANGES: Es kann ab jetzt Morgen als Liefertag gewählt werden.
//CHANGES: Auftrag LAUFZETTEL (ehem. Einmalig) läuft als Sonderauftrag also Tab-Sonderaufträge.
//CHANGES: Der Text des LAUFZETTELS wird bei Expedit im InfoFeld angezeigt.
//CHANGES: DropDownWidth wird an das größte Item angepasst.
//TODO: TourenListe Entwurf muss überarbeitet werden.

View File

@ -54,15 +54,8 @@ namespace Deckungsbeitrag.AA_Forms
public FormShowUserControl(string groupBox, Benutzer user, Kunde kunde) : this(groupBox, user)
{
if (kunde != null)
{
this.Text = string.IsNullOrWhiteSpace(kunde.Suchtext) ? kunde.KundeName : kunde.Suchtext;
this.Text += " " + kunde.Ort;
}
else
{
this.Text = "HEUTIGE TOUR WÄHLEN";
}
this.Text = string.IsNullOrWhiteSpace(kunde.Suchtext) ? kunde.KundeName : kunde.Suchtext;
this.Text += " " + kunde.Ort;
}
private void FormShowUserControl_Load(object sender, EventArgs e)
@ -105,12 +98,11 @@ namespace Deckungsbeitrag.AA_Forms
private void FormShowUserControl_FormClosing(object sender, FormClosingEventArgs e)
{
var form = sender as Form;
if (form.ActiveControl.Name == "UCTourenplan" & form.DialogResult == DialogResult.OK)
if (this.benutzer.Rolle != BenutzerRolle.Expedit)
{
UCTourenplan uc = (UCTourenplan)form.Controls[0];
lieferDaten = uc.lieferDaten;
}
}
}
}

View File

@ -60,11 +60,7 @@ namespace DatenDB
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (artikelID != null) command.CommandText = $"select short from {TABLE} where artikel_id = {artikelID}";
if (!string.IsNullOrWhiteSpace(artname))
{
artname += "%";
command.CommandText = $"select short from {TABLE} where bezeichnung ILIKE '{artname}'";
}
if (!string.IsNullOrWhiteSpace(artname)) command.CommandText = $"select short from {TABLE} where bezeichnung = '{artname}'";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = reader.IsDBNull(0) ? string.Empty : reader.GetString(0);
reader.Close();
@ -241,8 +237,7 @@ namespace DatenDB
}
set { }
}
[OLVIgnore]
public string ComboBoxAnzeige => $"{Nummer} {Bezeichnung}";
#endregion
}
}

View File

@ -18,6 +18,17 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace DatenDB
{
#region Enums
public enum AuftragPriority
{
None = 0,
First = 1,
Second = 2,
Third = 3,
Fourth = 4,
Fifth = 5
}
/// <summary>
/// Enum AuftragStatus
/// </summary>
@ -41,14 +52,13 @@ namespace DatenDB
public enum AuftragTyp
{
Geschäft = 0,
Standart = 10,
Inventur = 20,
SOLL_Erhoehung = 30,
IST_Erhoehung = 32,
SOLL_Verminderung = 40,
Regelmäßig = 50,
AufAbruf = 60,
Laufzettel = 70
Standart = 1,
Inventur = 2,
Standerhöhung = 3,
Standverminderung = 4,
Regelmäßig = 5,
AufAbruf = 6,
Einmalig = 7
}
[Flags]
@ -87,6 +97,67 @@ namespace DatenDB
}
#region async Tasks
public static async Task<List<Auftrag>> GetAuftragListTodayAsync(AuftragStatus? status, NpgsqlConnection conn, AuftragTyp? typ, int? abtstatus)
{
List<Auftrag> resultList = new List<Auftrag>();
bool isExpedit = true;
using (var command = new NpgsqlCommand())
{
command.Connection = conn;
// Listen für FROTTEE EXPEDIT
if (abtstatus != null)
{
if (status != null) command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE status < {(int)status} AND status > {(int)AuftragStatus.Aufgelegt} AND (a.abteilungen_status & 2) = 0 ORDER BY liefertag ASC";
else command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE typ = {(int)typ} and status < {(int)AuftragStatus.Vorbereitet} AND (a.abteilungen_status & 2) <> 0 ORDER BY liefertag ASC";
}
else
{
// Liste für EXPEDIT AUFTRÄGE HEUTE
if (typ == null) command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE status < {(int)status} AND status > {(int)AuftragStatus.Aufgelegt} ORDER BY liefertag ASC";
else
{
// Liste für EXPEDIT GESCHÄFT
if (status == null) command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE typ = {(int)typ} and status < {(int)AuftragStatus.Fertig} ORDER BY liefertag ASC";
else
{ // Liste für EXPEDIT VORBEREITET
command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE typ = {(int)typ} AND status = {(int)status} ORDER BY liefertag ASC";
}
}
}
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader, isExpedit));
}
}
//isExpedit1 = false;
return resultList;
}
public static async Task<List<Auftrag>> GetSonderListsAsync(int? typ, NpgsqlConnection conn, int? abtstatus)
{
List<Auftrag> resultList = new List<Auftrag>();
isExpedit = true;
using (var command = new NpgsqlCommand())
{
command.Connection = conn;
if (abtstatus != null) command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join Kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE typ >= @typ AND status < {(int)AuftragStatus.Fertig} AND a.abteilungen_status <= {abtstatus} ORDER BY status DESC, liefertag ASC";
else command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join Kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE typ >= @typ AND status < {(int)AuftragStatus.Fertig} ORDER BY status DESC, liefertag ASC";
command.Parameters.AddWithValue("@typ", typ ?? 0); // Parameterized + Null-Handling
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader, isExpedit));
}
}
//isExpedit = false;
return resultList;
}
public static async Task<List<Auftrag>> GetStatusListAsync(int? status, NpgsqlConnection conn)
{
List<Auftrag> resultList = new List<Auftrag>();
@ -107,7 +178,7 @@ namespace DatenDB
//isExpedit = false;
return resultList;
}
public static async Task<List<Auftrag>> GetFahrerListAsync(int? tourID, NpgsqlConnection conn)
public static async Task<List<Auftrag>> GetFahrerListAsync(int? fahrerID, NpgsqlConnection conn)
{
List<Auftrag> resultList = new List<Auftrag>();
isExpedit = true;
@ -115,7 +186,7 @@ namespace DatenDB
{
command.Connection = conn;
command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE a.tour_id = {tourID} and liefertag = CURRENT_DATE and status < {(int)AuftragStatus.Ausgeliefert} ORDER BY status DESC";
command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext, u.benutzer_name as fahrer FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id left join kundenverwaltung.benutzer u on a.benutzer_id = u.benutzer_id WHERE a.benutzer_id = {fahrerID} and liefertag = CURRENT_DATE and status < {(int)AuftragStatus.Ausgeliefert} ORDER BY status DESC";
using (var reader = await command.ExecuteReaderAsync())
{
@ -523,7 +594,7 @@ namespace DatenDB
this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
this.Priority = (Priority)reader.GetInt32(21);
this.Priority = (AuftragPriority)reader.GetInt32(21);
if (isExpedit)
{
@ -558,7 +629,7 @@ namespace DatenDB
this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
this.Priority = (Priority)reader.GetInt32(21);
this.Priority = (AuftragPriority)reader.GetInt32(21);
}
#region Properties
@ -686,7 +757,7 @@ namespace DatenDB
{
get
{
if(Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.SOLL_Verminderung)
if(Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.Standverminderung)
{
if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty;
else return _fertig = "✅";
@ -750,7 +821,7 @@ namespace DatenDB
[OLVIgnore]
public RegRhythmen Rhythmus { get; set; }
[OLVIgnore]
public Priority Priority { get; set; } = 0;
public AuftragPriority Priority { get; set; } = 0;
#endregion
private void SpeicherStatus()

View File

@ -167,14 +167,6 @@ namespace Deckungsbeitrag.AA_Klassen
parameters.Add(new NpgsqlParameter("@typ", (int)typFilter.Value));
}
}
else
{
if (minTypFilter.HasValue)
{
conditions.Add("typ > @typ");
parameters.Add(new NpgsqlParameter("@typ", (int)minTypFilter.Value));
}
}
// Frottee-Filter
if (frottee.HasValue && frottee.Value)
@ -207,11 +199,11 @@ namespace Deckungsbeitrag.AA_Klassen
AufgabeErledigt = SafeBool(reader, "aufgabe_erledigt"),
AbteilungenStatus = (AbteilungsStatus)SafeInt(reader, "abteilungen_status"),
Rhythmus = (RegRhythmen)SafeInt(reader, "rhythmus"),
Priority = (Priority)SafeInt(reader, "priority"),
Priority = (AuftragPriority)SafeInt(reader, "priority"),
Gedruckt = SafeDateTime(reader, "gedruckt"),
AufgabeBezeichnung = SafeString(reader, "aufgabe_bez"),
KundeName = SafeString(reader, "suchtext"),
Tour = SafeString(reader, "tour"),
Fahrer = SafeString(reader, "fahrer"),
FrotteeStatus = SafeInt(reader, "frottee_status"),
KleinteileStatus = SafeInt(reader, "kleinteile_status"),
GrossteileStatus = SafeInt(reader, "grossteile_status")
@ -240,24 +232,24 @@ namespace Deckungsbeitrag.AA_Klassen
[OLVIgnore]public int BenutzerID { get; set; }
[OLVIgnore]public int? AufgabeID { get; set; }
[OLVIgnore]public int KundeID { get; set; }
[OLVIgnore]public int? TourID { get; set; }
[OLVIgnore]public bool AufgabeErledigt { get; set; }
[OLVIgnore]public AbteilungsStatus AbteilungenStatus { get; set; }
[OLVIgnore]public RegRhythmen Rhythmus { get; set; }
[OLVIgnore]private DateTime? Gedruckt { get; set; }
[OLVIgnore]public string Zusatz { get; set; }
[OLVColumn("Liefertag", AspectToStringFormat = "{0:ddd dd.MM}", DisplayIndex = 10)]public DateTime? Liefertag { get; set; }
[OLVColumn("Status", DisplayIndex = 40)]public AuftragStatus Status { get; set; }
[OLVIgnore]public int? TourID { get; set; }
[OLVColumn("Schmutzig", DisplayIndex = 20, TextAlign = HorizontalAlignment.Center)]public int ContainerDirt { get; set; }
[OLVColumn("Sauber", DisplayIndex = 30, TextAlign = HorizontalAlignment.Center)]public int ContainerClean { get; set; }
[OLVColumn("Typ", DisplayIndex = 50, IsEditable = false)]public AuftragTyp Typ { get; set; }
[OLVColumn("Priority", DisplayIndex = 15)]public Priority Priority { get; set; }
[OLVIgnore]public bool AufgabeErledigt { get; set; }
[OLVIgnore]public AbteilungsStatus AbteilungenStatus { get; set; }
[OLVIgnore]public RegRhythmen Rhythmus { get; set; }
[OLVColumn("Priority", DisplayIndex = 15)]public AuftragPriority Priority { get; set; }
[OLVIgnore]private DateTime? Gedruckt { get; set; }
// Join-Felder aus Table kunde & benutzer
[OLVColumn("Aufgabe", DisplayIndex = 55)]public string AufgabeBezeichnung { get; set; }
[OLVColumn("Kunde", DisplayIndex = 0)]public string KundeName { get; set; }
[OLVColumn("Tour", DisplayIndex = 70, IsEditable = false)]public string Tour { get; set; }
[OLVColumn("Fahrer", DisplayIndex = 70)]public string Fahrer { get; set; }
// **3 Status-Spalten statt 12 Flags**
[OLVIgnore]public int FrotteeStatus { get; set; }

View File

@ -45,9 +45,7 @@ namespace Deckungsbeitrag
private static Benutzer _benutzer;
private static PrintDocument printdoc;
public static bool IsPhysicalPrint = false; // Globaler Schalter
static Dictionary<int, int[]> _dictionary;
private static bool printed = false;
private static bool inPreview = false;
static Dictionary<string, int[]> _dictionary;
public Funktionen()
{
@ -1013,14 +1011,10 @@ namespace Deckungsbeitrag
if (auftragliste != null) _auftragliste = auftragliste;
if (fahrer != null) _fahrer = fahrer;
if (benutzer != null) _benutzer = benutzer;
string dateiName = $"{_auftragliste[0].Liefertag}_{_fahrer.BenutzerName}";
currentPage = 0; // WICHTIG: reset vor jedem Druck
string path = ConfigurationManager.AppSettings["DateiSavePfad"];
string tmpPdf = Path.Combine(path, "Tourenlisten", dateiName);
//string tmpPdf = @"C:\tmp\output2.pdf";
string tmpPdf = @"C:\tmp\output2.pdf";
PrintDialog dialog = new PrintDialog();
PrintPreviewDialog preview = new PrintPreviewDialog();
@ -1080,10 +1074,46 @@ namespace Deckungsbeitrag
if (IsPhysicalPrint)
{
GeneratePdfFromPrintDocument(tmpPdf);
if (WaitForFileReady(tmpPdf))
{
Tour tour = null;
if (_auftragliste[0].TourID != null) tour = Tour.GetTour(_auftragliste[0].TourID);
else tour = Tour.FindeTour(_auftragliste[0].TourID, _fahrer.BenutzerID, _auftragliste[0].Liefertag);
if (tour == null)
{
UpdateOrSaveTour(_auftragliste[0].TourID, _auftragliste[0]);
tour = Tour.FindeTour(_auftragliste[0].TourID, _fahrer.BenutzerID, _auftragliste[0].Liefertag);
}
int kndanzahl = 0;
int contanzahl = 0;
int dirtanzahl = 0;
foreach (Auftrag _auftrag in _auftragliste)
{
contanzahl += _auftrag.ContainerClean;
dirtanzahl += _auftrag.Container;
_auftrag.TourID = tour.TourID;
_auftrag.Save();
kndanzahl++;
}
tour.ContainerClean = contanzahl;
tour.ContainerDirt = dirtanzahl;
tour.Tourenliste = File.ReadAllBytes(tmpPdf);
tour.Kundenanzahl = kndanzahl;
tour.ListeGedruckt = DateTime.Now;
tour.GedrucktVon = _benutzer.BenutzerID;
if (tour.Save() == 0) meldung.GetFehler(null, "PDF konnte nicht gespeichert werden. Bitte melde dich bei einem Vorgesetzten.");
}
File.Delete(tmpPdf);
}
}
}
public static Image SonderEtikett_Entwurf(Auftrag auftrag, Dictionary<int, int[]> dictionary)
public static Image SonderEtikett_Entwurf(Auftrag auftrag, Dictionary<string, int[]> dictionary)
{
Kunde kunde = Kunde.GetKunde(string.Empty, auftrag.KundeID, string.Empty);
if (kunde.Suchtext.StartsWith("?") | kunde.KundeNummer == "2320000") kunde.Suchtext = auftrag.ZusatzInfo;
@ -1118,58 +1148,48 @@ namespace Deckungsbeitrag
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
Artikel _artikel = Artikel.GetArtikel(null, kndart.ArtikelID);
string artikelKey = _artikel.Bezeichnung; // z.B. "ART1"
string artikelKey = kvp.Key; // z.B. "ART1"
int[] artbestand = kvp.Value; // z.B. [3, 0, 5]
string shortName = _artikel.Short;
float bestandWidth = g.MeasureString($"{artbestand[0].ToString()}/{artbestand[1].ToString()}/({artbestand[2].ToString()})/{artbestand[3].ToString()}", font1).Width;
g.DrawString($"{shortName}", font1, Brushes.Black, einzug, nextposition);
if (artbestand[2] < 0) g.DrawString($"{artbestand[0].ToString()}/{artbestand[1].ToString()}/({artbestand[2].ToString()})/{artbestand[3].ToString()}", font1, Brushes.Black, bitmap.Width - bestandWidth - 10, nextposition);
else g.DrawString($"{artbestand[0].ToString()}/{artbestand[1].ToString()}/{artbestand[2].ToString()}/{artbestand[3].ToString()}", font1, Brushes.Black, bitmap.Width - bestandWidth - 10, nextposition);
g.DrawString($"{Artikel.GetShort(null, artikelKey)}", font1, Brushes.Black, einzug, nextposition);
if (artbestand[2] < 0) g.DrawString($"{artbestand[0].ToString()}/{artbestand[1].ToString()}/({artbestand[2].ToString()})/{artbestand[3].ToString()}", font1, Brushes.Black, einzug + 50, nextposition);
else g.DrawString($"{artbestand[0].ToString()}/{artbestand[1].ToString()}/{artbestand[2].ToString()}/{artbestand[3].ToString()}", font1, Brushes.Black, einzug + 50, nextposition);
nextposition += (int)height_font1;
}
Image img = bitmap;
return img;
}
public static DialogResult SonderEtikett_Drucken(Auftrag auftrag, Dictionary<int, int[]> dictionary)
public static DialogResult SonderEtikett_Drucken(Auftrag auftrag, Dictionary<string, int[]> dictionary)
{
_auftrag = auftrag;
_dictionary = dictionary;
int x = auftrag.ContainerClean;
PrintDialog dialog = new PrintDialog();
PrintPreviewDialog preview = new PrintPreviewDialog();
PrintDocument printDocument = new PrintDocument();
foreach (string printer in PrinterSettings.InstalledPrinters)
{
if (printer.Contains(Properties.Settings.Default.Etikett_Drucker))
{
dialog.PrinterSettings.PrinterName = printer;
break;
}
}
foreach (string printer in PrinterSettings.InstalledPrinters) if (printer.Contains(Properties.Settings.Default.Etikett_Drucker)) dialog.PrinterSettings.PrinterName = printer;
dialog.PrinterSettings.Copies = 2;
if (dialog.ShowDialog() == DialogResult.OK)
{
printDocument.PrinterSettings = dialog.PrinterSettings;
printDocument.PrintPage -= PrintDocument_PrintPage;
printDocument.PrintPage += PrintDocument_PrintPage;
// Wenn Drucker ist NICHT Etikett_Drucker wird Papiergröße Custom gesetzt
printDocument.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
if (!printDocument.PrinterSettings.PrinterName.Contains(Properties.Settings.Default.Etikett_Drucker)) printDocument.DefaultPageSettings.PaperSize = new PaperSize("Etikett-Custom", 29, 90);
dialog.Document = printDocument;
dialog.Document.DocumentName = "SonderEtikett";
printDocument.Print();
preview.StartPosition = FormStartPosition.CenterScreen;
preview.WindowState = FormWindowState.Normal;
preview.Document = printDocument;
preview.Document.DocumentName = "SonderEtikett";
preview.ShowDialog();
//dialog.Document = printDocument;
//dialog.Document.DocumentName = "Etikett";
//printDocument.Print();
return DialogResult.OK;
}
else return DialogResult.Cancel;
return DialogResult.Cancel;
}
private static void PrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
@ -1199,11 +1219,7 @@ namespace Deckungsbeitrag
e.HasMorePages = false;
}
if (sender.ToString().Contains("Etikett")) e.Graphics.DrawImage(Etikett_Entwurf(null, _auftrag, _nocont), e.PageBounds);
if (sender.ToString().Contains("Sonder"))
{
if (!inPreview) printed = true;
e.Graphics.DrawImage(SonderEtikett_Entwurf(_auftrag, _dictionary), e.PageBounds);
}
if (sender.ToString().Contains("Sonder")) e.Graphics.DrawImage(SonderEtikett_Entwurf(_auftrag, _dictionary), e.PageBounds);
if (sender.ToString().Contains("TourenListe"))
{
if (pagesToPrint == currentPage) currentPage = 0;
@ -1444,12 +1460,12 @@ namespace Deckungsbeitrag
DateTime aktDatum = DateTime.Today;
// Starte ab morgen und suche nächsten passenden Arbeitstag
for (int i = 1; i <= 7; i++)
for (int i = 2; i <= 7; i++)
{
DateTime testDatum = aktDatum.AddDays(i);
DayOfWeek dow = testDatum.DayOfWeek;
Liefertage liefertag;
// Klassischer switch statement (C# 7.3 kompatibel)
switch (dow)
{
@ -1611,48 +1627,48 @@ namespace Deckungsbeitrag
}
}
//public static void UpdateOrSaveTour(int? tourid, Auftrag auftrag)
//{
// int? arbeiterID = null;
// DateTime? liefertag = null;
// int? tourID = tourid;
// Tour tour = null;
public static void UpdateOrSaveTour(int? tourid, Auftrag auftrag)
{
int? arbeiterID = null;
DateTime? liefertag = null;
int? tourID = tourid;
Tour tour = null;
// if (auftrag != null)
// {
// arbeiterID = auftrag.ArbeiterID;
// liefertag = auftrag.Liefertag;
// tourID = auftrag.TourID;
// }
if (auftrag != null)
{
arbeiterID = auftrag.ArbeiterID;
liefertag = auftrag.Liefertag;
tourID = auftrag.TourID;
}
// if (tourID != null) tour = Tour.GetTour(tourID);
// if (tour == null)
// {
// tour = new Tour();
// tour.TourID = null;
// tour.BenutzerID = auftrag.ArbeiterID;
// tour.Liefertag = auftrag.Liefertag;
// tour.SaisonID = Saison.GetAktivSaison().SaisonId;
// }
// tour.Kundenanzahl++;
// tour.ContainerDirt += auftrag.Container;
// tour.ContainerClean += auftrag.ContainerClean;
if (tourID != null) tour = Tour.GetTour(tourID);
if (tour == null)
{
tour = new Tour();
tour.TourID = null;
tour.BenutzerID = auftrag.ArbeiterID;
tour.Liefertag = auftrag.Liefertag;
tour.SaisonID = Saison.GetAktivSaison().SaisonId;
}
tour.Kundenanzahl++;
tour.ContainerDirt += auftrag.Container;
tour.ContainerClean += auftrag.ContainerClean;
// if (tour.Save() == 0) meldung.GetFehler(null, "Speichern oder Updaten der Tour war nicht möglich.\nBitte informiere deinen Vorgesetzten.");
//}
if (tour.Save() == 0) meldung.GetFehler(null, "Speichern oder Updaten der Tour war nicht möglich.\nBitte informiere deinen Vorgesetzten.");
}
internal static Priority GetPriority(Benutzer user)
internal static AuftragPriority GetPriority(Benutzer user)
{
string vorname;
if (user == null) vorname = string.Empty;
else vorname = user.Vorname;
switch (vorname)
{
case var n when n == "Gerald": return Priority.First;
case var n when n == "Jochen": return Priority.Second;
case var n when n == "Thomas": return Priority.Third;
case var n when n == "Alil": return Priority.Fourth;
default: return Priority.None;
case var n when n == "Gerald": return AuftragPriority.First;
case var n when n == "Jochen": return AuftragPriority.Second;
case var n when n == "Thomas": return AuftragPriority.Third;
case var n when n == "Alil": return AuftragPriority.Fourth;
default: return AuftragPriority.None;
}
}

View File

@ -259,6 +259,6 @@ namespace DatenDB
public int? ArtikelID { get; set; }
[OLVColumn("Reihung", IsVisible = false)]
public int Reihung { get; set; }
[OLVIgnore] public string ComboBoxAnzeige => $"{ArtikelNR} {ArtikelName}";
}
}

View File

@ -4,7 +4,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using ZXing;
@ -12,8 +11,8 @@ namespace Deckungsbeitrag.AA_Klassen
{
public class Tour
{
// 0 1 2 3 4
public const string COLUMNS = "tour_id, benutzer_id, saison_id, bezeichnung, priority";
// 0 1 2 3 4 5 6 7 8 9 10 11
public const string COLUMNS = "tour_id, benutzer_id, kundenanzahl, liefertag, start, ende, container_dirt, container_clean, saison_id, tourenliste, listegedruckt, gedruckt_von";
public const string TABLE = "kundenverwaltung.tour";
#region Class-Standarts (Properties, Save, reader)
@ -22,8 +21,15 @@ namespace Deckungsbeitrag.AA_Klassen
public int? TourID { get; set; }
public int? BenutzerID { get; set; }
public int? SaisonID { get; set; }
public string Bezeichnung { get; set; }
public Priority Priority { get; set; }
public int? Kundenanzahl { get; set; }
public DateTime Liefertag { get; set; }
public DateTime? Start { get; set; }
public DateTime? Ende { get; set; }
public int ContainerDirt { get; set; }
public int ContainerClean { get; set; }
public byte[] Tourenliste { get; set; }
public DateTime? ListeGedruckt { get; set; }
public int? GedrucktVon { get; set; }
public int? Save()
{
@ -36,23 +42,28 @@ namespace Deckungsbeitrag.AA_Klassen
int? result;
if (this.TourID.HasValue & this.TourID != 0)
{
command.CommandText = $"update {TABLE} set benutzer_id = :p1, saison_id = :p2, bezeichnung = :p3, priority = :p4 WHERE tour_id = :p0";
command.CommandText = $"update {TABLE} set benutzer_id = :p1, kundenanzahl = :p2, liefertag = :p3, start = :p4, ende = :p5, container_dirt = :p6, container_clean = :p7, saison_id = :p8, tourenliste = :p9, listegedruckt = :p10, gedruckt_von = :p11 WHERE tour_id = :p0";
}
else
{
command.CommandText = "select nextval('kundenverwaltung.tour_seq')";
this.TourID = (int)(long)command.ExecuteScalar();
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4)";
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11)";
}
Match match = Regex.Match(this.Bezeichnung ?? "", @"\d+");
int zahl = match.Success ? int.Parse(match.Value) : 0; // oder throw bei Fehler
command.Parameters.AddWithValue("p0", this.TourID);
command.Parameters.AddWithValue("p1", this.BenutzerID.HasValue ? this.BenutzerID.Value : (object)DBNull.Value);
command.Parameters.AddWithValue("p2", this.SaisonID ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p3", this.Bezeichnung);
command.Parameters.AddWithValue("p4", zahl);
command.Parameters.AddWithValue("p1", this.BenutzerID);
command.Parameters.AddWithValue("p2", this.Kundenanzahl ?? 0);
command.Parameters.AddWithValue("p3", this.Liefertag);
command.Parameters.AddWithValue("p4", this.Start ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p5", this.Ende ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p6", this.ContainerDirt);
command.Parameters.AddWithValue("p7", this.ContainerClean);
command.Parameters.AddWithValue("p8", this.SaisonID ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p9", this.Tourenliste ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p10", this.ListeGedruckt.HasValue ? (DateTime?)this.ListeGedruckt.Value : (DateTime?)DateTime.Now);
command.Parameters.AddWithValue("p11", this.GedrucktVon ?? (object)DBNull.Value);
result = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close();
@ -64,10 +75,17 @@ namespace Deckungsbeitrag.AA_Klassen
public Tour(NpgsqlDataReader reader)
{
this.TourID = reader.GetInt32(0);
this.BenutzerID = reader.IsDBNull(1) ? (int?)null : reader.GetInt32(1);
this.SaisonID = reader.GetInt32(2);
this.Bezeichnung = reader.IsDBNull(3) ? string.Empty : reader.GetString(3);
this.Priority = reader.IsDBNull(4) ? Priority.None : (Priority)reader.GetInt32(4);
this.BenutzerID = reader.GetInt32(1);
this.Kundenanzahl = reader.GetInt32(2);
this.Liefertag = reader.GetDateTime(3);
this.Start = reader.IsDBNull(4) ? (DateTime?)null : reader.GetDateTime(4);
this.Ende = reader.IsDBNull(5) ? (DateTime?)null : reader.GetDateTime(5);
this.ContainerDirt = reader.IsDBNull(6) ? 0 : reader.GetInt32(6);
this.ContainerClean = reader.IsDBNull(7) ? 0 : reader.GetInt32(7);
this.SaisonID = reader.GetInt32(8);
this.Tourenliste = reader.IsDBNull(9) ? null : (byte[])reader[9];
this.ListeGedruckt = reader.IsDBNull(10) ? (DateTime?)null : reader.GetDateTime(10);
this.GedrucktVon = reader.IsDBNull(11) ? (int?)null : reader.GetInt32(11);
}
#endregion
@ -104,14 +122,14 @@ namespace Deckungsbeitrag.AA_Klassen
return result;
}
internal static Tour GetTour(int? saison, string bez)
internal static Tour GetTour(int? tourID)
{
Tour result = null;
DatenbankConnection.GetConnection().Open();
using (NpgsqlCommand command = new NpgsqlCommand())
{
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where saison_id = {saison} and bezeichnung = '{bez}'";
command.CommandText = $"select {COLUMNS} from {TABLE} where tour_id = {tourID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Tour(reader);
reader.Close();
@ -122,25 +140,6 @@ namespace Deckungsbeitrag.AA_Klassen
return result;
}
internal static List<Tour> GetSaisonListe(Saison saison)
{
List<Tour> resultList = new List<Tour>();
DatenbankConnection.GetConnection().Open();
using (NpgsqlCommand command = new NpgsqlCommand())
{
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where saison_id = {saison.SaisonId}";
using (var reader = command.ExecuteReader())
{
while (reader.Read())
resultList.Add(new Tour(reader));
}
}
DatenbankConnection.GetConnection().Close();
return resultList;
}
#endregion
}
public class TDaten
@ -156,3 +155,11 @@ namespace Deckungsbeitrag.AA_Klassen
}
}
//INSTALL-REMINDER: Tabelle Tour in Datenbank einfügen
//CHANGES: Class Tour wurde erstellt. Speichern, Laden und Bearbeiten von Touren sollte möglich sein.
//DONE: Wenn Fahrer neuen Auftrag erstellt, wird Tour (BenutzerID & Liefertag) gesucht und gespeichert oder upgedatet. Dabei werden die Containerzahlen schmutzig addiert und die Kundenanzahl um 1 erhöht.
//TODO: Wenn Auftrag abgeschlossen wird muss die Containerzahl sauber addiert werden. Kundenanzahl und Containeranzahl schmutzig darf nicht erhöht werden.
//TODO: !!ÜBERLEGE!! Tour Start und Ende automatisch erfassen. (Beladenscan und Entladescan?)
//TODO: Eingabemöglichkeit von Tour Start und Ende muss erledigt werden.
//TODO: Kundenanzahl bei Tourenliste erstellen vergleichen und anpassen.
//TODO: !!ÜBERLEGE!! DB-Query für Kundenanzahl und Containeranzahl Abgleich. (Aufträge haben TourID hinterlegt. So sollte alles vergleichbar sein.)

View File

@ -15,7 +15,6 @@ using System.Net;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
@ -27,22 +26,12 @@ using System.Windows.Forms;
namespace Deckungsbeitrag
{
public enum Priority
{
None = 0,
First = 1,
Second = 2,
Third = 3,
Fourth = 4,
Fifth = 5
}
static class Program
static class Program
{
public static Color Wirlblau = Settings.Default.Wirlblau;
public static ImageList imagelist = new ImageList();
public static string userid;
public static Benutzer benutzer;
public static Benutzer benutzer = new Benutzer();
public static bool Artikelliste_Importiert = false;
public static bool Kundenliste_Importiert = false;
public static bool Software_Updated = false;
@ -124,7 +113,7 @@ namespace Deckungsbeitrag
switch (userid)
{
case var s when s.Contains("wstrasse"):
//benutzer = Benutzer.GetBenutzer(null, 4);
benutzer = Benutzer.GetBenutzer(null, 4);
Application.Run(new FormAufleger(userid));
break;
case var s when s.Contains("frottee"):
@ -548,11 +537,11 @@ namespace Deckungsbeitrag
foreach (Process p in Process.GetProcessesByName("SetupVerwaltung"))
p.Kill();
// 3. 10 Sekunden warten (Restart Manager)
//Thread.Sleep(10000);
// 3. 2 Sekunden warten (Restart Manager)
Thread.Sleep(2000);
//Process.Start(psi)?.Dispose();
Process.Start(psi)?.Dispose();
return true;
}
catch (Exception ex)

View File

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

View File

@ -1647,15 +1647,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SetupVerwaltung"
"ProductCode" = "8:{6B8C2382-5CE0-49C5-8D93-816BFC2E9948}"
"PackageCode" = "8:{0529029E-E7D8-439E-AC8C-37B0429A5800}"
"ProductCode" = "8:{7FE3B32D-864D-4355-8B88-E081CA878C3C}"
"PackageCode" = "8:{DB4C46FC-7C24-4855-B5C9-BDFC88B1186F}"
"UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.97"
"ProductVersion" = "8:1.0.94"
"Manufacturer" = "8:Kilian Wirl GmbH"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"

View File

@ -25,6 +25,10 @@ Build-Info:
##CHANGES##
##DONE_TODOS##
##OPEN_TODOS##
Installation: ##BUILD_DATE##
=====================================
"@ | Out-File $readmePath -Encoding UTF8
@ -43,7 +47,6 @@ if (Test-Path $assemblyInfoPath) {
}
# Dateien durchsuchen
$changesList = @()
$openTodos = @()
$doneTodos = @()
$installReminders = @()
@ -75,39 +78,10 @@ foreach ($file in $csFiles) {
}
# CHANGES erkennen
$pattern = '//\s*CHANGES\s*:?\s*(.+?)(?=\r?\n|//|$)'
$changeMatches = [regex]::Matches($content, $pattern, 'IgnoreCase')
$changeMatches = [regex]::Matches($content, '//\s*CHANGES\s*:?\s*(.+?)(?=\r?\n|//|$)', 'IgnoreCase')
foreach ($match in $changeMatches) {
$txt = $match.Groups[1].Value.Trim()
if ($txt) {
$changesList += [PSCustomObject]@{
Datei = if ($file.Name.StartsWith("Form")) {
$file.Name.Substring(4)
} else {$file.Name}
Text = $txt
}
}
$markdownLines = @()
# Nach Class gruppieren, ClassNamen sortieren, dann pro Gruppe Text sortieren
$changesList |
Group-Object -Property Datei |
Sort-Object -Property Name |
ForEach-Object {
$datei = $_.Name
$markdownLines += "## $datei ##"
$markdownLines += ""
$_.Group |
Sort-Object -Property Text |
ForEach-Object {
$markdownLines += "- ✨ $($_.Text)"
}
$markdownLines += ""
}
if ($txt) { $changes += "$txt [$($file.Name)]" }
}
}
@ -115,6 +89,7 @@ foreach ($file in $csFiles) {
$openTodos = $openTodos | Sort-Object | Get-Unique
$doneTodos = $doneTodos | Sort-Object | Get-Unique
$installReminders = $installReminders | Sort-Object | Get-Unique
$changes = $changes | Sort-Object | Get-Unique
# Formatierte Abschnitte
$doneSection = if ($doneTodos.Count -gt 0) {
@ -138,9 +113,9 @@ $installSection = if ($installReminders.Count -gt 0) {
@("Keine Install-Reminder vorhanden ✅")
}
$changesSection = if ($markdownLines.Count -gt 0) {
@("=== ✨ CHANGES ($($markdownLines.Count)) ===") +
($markdownLines | ForEach-Object { "- $_" })
$changesSection = if ($changes.Count -gt 0) {
@("=== ✨ CHANGES ($($changes.Count)) ===") +
($changes | ForEach-Object { "- $_" })
} else {
@("Keine Changes vorhanden")
}
@ -150,7 +125,6 @@ $doneText = $doneSection -join "`r`n"
$openText = $openSection -join "`r`n"
$installText = $installSection -join "`r`n"
$changesText = $changesSection -join "`r`n"
$markdown = $markdownLines -join "`n"
$custom = "Release Build"
$buildDate = Get-Date -Format "dd.MM.yyyy HH:mm"
@ -166,13 +140,17 @@ Build-Info:
- Erledigte TODOs: $($doneTodos.Count)
- Offene TODOs: $($openTodos.Count)
- Install-Reminders: $($installReminders.Count)
- Changes: $($changesList.Count)
- Changes: $($changes.Count)
=== CHANGES ($($changesList.Count)) ===
$markdown
$installText
$changesText
`r`n$doneText
`r`n$openText
Installation: $buildDate
=====================================
"@

View File

@ -84,7 +84,7 @@ namespace Deckungsbeitrag.UserControls
{
this.SuspendLayout();
if (!this.groupBoxSuchen.Visible) return;
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(Priority));
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragPriority));
this.comboBoxTyp.SelectedIndex = -1;
this.comboBoxStatus.DataSource = Enum.GetValues(typeof(AuftragStatus));
this.comboBoxStatus.SelectedIndex = -1;

View File

@ -38,10 +38,6 @@
this.dTPInvDatum = new System.Windows.Forms.DateTimePicker();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.dGArtikel = new System.Windows.Forms.DataGridView();
this.buttonFreigeben = new System.Windows.Forms.Button();
this.panelButtons = new System.Windows.Forms.Panel();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.labelInvText = new System.Windows.Forms.Label();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -49,6 +45,11 @@
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonFreigeben = new System.Windows.Forms.Button();
this.panelButtons = new System.Windows.Forms.Panel();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.labelInvText = new System.Windows.Forms.Label();
this.groupBoxInventur.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
@ -186,69 +187,6 @@
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGArtikel_CellValueChanged);
this.dGArtikel.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.DGArtikel_DataBindingComplete);
//
// buttonFreigeben
//
this.buttonFreigeben.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFreigeben.BackColor = System.Drawing.Color.Gray;
this.buttonFreigeben.CausesValidation = false;
this.buttonFreigeben.Enabled = false;
this.buttonFreigeben.FlatAppearance.BorderSize = 0;
this.buttonFreigeben.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFreigeben.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFreigeben.ForeColor = System.Drawing.Color.Black;
this.buttonFreigeben.Location = new System.Drawing.Point(849, 5);
this.buttonFreigeben.Margin = new System.Windows.Forms.Padding(0);
this.buttonFreigeben.Name = "buttonFreigeben";
this.buttonFreigeben.Size = new System.Drawing.Size(250, 40);
this.buttonFreigeben.TabIndex = 38;
this.buttonFreigeben.Text = "Speichern/Freigeben";
this.buttonFreigeben.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonFreigeben.UseVisualStyleBackColor = false;
this.buttonFreigeben.Click += new System.EventHandler(this.ButtonFreigeben_Click);
//
// panelButtons
//
this.panelButtons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelButtons.Controls.Add(this.buttonAbbrechen);
this.panelButtons.Controls.Add(this.labelInvText);
this.panelButtons.Controls.Add(this.buttonFreigeben);
this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtons.Location = new System.Drawing.Point(3, 570);
this.panelButtons.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panelButtons.Name = "panelButtons";
this.panelButtons.Size = new System.Drawing.Size(1106, 52);
this.panelButtons.TabIndex = 43;
//
// buttonAbbrechen
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
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.Black;
this.buttonAbbrechen.Location = new System.Drawing.Point(594, 5);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(0, 0, 5, 0);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(250, 40);
this.buttonAbbrechen.TabIndex = 41;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.ButtonAbbrechen_Click);
//
// labelInvText
//
this.labelInvText.AutoSize = true;
this.labelInvText.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.labelInvText.Location = new System.Drawing.Point(3, 15);
this.labelInvText.Name = "labelInvText";
this.labelInvText.Size = new System.Drawing.Size(70, 25);
this.labelInvText.TabIndex = 39;
this.labelInvText.Text = "label1";
this.labelInvText.Visible = false;
this.labelInvText.Click += new System.EventHandler(this.LabelInvText_Click);
//
// Column1
//
this.Column1.DataPropertyName = "ArtikelNR";
@ -270,11 +208,11 @@
// Column3
//
this.Column3.DataPropertyName = "Stand";
this.Column3.HeaderText = "Soll-Stand";
this.Column3.HeaderText = "Ist-Stand";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 143;
this.Column3.Width = 129;
//
// Column4
//
@ -311,6 +249,90 @@
this.Column7.ReadOnly = true;
this.Column7.Width = 171;
//
// buttonFreigeben
//
this.buttonFreigeben.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFreigeben.BackColor = System.Drawing.Color.Gray;
this.buttonFreigeben.CausesValidation = false;
this.buttonFreigeben.Enabled = false;
this.buttonFreigeben.FlatAppearance.BorderSize = 0;
this.buttonFreigeben.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFreigeben.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFreigeben.ForeColor = System.Drawing.Color.Black;
this.buttonFreigeben.Location = new System.Drawing.Point(899, 5);
this.buttonFreigeben.Margin = new System.Windows.Forms.Padding(0);
this.buttonFreigeben.Name = "buttonFreigeben";
this.buttonFreigeben.Size = new System.Drawing.Size(200, 40);
this.buttonFreigeben.TabIndex = 38;
this.buttonFreigeben.Text = "Inventur freigeben";
this.buttonFreigeben.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonFreigeben.UseVisualStyleBackColor = false;
this.buttonFreigeben.Click += new System.EventHandler(this.ButtonFreigeben_Click);
//
// panelButtons
//
this.panelButtons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelButtons.Controls.Add(this.buttonAbbrechen);
this.panelButtons.Controls.Add(this.buttonSpeichern);
this.panelButtons.Controls.Add(this.labelInvText);
this.panelButtons.Controls.Add(this.buttonFreigeben);
this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtons.Location = new System.Drawing.Point(3, 570);
this.panelButtons.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panelButtons.Name = "panelButtons";
this.panelButtons.Size = new System.Drawing.Size(1106, 52);
this.panelButtons.TabIndex = 43;
//
// buttonAbbrechen
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
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.Black;
this.buttonAbbrechen.Location = new System.Drawing.Point(489, 5);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(0);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(200, 40);
this.buttonAbbrechen.TabIndex = 41;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.ButtonAbbrechen_Click);
//
// buttonSpeichern
//
this.buttonSpeichern.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSpeichern.BackColor = System.Drawing.Color.Gray;
this.buttonSpeichern.CausesValidation = false;
this.buttonSpeichern.Enabled = false;
this.buttonSpeichern.FlatAppearance.BorderSize = 0;
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.Black;
this.buttonSpeichern.Location = new System.Drawing.Point(694, 5);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(5);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(200, 40);
this.buttonSpeichern.TabIndex = 40;
this.buttonSpeichern.Text = "Speichern";
this.buttonSpeichern.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonSpeichern.UseVisualStyleBackColor = false;
this.buttonSpeichern.Click += new System.EventHandler(this.ButtonSpeichern_Click);
//
// labelInvText
//
this.labelInvText.AutoSize = true;
this.labelInvText.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.labelInvText.Location = new System.Drawing.Point(3, 15);
this.labelInvText.Name = "labelInvText";
this.labelInvText.Size = new System.Drawing.Size(70, 25);
this.labelInvText.TabIndex = 39;
this.labelInvText.Text = "label1";
this.labelInvText.Visible = false;
this.labelInvText.Click += new System.EventHandler(this.LabelInvText_Click);
//
// UCInventur
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -344,11 +366,6 @@
private System.Windows.Forms.PictureBox pictureBoxClose;
private System.Windows.Forms.Panel panelButtons;
private System.Windows.Forms.Label labelInvText;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label labelLieferDat;
private System.Windows.Forms.DateTimePicker dTPLieferDat;
private System.Windows.Forms.Label labelInvDat;
private System.Windows.Forms.Button buttonAbbrechen;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
@ -356,5 +373,11 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
}
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button buttonSpeichern;
private System.Windows.Forms.Label labelLieferDat;
private System.Windows.Forms.DateTimePicker dTPLieferDat;
private System.Windows.Forms.Label labelInvDat;
private System.Windows.Forms.Button buttonAbbrechen;
}
}

View File

@ -41,11 +41,14 @@ namespace Deckungsbeitrag.UserControls
_tosave = value;
if (_tosave)
{
buttonFreigeben.Enabled = true;
buttonFreigeben.BackColor = Color.Turquoise;
buttonSpeichern.Enabled = true;
buttonSpeichern.BackColor = Color.FromArgb(0, 192, 0);
if ((this.user.Rolle == BenutzerRolle.Verwaltung) || (this.user.Rolle == BenutzerRolle.Admin)) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
}
else
{
buttonSpeichern.Enabled = false;
buttonSpeichern.BackColor = Color.Gray;
buttonFreigeben.Enabled = false;
buttonFreigeben.BackColor = Color.Gray;
}
@ -77,11 +80,12 @@ namespace Deckungsbeitrag.UserControls
private void UCInventur_Load(object sender, EventArgs e)
{
if ((this.user.Rolle == BenutzerRolle.Verwaltung & Tosave) || (this.user.Rolle == BenutzerRolle.Admin & Tosave)) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
string kundeName = this.kunde.Suchtext ?? this.kunde.KundeName;
this.groupBoxInventur.Text = $"Inventur-{this.kunde.KundeNummer} {kundeName}";
if (lines == null || lines.Length == 0) { this.dTPInvDatum.Value = DateTime.Today.Date; }
else { this.dTPInvDatum.Value = DateTime.Parse(lines[4].Split(':')[1]); this.dTPInvDatum.Enabled = true; this.buttonAbbrechen.Visible = false; }
else { this.dTPInvDatum.Value = DateTime.Parse(lines[4].Split(':')[1]); this.dTPInvDatum.Enabled = true; }
if (auftrag != null) this.dTPLieferDat.Value = auftrag.Liefertag;
Load_DGV();
if (lines != null & Sender is FormMain) PictureBoxClose_Click(sender, e);
@ -201,57 +205,45 @@ namespace Deckungsbeitrag.UserControls
Funktionen.GetGroupBoxBoarder(gb, e);
}
/// <summary>
/// Speichern oder Freigeben der Inventur. Wenn kein Auftrag vorhanden wird davor ButtonSpeichern_Click aufgerufen.
/// Wenn User ist Expedit kann NUR gespeichert werden.
/// Wenn User NICHT Expedit wird abgefragt ob Speichern oder Freigeben. (Speichern wenn noch Zahlen fehlen)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonFreigeben_Click(object sender, EventArgs e)
{
if (this.user.Rolle == BenutzerRolle.Expedit) { ButtonSpeichern_Click("Speichern", null); return; }
DialogResult result = MessageBox.Show("Möchtest du die Inventur Speichern oder Freigeben?\n\n[JA] => Speichern (es fehlen noch Zahlen)\n[NEIN] => Freigeben (alle Zahlen vorhanden)", "FRAGE", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Yes) { ButtonSpeichern_Click("Speichern", null); return; }
if (result == DialogResult.Cancel) return;
if (result == DialogResult.No)
if (this.auftrag == null) return;
this.auftrag.Liefertag = dTPLieferDat.Value;
foreach (DataGridViewRow row in this.dGArtikel.Rows)
{
if (this.auftrag == null) ButtonSpeichern_Click("Speichern", null);
this.auftrag.Liefertag = dTPLieferDat.Value;
foreach (DataGridViewRow row in this.dGArtikel.Rows)
// KundeArtikel updaten. Neuen Stand eintragen, Reklamation & Fehlmenge auf Null setzten und Korrektur als InventruAusgleich speichern.
KundeArtikel art = (KundeArtikel)artikelListe[row.Index];
art.Reklamation = 0;
art.Fehlmenge = 0;
art.StandBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.FehlmengeBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.KorrekturBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.Stand = int.Parse(row.Cells[2].Value.ToString());
art.Korrektur = int.Parse(row.Cells[6].Value.ToString());
art.Save();
// AuftragArtikel erstellen.
if (int.Parse(row.Cells[6].Value.ToString()) != 0)
{
// KundeArtikel updaten. Neuen Stand eintragen, Reklamation & Fehlmenge auf Null setzten und Korrektur als InventruAusgleich speichern.
KundeArtikel art = (KundeArtikel)artikelListe[row.Index];
art.Reklamation = 0;
art.Fehlmenge = 0;
art.StandBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.FehlmengeBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.KorrekturBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
art.Stand = int.Parse(row.Cells[2].Value.ToString());
art.Korrektur = int.Parse(row.Cells[6].Value.ToString());
art.Save();
// AuftragArtikel erstellen.
if (int.Parse(row.Cells[6].Value.ToString()) != 0)
AuftragArtikel auf = new AuftragArtikel
{
AuftragArtikel auf = new AuftragArtikel
{
ArtikelID = art.ArtikelID,
AuftragID = auftrag.AuftragID,
Anzahl = art.Korrektur,
ArtikelName = art.ArtikelName,
Gesamt = art.Korrektur
};
auf.Save();
}
ArtikelID = art.ArtikelID,
AuftragID = auftrag.AuftragID,
Anzahl = art.Korrektur,
ArtikelName = art.ArtikelName,
Gesamt = art.Korrektur
};
auf.Save();
}
auftrag.Status = AuftragStatus.Herrichten;
auftrag.Save();
GetInventurCSV(sender, auftrag.AuftragID);
UCInventur_Update();
}
auftrag.Status = AuftragStatus.Herrichten;
auftrag.Save();
GetInventurCSV(sender, auftrag.AuftragID);
UCInventur_Update();
}
/// <summary>
@ -396,10 +388,12 @@ namespace Deckungsbeitrag.UserControls
/// <param name="e"></param>
private void PictureBoxClose_Click(object sender, EventArgs e)
{
if (Tosave) if (MessageBox.Show("Du hast die Zahlen geändert. Möchtest du die Inventur so speichern?", "INVENTUR SPEICHERN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ButtonSpeichern_Click("Speichern", null);
if (Tosave) if (MessageBox.Show("Du hast die Zahlen geändert. Möchtest du die Inventur so speichern?", "INVENTUR SPEICHERN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ButtonSpeichern_Click(this.buttonSpeichern, null);
if (groupBoxInventur.Visible)
{
this.buttonFreigeben.Visible = false;
this.buttonSpeichern.Visible = false;
this.labelInvText.Text = groupBoxInventur.Text;
this.groupBoxInventur.Visible = false;
this.labelInvText.Visible = true;
@ -451,6 +445,7 @@ namespace Deckungsbeitrag.UserControls
this.dTPInvDatum.Location = new Point(x += labelInvDat.Width, this.pictureBoxPlus.Location.Y);
this.labelLieferDat.Location = new Point(x = x + dTPInvDatum.Width + 10, label_y);
this.dTPLieferDat.Location = new Point(x + labelLieferDat.Width, this.pictureBoxPlus.Location.Y);
this.buttonSpeichern.Location = new Point(buttonFreigeben.Left - buttonSpeichern.Width - buttonSpeichern.Margin.Left, buttonSpeichern.Top);
if (Sender is FormAuftragDetail) SizeChangedForParent?.Invoke();
}
@ -466,6 +461,8 @@ namespace Deckungsbeitrag.UserControls
uci_loc = this.Location;
DataGridView_GetNewSize(this.dGArtikel);
this.buttonFreigeben.Visible = true;
this.buttonSpeichern.Visible = true;
groupBoxInventur.Visible = true;
this.labelInvText.Visible = false;
}
}
@ -485,11 +482,15 @@ namespace Deckungsbeitrag.UserControls
iststand += int.TryParse(row.Cells[j].Value.ToString(), out int r) ? r : 0;
}
if (e.ColumnIndex >= 7 || e.ColumnIndex == 2)
if (e.ColumnIndex >= 7)
{
row.Cells[5].Value = sollstand - fehlmenge - iststand;
row.Cells[6].Value = artikelListe[e.RowIndex].Korrektur = sollstand - iststand;
}
if (e.ColumnIndex == 2)
{
row.Cells[6].Value = artikelListe[e.RowIndex].Korrektur = sollstand - iststand;
}
}
else return;
dgv.Refresh();
@ -501,11 +502,6 @@ namespace Deckungsbeitrag.UserControls
else Tosave = false;
}
/// <summary>
/// Wird über den buttonFreigeben aufgerufen.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonSpeichern_Click(object sender, EventArgs e)
{
this.dGArtikel.EndEdit(); // beendet aktuelle ZellBearbeitung
@ -547,25 +543,13 @@ namespace Deckungsbeitrag.UserControls
}
}
/// <summary>
/// Wenn lines existieren (CSV-Datei) dann wird das Speichern der Änderungen abgefragt.
/// Wenn lines nicht existieren (Neue Inventur) wird die Inventur verworfen.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonAbbrechen_Click(object sender, EventArgs e)
{
if (lines == null)
{
if (Tosave) { if (MessageBox.Show("Möchtest du wirklich Abbrechen und die Inventur verwerfen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) UCInventur_Delete(); }
else UCInventur_Delete();
}
else
{
PictureBoxClose_Click(this.pictureBoxClose, null);
}
if (Tosave) { if (MessageBox.Show("Möchtest du wirklich Abbrechen und die Inventur verwerfen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) UCInventur_Delete(); }
else UCInventur_Delete();
}
}
}
//CHANGES: Es wird jetzt nur ein Button "Speichern/Freigeben" bereitgestellt und dort dann gefragt ob speichern oder freigeben. Hier wird auch zwischen den Rollen unterschieden.
//CHANGES: Beim nachträglichen Ändern des Standes wird jetzt die Schwund-Spalte neu berechnet. Damit sollte die Berechnung wieder stimmen.
//DONE: CLick auf Inventur freigeben Dateiname von "Warten" auf "Herrichten" ändern.
//DONE: Inventur freigeben nur für Admin oder Verwaltung.
//DONE: Inventur für Expedit zugänglich machen.

View File

@ -173,25 +173,4 @@
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -35,21 +35,7 @@ namespace Deckungsbeitrag.UserControls
{
ReadCSV();
GetTouren();
}
private void GetTouren()
{
Saison saison = Saison.GetAktivSaison();
foreach (string t in touren)
{
Tour tour = Tour.GetTour(saison.SaisonId, t) ?? new Tour
{
SaisonID = saison.SaisonId,
Bezeichnung = t
};
tour.Save();
}
}
/// <summary>
@ -61,6 +47,7 @@ namespace Deckungsbeitrag.UserControls
string dateiName = "Tourenplan_Aktuell.csv";
string row;
string[] rows;
try
{

View File

@ -23,7 +23,7 @@ public class UserSettingsManager
public Point LocationGroupBoxContainer { get; set; } = new Point(0, 0);
public Point LocationButtonNeuerUser { get; set; } = new Point(0, 0);
public Point LocationButtonNeuerAuftrag { get; set; } = new Point(0, 0);
public Point LocationButtonSonderAuftrag { get; set; } = new Point(0, 0);
public Point LocationButtonNeueInventur { get; set; } = new Point(0, 0);
public Point LocationButtonNeuerStand { get; set; } = new Point(0, 0);
public Point LocationButtonNeueAufgabe { get; set; } = new Point(0, 0);
public Byte[] OLV_State { get; set; }
@ -67,7 +67,7 @@ public class UserSettingsManager
LocationGroupBoxContainer = loadedSettings.LocationGroupBoxContainer;
LocationButtonNeuerUser = loadedSettings.LocationButtonNeuerUser;
LocationButtonNeuerAuftrag = loadedSettings.LocationButtonNeuerAuftrag;
LocationButtonSonderAuftrag = loadedSettings.LocationButtonSonderAuftrag;
LocationButtonNeueInventur = loadedSettings.LocationButtonNeueInventur;
LocationButtonNeuerStand = loadedSettings.LocationButtonNeuerStand;
LocationButtonNeueAufgabe = loadedSettings.LocationButtonNeueAufgabe;

View File

@ -157,12 +157,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AA-Forms\CustomMessageBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AA-Forms\CustomMessageBox.Designer.cs">
<DependentUpon>CustomMessageBox.cs</DependentUpon>
</Compile>
<Compile Include="AA-Forms\FehlmengeChart.cs">
<SubType>Form</SubType>
</Compile>

View File

@ -1,70 +1,88 @@
=====================================
NEUIGKEITEN - Version 1.0.9.7
NEUIGKEITEN - Version 1.0.9.4
=====================================
Build-Info:
- Build-Typ: Release Build
- Erledigte TODOs: 6
- Offene TODOs: 24
- Install-Reminders: 1
- Changes: 28
=== ✨ CHANGES (28) ===
## ArtikelVW.cs ##
- ✨ Reklamation als Spalte hinzugefügt und Anzeigen implementiert. Sowohl bei KundeArtikel als auch bei NW_Artikel.
## AuftragDetail.cs ##
- ✨ 1. Es wird ab sofort nur ein Button zum Speichern und Abschließen bereitgestellt. System entscheidet was getan wird.
- ✨ 2. Änderungen werden nur gespeichert wenn ein Etikett gedruckt wurde.
- ✨ 3. Abschließen nur möglich wenn alle Artikel auf 0 sind (Checked) und gespeichert wurde.
- ✨ Bei Druckabbruch wird die geänderte Zahl NICHT zurückgesetzt. (Das muss händisch erfolgen)
- ✨ Wenn die reduzierte Anzahl bei SOLL-Verminderung nicht negativ ist, wird diese negativ gemacht. So wird ein möglicher Fehler ausgebessert.
- ✨ Wenn die Zahlen zurückgesetzt werden sollen, muss AuftragDetail geschlossen werden.
## Expedit.cs ##
- ✨ Im Tab Rampe wird bei DoppelClick der Auftrag als gewaschen markiert und im Tab Aufträge heute sichtbar.
- ✨ Im Tab Vorbereitet wird beim Ändern der sauberen Containeranzahl gefragt ob die Etiketten neu gedruckt werden sollen.
- ✨ NumericUpDown markiert automatisch den Inhalt. Erleichtert die Eingabe.
- ✨ Wenn ein anderer Fahrer ausgewählt wird, wird auch die Priority laut dem Fahrer geändert.
- ✨ Wenn Expedit NeuerAuftrag aufruft wird gefragt welcher Auftrag gewünscht ist. Geschäftkunde = Geschäft (Notwendig bis ausschließlich Fahrer die Standardaufträge erstellen)
## Main.cs ##
- ✨ Artikelliste und Kundenliste werden automatisch importiert wenn vorhanden.
- ✨ Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren.
## NeuerAuftrag.cs ##
- ✨ Auftrag LAUFZETTEL (ehem. Einmalig) läuft als Sonderauftrag also Tab-Sonderaufträge.
- ✨ Der Text des LAUFZETTELS wird bei Expedit im InfoFeld angezeigt.
- ✨ DropDownWidth wird an das größte Item angepasst.
- ✨ Es kann ab jetzt Morgen als Liefertag gewählt werden.
## Tourenplanung.cs ##
- ✨ Es kann nach der Kontrolle der Lieferrhythmus geändert werden. Dazu muss auch die Anzahl der Liefertage gewählt werden.
- ✨ Es können nur so viele Clone erstellt werden wie Liefertag im Lieferrhythmus hinterlegt sind.
- ✨ Es wir kontrolliert ob der gewählte Liefertag zum hinterlegten Lieferrhythmus passt.
- ✨ TabText wird mit Benutzerliste verglichen. Wenn ein passender gefunden wird Tag hinterlegt.
## UCInventur.cs ##
- ✨ Beim nachträglichen Ändern des Standes wird jetzt die Schwund-Spalte neu berechnet. Damit sollte die Berechnung wieder stimmen.
- ✨ Es wird jetzt nur ein Button "Speichern/Freigeben" bereitgestellt und dort dann gefragt ob speichern oder freigeben. Hier wird auch zwischen den Rollen unterschieden.
## UCTabPageLKW.cs ##
- ✨ Innerhalb eines Tages kann die Reihenfolge angepasst werden.
- ✨ Lieferrhythmen können angepasst und übernommen werden.
- ✨ Speichern und Laden wurde angepasst, JSON enthält jetzt pro Tag eine Kundenliste.
- ✨ Wenn der Lieferrhythmus geändert wird, werden KundenControls an falschen Tagen gelöscht.
- Erledigte TODOs: 15
- Offene TODOs: 31
- Install-Reminders: 2
- Changes: 16
=== ⚙️ INSTALL-REMINDER (1) ===
=== ⚙️ INSTALL-REMINDER (2) ===
- ⚙️ DB anpassen. (Priority in Auftrag etc.) [Auftrag.cs]
- ⚙️ Tabelle Tour in Datenbank einfügen [Tour.cs]
Installation: 24.04.2026 17:10
=== ✨ CHANGES (16) ===
- ✨ Artikelliste und Kundenliste werden automatisch importiert wenn vorhanden. [FormMain.cs]
- ✨ Class Tour wurde erstellt. Speichern, Laden und Bearbeiten von Touren sollte möglich sein. [Tour.cs]
- ✨ Es kann nach der Kontrolle der Lieferrhythmus geändert werden. Dazu muss auch die Anzahl der Liefertage gewählt werden. [FormTourenplanung.cs]
- ✨ Es können nur so viele Clone erstellt werden wie Liefertag im Lieferrhythmus hinterlegt sind. [FormTourenplanung.cs]
- ✨ Es wir kontrolliert ob der gewählte Liefertag zum hinterlegten Lieferrhythmus passt. [FormTourenplanung.cs]
- ✨ Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren. [FormMain.cs]
- ✨ Im Tab Rampe wird bei DoppelClick der Auftrag als gewaschen markiert und im Tab Aufträge heute sichtbar. [FormExpedit.cs]
- ✨ Im Tab Vorbereitet wird beim Ändern der sauberen Containeranzahl gefragt ob die Etiketten neu gedruckt werden sollen. [FormExpedit.cs]
- ✨ Innerhalb eines Tages kann die Reihenfolge angepasst werden. [UCTabPageLKW.cs]
- ✨ Lieferrhythmen können angepasst und übernommen werden. [UCTabPageLKW.cs]
- ✨ NumericUpDown markiert automatisch den Inhalt. Erleichtert die Eingabe. [FormExpedit.cs]
- ✨ Reklamation als Spalte hinzugefügt und Anzeigen implementiert. Sowohl bei KundeArtikel als auch bei NW_Artikel. [FormArtikelVW.cs]
- ✨ Speichern und Laden wurde angepasst, JSON enthält jetzt pro Tag eine Kundenliste. [UCTabPageLKW.cs]
- ✨ TabText wird mit Benutzerliste verglichen. Wenn ein passender gefunden wird Tag hinterlegt. [FormTourenplanung.cs]
- ✨ Wenn der Lieferrhythmus geändert wird, werden KundenControls an falschen Tagen gelöscht. [UCTabPageLKW.cs]
- ✨ Wenn ein anderer Fahrer ausgewählt wird, wird auch die Priority laut dem Fahrer geändert. [FormExpedit.cs]
=== ✅ ERLEDIGTE TODOs (15) ===
- ✅ : Bei Transport wir ein Fach mit Aktuellem Auftrag erstellt. Das Alte wird bei Transport gespeichert. [FormAusschlager.cs]
- ✅ : CLick auf Inventur freigeben Dateiname von "Warten" auf "Herrichten" ändern. [UCInventur.cs]
- ✅ : ComboBox Fahrer und Priorität implementieren [FormAuftragDetail.cs]
- ✅ : Container schmutzig bearbeitbar machen [FormAuftragDetail.cs]
- ✅ : Feedback Button hinzufügen [FormAuftragDetail.cs]
- ✅ : Inventur freigeben nur für Admin oder Verwaltung. [UCInventur.cs]
- ✅ : Inventur für Expedit zugänglich machen. [UCInventur.cs]
- ✅ : JSON nach angemeldeten Fahrer durchsuchen und Kundenliste des aktuellen Wochentag anzeigen. [FormMain.cs]
- ✅ : Korrigiere Bestand: Wenn -Zahl dann Stand - Zahl. [FormAuftragDetail.cs]
- ✅ : Mit AddFehler können Fehler aus try/chatch in Obsidian eingefügt werden. (Timestamp, PC-Name, Ex-Message) [Program.cs]
- ✅ : Speichern etc. durchgehen und adaptieren [FormAuftragDetail.cs]
- ✅ : Wenn Fahrer neuen Auftrag erstellt, wird Tour (BenutzerID & Liefertag) gesucht und gespeichert oder upgedatet. Dabei werden die Containerzahlen schmutzig addiert und die Kundenanzahl um 1 erhöht. [Tour.cs]
- ✅ : Wenn Frottee-Expedit auch Reklamation bearbeitet, muss BenutzerRolle abgefragt werden. siehe CHANGES. [FormFehlmengeCount.cs]
- ✅ : Wenn NeuerAuftrag gewählt Fach ändern nicht vergessen. [FormAusschlager.cs]
- ✅ : Wenn NeuerAuftrag gewählt wie gehts weiter? [FormAusschlager.cs]
=== 🔄 OFFENE TODOs (31) ===
- 🔄 !!ÜBERLEGE!! DB-Query für Kundenanzahl und Containeranzahl Abgleich. (Aufträge haben TourID hinterlegt. So sollte alles vergleichbar sein.) [Tour.cs]
- 🔄 !!ÜBERLEGE!! Tour Start und Ende automatisch erfassen. (Beladenscan und Entladescan?) [Tour.cs]
- 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [FormMain.cs]
- 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [UCAuftragListe.cs]
- 🔄 Auftrag richtig speichern... mit gedruckt bzw. erledigt bzw. [FormExpedit.cs]
- 🔄 Auftragauswahl aufrufen statt NeuerAuftrag. (Wenn Fahrer Aufträge erstellen) [FormWSVerfolgung.cs]
- 🔄 Aufträge zusammenführen wenn gleicher Kunde und Liefertag. [FormNeuerAuftrag.cs]
- 🔄 Ausprobieren ob die Ausrichtung jetzt richtig ist. Sowohl beim ersten wie auch zweiten Mal. [Funktionen.cs]
- 🔄 Bestand von allen Artikeln speichern und für Druck vorbereiten. [FormAuftragDetail.cs]
- 🔄 Dateinamen aus Tikos anschauen. Eventuell Datum von letztem Import über Dateiname wählen? [FormMain.cs]
- 🔄 Deaktivieren wenn SPS funktioniert. Transport wird simuliert. [FormWSVerfolgung.cs]
- 🔄 Design des Controls anpassen. Eventuell im Designer erstellen. [UCKunde.cs]
- 🔄 Einbinden der NachwaescheArtikelData... [FormArtikelVW.cs]
- 🔄 Eingabemöglichkeit von Tour Start und Ende muss erledigt werden. [Tour.cs]
- 🔄 Erstellen von SonderAuftrag und Drucken von Etikett testen. [FormAuftragDetail.cs]
- 🔄 Eventuell die Zahlen in CSV speichern und von dort für Druck verwenden?! [FormAuftragDetail.cs]
- 🔄 Funktioniert mehrere KundenControls auf einmal DragDrop? [FormTourenplanung.cs]
- 🔄 Gesamt soll immer 100% sein. [Funktionen.cs]
- 🔄 Hier Settings speichern mit UserSettingsManager Klasse. [FormEinstellung.cs]
- 🔄 Kundenanzahl bei Tourenliste erstellen vergleichen und anpassen. [Tour.cs]
- 🔄 Nach Test und Rücksprache eventuell wieder umbauen. Benutzer.Rolle etc. [FormFehlmengeCount.cs]
- 🔄 nicht ganze Aufträge holen sondern nur die Zahlen? [FormMain.cs]
- 🔄 Non-Hard-Coded-Lösung für Priority finden. [Auftrag.cs]
- 🔄 Reg.Aufträge einbauen. Besonderheit: Die Artikel sollen ebenfalls erscheinen. [Funktionen.cs]
- 🔄 Settings hier ändern auf UserSettingsManager Klasse. [FormEinstellung.cs]
- 🔄 TourenListe Entwurf muss überarbeitet werden. [FormNeuerAuftrag.cs]
- 🔄 UserSetting Properties eintragen und in EinstellungsScreen abrufen. [UserSettingsManager.cs]
- 🔄 Warum der falsche Path? Immer mit \\ [UCFeedback.cs]
- 🔄 Weitere Properties von oben hier zuweisen [UserSettingsManager.cs]
- 🔄 Wenn Auftrag abgeschlossen wird muss die Containerzahl sauber addiert werden. Kundenanzahl und Containeranzahl schmutzig darf nicht erhöht werden. [Tour.cs]
- 🔄 Zuweisung zu Fahrer muss geklärt werden. [Funktionen.cs]
Installation: 21.04.2026 14:34
=====================================