Compare commits

..

12 Commits

36 changed files with 1225 additions and 1147 deletions

39
AA-Forms/CustomMessageBox.Designer.cs generated Normal file
View File

@ -0,0 +1,39 @@
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

@ -0,0 +1,20 @@
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.Dock = System.Windows.Forms.DockStyle.Fill;
this.tLPAuftrag.ForeColor = System.Drawing.Color.Black; this.tLPAuftrag.ForeColor = System.Drawing.Color.Black;
this.tLPAuftrag.Location = new System.Drawing.Point(0, 0); this.tLPAuftrag.Location = new System.Drawing.Point(0, 0);
this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4);
this.tLPAuftrag.Name = "tLPAuftrag"; this.tLPAuftrag.Name = "tLPAuftrag";
this.tLPAuftrag.RowCount = 4; this.tLPAuftrag.RowCount = 4;
this.tLPAuftrag.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F)); 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.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T5.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T5.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T5.Location = new System.Drawing.Point(1108, 66); this.fLP_T5.Location = new System.Drawing.Point(1108, 66);
this.fLP_T5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.fLP_T5.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T5.Name = "fLP_T5"; this.fLP_T5.Name = "fLP_T5";
this.fLP_T5.Size = new System.Drawing.Size(271, 551); this.fLP_T5.Size = new System.Drawing.Size(271, 551);
this.fLP_T5.TabIndex = 19; this.fLP_T5.TabIndex = 19;
@ -195,7 +195,7 @@
this.fLP_T4.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T4.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T4.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T4.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T4.Location = new System.Drawing.Point(832, 66); this.fLP_T4.Location = new System.Drawing.Point(832, 66);
this.fLP_T4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.fLP_T4.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T4.Name = "fLP_T4"; this.fLP_T4.Name = "fLP_T4";
this.fLP_T4.Size = new System.Drawing.Size(268, 551); this.fLP_T4.Size = new System.Drawing.Size(268, 551);
this.fLP_T4.TabIndex = 18; this.fLP_T4.TabIndex = 18;
@ -208,7 +208,7 @@
this.fLP_T3.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T3.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T3.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T3.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T3.Location = new System.Drawing.Point(556, 66); this.fLP_T3.Location = new System.Drawing.Point(556, 66);
this.fLP_T3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.fLP_T3.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T3.Name = "fLP_T3"; this.fLP_T3.Name = "fLP_T3";
this.fLP_T3.Size = new System.Drawing.Size(268, 551); this.fLP_T3.Size = new System.Drawing.Size(268, 551);
this.fLP_T3.TabIndex = 17; this.fLP_T3.TabIndex = 17;
@ -221,7 +221,7 @@
this.fLP_T2.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T2.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T2.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T2.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T2.Location = new System.Drawing.Point(280, 66); this.fLP_T2.Location = new System.Drawing.Point(280, 66);
this.fLP_T2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.fLP_T2.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T2.Name = "fLP_T2"; this.fLP_T2.Name = "fLP_T2";
this.fLP_T2.Size = new System.Drawing.Size(268, 551); this.fLP_T2.Size = new System.Drawing.Size(268, 551);
this.fLP_T2.TabIndex = 16; this.fLP_T2.TabIndex = 16;
@ -309,7 +309,7 @@
this.fLP_T1.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T1.BackColor = System.Drawing.SystemColors.ControlLight;
this.fLP_T1.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T1.Dock = System.Windows.Forms.DockStyle.Fill;
this.fLP_T1.Location = new System.Drawing.Point(4, 66); this.fLP_T1.Location = new System.Drawing.Point(4, 66);
this.fLP_T1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.fLP_T1.Margin = new System.Windows.Forms.Padding(4);
this.fLP_T1.Name = "fLP_T1"; this.fLP_T1.Name = "fLP_T1";
this.fLP_T1.Size = new System.Drawing.Size(268, 551); this.fLP_T1.Size = new System.Drawing.Size(268, 551);
this.fLP_T1.TabIndex = 15; this.fLP_T1.TabIndex = 15;
@ -320,7 +320,7 @@
this.textBoxScan.Dock = System.Windows.Forms.DockStyle.Fill; 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.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.Location = new System.Drawing.Point(4, 687);
this.textBoxScan.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.textBoxScan.Margin = new System.Windows.Forms.Padding(4);
this.textBoxScan.Name = "textBoxScan"; this.textBoxScan.Name = "textBoxScan";
this.textBoxScan.Size = new System.Drawing.Size(268, 46); this.textBoxScan.Size = new System.Drawing.Size(268, 46);
this.textBoxScan.TabIndex = 25; this.textBoxScan.TabIndex = 25;

View File

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

View File

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

View File

@ -39,9 +39,6 @@
this.buttonSWS_Drucken = new System.Windows.Forms.Button(); this.buttonSWS_Drucken = new System.Windows.Forms.Button();
this.chartFehlmenge = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.chartFehlmenge = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.groupBoxKndInfo = new System.Windows.Forms.GroupBox(); 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.buttonTourenListe = new System.Windows.Forms.Button();
this.buttonStats = new System.Windows.Forms.Button(); this.buttonStats = new System.Windows.Forms.Button();
this.buttonEinstellung = new System.Windows.Forms.Button(); this.buttonEinstellung = new System.Windows.Forms.Button();
@ -57,9 +54,12 @@
this.tabPageVorbereitet = new System.Windows.Forms.TabPage(); this.tabPageVorbereitet = new System.Windows.Forms.TabPage();
this.objectListViewVorbereitet = new BrightIdeasSoftware.ObjectListView(); this.objectListViewVorbereitet = new BrightIdeasSoftware.ObjectListView();
this.buttonNW = new System.Windows.Forms.Button(); 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(); ((System.ComponentModel.ISupportInitialize)(this.chartFehlmenge)).BeginInit();
this.groupBoxKndInfo.SuspendLayout(); this.groupBoxKndInfo.SuspendLayout();
this.tableLayoutPanelInfo.SuspendLayout();
this.tabPageRampe.SuspendLayout(); this.tabPageRampe.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).BeginInit();
this.tabPageSonder.SuspendLayout(); this.tabPageSonder.SuspendLayout();
@ -71,6 +71,7 @@
this.tabControlAuftragList.SuspendLayout(); this.tabControlAuftragList.SuspendLayout();
this.tabPageVorbereitet.SuspendLayout(); this.tabPageVorbereitet.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).BeginInit();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// buttonNeuerAuftrag // buttonNeuerAuftrag
@ -173,7 +174,7 @@
// groupBoxKndInfo // groupBoxKndInfo
// //
this.groupBoxKndInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxKndInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxKndInfo.Controls.Add(this.tableLayoutPanelInfo); this.groupBoxKndInfo.Controls.Add(this.flowLayoutPanel1);
this.groupBoxKndInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 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.ForeColor = System.Drawing.Color.Red;
this.groupBoxKndInfo.Location = new System.Drawing.Point(916, 452); this.groupBoxKndInfo.Location = new System.Drawing.Point(916, 452);
@ -186,42 +187,6 @@
this.groupBoxKndInfo.VisibleChanged += new System.EventHandler(this.GroupBoxKndInfo_VisibleChanged); this.groupBoxKndInfo.VisibleChanged += new System.EventHandler(this.GroupBoxKndInfo_VisibleChanged);
this.groupBoxKndInfo.Paint += new System.Windows.Forms.PaintEventHandler(this.GroupBoxKndInfo_Paint); 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 // buttonTourenListe
// //
this.buttonTourenListe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonTourenListe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -516,6 +481,49 @@
this.buttonNW.UseVisualStyleBackColor = true; this.buttonNW.UseVisualStyleBackColor = true;
this.buttonNW.Click += new System.EventHandler(this.ButtonNW_Click); 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 // FormExpedit
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -547,8 +555,6 @@
this.Resize += new System.EventHandler(this.FormExpedit_Resize); this.Resize += new System.EventHandler(this.FormExpedit_Resize);
((System.ComponentModel.ISupportInitialize)(this.chartFehlmenge)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartFehlmenge)).EndInit();
this.groupBoxKndInfo.ResumeLayout(false); this.groupBoxKndInfo.ResumeLayout(false);
this.tableLayoutPanelInfo.ResumeLayout(false);
this.tableLayoutPanelInfo.PerformLayout();
this.tabPageRampe.ResumeLayout(false); this.tabPageRampe.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.objectListViewRampe)).EndInit();
this.tabPageSonder.ResumeLayout(false); this.tabPageSonder.ResumeLayout(false);
@ -560,6 +566,8 @@
this.tabControlAuftragList.ResumeLayout(false); this.tabControlAuftragList.ResumeLayout(false);
this.tabPageVorbereitet.ResumeLayout(false); this.tabPageVorbereitet.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.objectListViewVorbereitet)).EndInit();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -573,9 +581,6 @@
private System.Windows.Forms.Button buttonReklamation; private System.Windows.Forms.Button buttonReklamation;
private System.Windows.Forms.DataVisualization.Charting.Chart chartFehlmenge; private System.Windows.Forms.DataVisualization.Charting.Chart chartFehlmenge;
private System.Windows.Forms.GroupBox groupBoxKndInfo; 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.Button buttonTourenListe;
private System.Windows.Forms.TabPage tabPageRampe; private System.Windows.Forms.TabPage tabPageRampe;
private BrightIdeasSoftware.ObjectListView objectListViewRampe; private BrightIdeasSoftware.ObjectListView objectListViewRampe;
@ -589,5 +594,9 @@
private System.Windows.Forms.TabPage tabPageVorbereitet; private System.Windows.Forms.TabPage tabPageVorbereitet;
private BrightIdeasSoftware.ObjectListView objectListViewVorbereitet; private BrightIdeasSoftware.ObjectListView objectListViewVorbereitet;
private System.Windows.Forms.Button buttonNW; 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,7 +161,23 @@ namespace Deckungsbeitrag
#region Button_Click-Events #region Button_Click-Events
private async void ButtonNeuerAuftrag_Click(object sender, EventArgs e) private async void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{ {
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(benutzer, this.letzterLiefertag, AuftragTyp.Standart); 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);
if (neuerAuftrag.ShowDialog() == DialogResult.OK) if (neuerAuftrag.ShowDialog() == DialogResult.OK)
{ {
this.letzterLiefertag = neuerAuftrag.letzterLiefertag; this.letzterLiefertag = neuerAuftrag.letzterLiefertag;
@ -355,7 +371,6 @@ namespace Deckungsbeitrag
dirtCol.ShowTextInHeader = false; dirtCol.ShowTextInHeader = false;
dirtCol.MinimumWidth = dirtCol.MaximumWidth = 80; dirtCol.MinimumWidth = dirtCol.MaximumWidth = 80;
} }
var cleanCol = Find("Sauber"); var cleanCol = Find("Sauber");
if (cleanCol != null) if (cleanCol != null)
{ {
@ -386,6 +401,12 @@ namespace Deckungsbeitrag
fertigCol.MinimumWidth = fertigCol.MaximumWidth = 80; 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) private void Olv_CellToolTipShowing(object sender, ToolTipShowingEventArgs e)
{ {
@ -491,9 +512,15 @@ namespace Deckungsbeitrag
labelAufgabe.Visible = true; labelAufgabe.Visible = true;
} }
else { labelAufgabe.Visible = false; } else { labelAufgabe.Visible = false; }
if (auftrag.ZusatzInfo != null)
{
labelZusatz.Text = auftrag.ZusatzInfo;
labelZusatz.Visible = true;
}
else { labelZusatz.Visible = false; }
// GroupBox einblenden wenn notwendig. // GroupBox einblenden wenn notwendig.
if (labelAufgabe.Visible || labelAnmerkung.Visible || chartFehlmenge.Visible) this.groupBoxKndInfo.Visible = true; if (labelAufgabe.Visible || labelAnmerkung.Visible || chartFehlmenge.Visible || labelZusatz.Visible) this.groupBoxKndInfo.Visible = true;
else this.groupBoxKndInfo.Visible = false; else this.groupBoxKndInfo.Visible = false;
} }
@ -560,7 +587,7 @@ namespace Deckungsbeitrag
} }
break; break;
default: default:
if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.Standerhöhung || _auftrag.Typ == AuftragTyp.Standverminderung || _auftrag.Typ == AuftragTyp.Inventur) if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.SOLL_Erhoehung || _auftrag.Typ == AuftragTyp.SOLL_Verminderung || _auftrag.Typ == AuftragTyp.Inventur)
{ {
FormAuftragDetail auftragDetail = new FormAuftragDetail(_auftrag, this.benutzer); FormAuftragDetail auftragDetail = new FormAuftragDetail(_auftrag, this.benutzer);
if (auftragDetail.ShowDialog() == DialogResult.OK) if (auftragDetail.ShowDialog() == DialogResult.OK)
@ -916,12 +943,12 @@ namespace Deckungsbeitrag
} }
} }
break; break;
case var t when t == "Fahrer": case var t when t == "Tour":
{ { //TODO: Mit Tour statt Fahrer durchgehen.
if (e.NewValue != null) if (e.NewValue != null)
{ {
this.auftrag.ArbeiterID = ((Benutzer)e.NewValue).BenutzerID; this.auftrag.TourID = ((Tour)e.NewValue).TourID;
this.auftrag.Priority = Funktionen.GetPriority((Benutzer)e.NewValue); this.auftrag.Priority = ((Tour)e.NewValue).Priority;
} }
} }
break; break;
@ -959,19 +986,24 @@ namespace Deckungsbeitrag
e.Cancel = true; e.Cancel = true;
return; 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 == "Fahrer") 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")
{ {
List<Benutzer> list = Benutzer.GetFahrerList(); Saison saison = Saison.GetAktivSaison();
ComboBox fahrer = new ComboBox 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
{ {
Bounds = e.CellBounds, Bounds = e.CellBounds,
DropDownStyle = ComboBoxStyle.DropDownList, DropDownStyle = ComboBoxStyle.DropDownList,
DisplayMember = "BenutzerName", DisplayMember = "Bezeichnung",
DataSource = list DataSource = list,
}; };
e.Control = fahrer; e.Control = touren;
} }
if (e.Control is NumericUpDown num) num.Select(0, int.MaxValue); if (e.Control is NumericUpDown num) num.Select(0, int.MaxValue);
} }
@ -1062,14 +1094,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.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.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); 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.Einmalig, minTypFilter: AuftragTyp.Inventur); 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.Rampenliste) listRampe = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Abgeholt, typFilter: AuftragTyp.Standart); if (liste == null || liste == ListenArt.Rampenliste) listRampe = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Abgeholt, typFilter: AuftragTyp.Standart);
} }
else 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.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.Einmalig, 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.Laufzettel, minTypFilter: AuftragTyp.Inventur, frottee: true);
} }
} }
@ -1303,3 +1335,4 @@ namespace Deckungsbeitrag
//CHANGES: Im Tab Rampe wird bei DoppelClick der Auftrag als gewaschen markiert und im Tab Aufträge heute sichtbar. //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: 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: 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)

View File

@ -363,6 +363,11 @@ namespace Deckungsbeitrag
} }
int buttons = flowPanel.Controls.OfType<Button>().Count(); 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) // 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)); Size btnsize = new Size((int)((double)flowPanel.ClientSize.Width / ((double)buttons / (double)2)), (flowPanel.ClientSize.Height / 2) - (flowPanel.Margin.All * 3));

View File

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

View File

@ -59,10 +59,11 @@ namespace Deckungsbeitrag
this.listViewKunde.HideSelection = false; this.listViewKunde.HideSelection = false;
this.listViewKunde.HotTracking = true; this.listViewKunde.HotTracking = true;
this.listViewKunde.HoverSelection = true; this.listViewKunde.HoverSelection = true;
this.listViewKunde.Location = new System.Drawing.Point(14, 68); this.listViewKunde.Location = new System.Drawing.Point(12, 54);
this.listViewKunde.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.listViewKunde.MultiSelect = false; this.listViewKunde.MultiSelect = false;
this.listViewKunde.Name = "listViewKunde"; this.listViewKunde.Name = "listViewKunde";
this.listViewKunde.Size = new System.Drawing.Size(592, 715); this.listViewKunde.Size = new System.Drawing.Size(527, 573);
this.listViewKunde.TabIndex = 1; this.listViewKunde.TabIndex = 1;
this.listViewKunde.UseCompatibleStateImageBehavior = false; this.listViewKunde.UseCompatibleStateImageBehavior = false;
this.listViewKunde.View = System.Windows.Forms.View.Details; this.listViewKunde.View = System.Windows.Forms.View.Details;
@ -90,11 +91,13 @@ 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.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.ForeColor = System.Drawing.Color.Silver;
this.textBoxKunde.Location = new System.Drawing.Point(14, 20); this.textBoxKunde.Location = new System.Drawing.Point(12, 16);
this.textBoxKunde.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxKunde.Name = "textBoxKunde"; this.textBoxKunde.Name = "textBoxKunde";
this.textBoxKunde.Size = new System.Drawing.Size(178, 35); this.textBoxKunde.Size = new System.Drawing.Size(159, 30);
this.textBoxKunde.TabIndex = 0; this.textBoxKunde.TabIndex = 0;
this.textBoxKunde.Text = "Hier eingeben"; 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.Enter += new System.EventHandler(this.TextBoxKunde_Enter);
this.textBoxKunde.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListViewKunde_KeyDown); this.textBoxKunde.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListViewKunde_KeyDown);
this.textBoxKunde.Leave += new System.EventHandler(this.TextBoxKunde_Leave); this.textBoxKunde.Leave += new System.EventHandler(this.TextBoxKunde_Leave);
@ -103,10 +106,10 @@ namespace Deckungsbeitrag
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White; this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(207, 22); this.label1.Location = new System.Drawing.Point(184, 18);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(369, 40); this.label1.Size = new System.Drawing.Size(304, 32);
this.label1.TabIndex = 2; this.label1.TabIndex = 2;
this.label1.Text = "KundeNr. oder Name eingeben.\r\nKunde nicht vorhanden? Starte die Eingabe mit (?)."; this.label1.Text = "KundeNr. oder Name eingeben.\r\nKunde nicht vorhanden? Starte die Eingabe mit (?).";
// //
@ -118,9 +121,10 @@ namespace Deckungsbeitrag
this.buttonOK.FlatAppearance.BorderSize = 0; this.buttonOK.FlatAppearance.BorderSize = 0;
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 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.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(94, 106); this.buttonOK.Location = new System.Drawing.Point(84, 85);
this.buttonOK.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonOK.Name = "buttonOK"; this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(429, 63); this.buttonOK.Size = new System.Drawing.Size(381, 50);
this.buttonOK.TabIndex = 15; this.buttonOK.TabIndex = 15;
this.buttonOK.Text = "Kunde übernehmen"; this.buttonOK.Text = "Kunde übernehmen";
this.buttonOK.UseVisualStyleBackColor = false; this.buttonOK.UseVisualStyleBackColor = false;
@ -134,9 +138,10 @@ namespace Deckungsbeitrag
this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0; this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0;
this.buttonNeuerAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 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.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(180, 718); this.buttonNeuerAuftrag.Location = new System.Drawing.Point(160, 574);
this.buttonNeuerAuftrag.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonNeuerAuftrag.Name = "buttonNeuerAuftrag"; this.buttonNeuerAuftrag.Name = "buttonNeuerAuftrag";
this.buttonNeuerAuftrag.Size = new System.Drawing.Size(250, 52); this.buttonNeuerAuftrag.Size = new System.Drawing.Size(222, 42);
this.buttonNeuerAuftrag.TabIndex = 16; this.buttonNeuerAuftrag.TabIndex = 16;
this.buttonNeuerAuftrag.Text = "Neuer Auftrag"; this.buttonNeuerAuftrag.Text = "Neuer Auftrag";
this.buttonNeuerAuftrag.UseVisualStyleBackColor = false; this.buttonNeuerAuftrag.UseVisualStyleBackColor = false;
@ -144,10 +149,10 @@ namespace Deckungsbeitrag
// //
// FormListe // FormListe
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.ClientSize = new System.Drawing.Size(620, 802); this.ClientSize = new System.Drawing.Size(551, 642);
this.Controls.Add(this.buttonNeuerAuftrag); this.Controls.Add(this.buttonNeuerAuftrag);
this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonOK);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
@ -155,9 +160,10 @@ namespace Deckungsbeitrag
this.Controls.Add(this.listViewKunde); this.Controls.Add(this.listViewKunde);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(632, 56); this.MinimumSize = new System.Drawing.Size(564, 54);
this.Name = "FormListe"; this.Name = "FormListe";
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 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 knd_col = "KundenNr,Suchtext,KundenName,Ort";
readonly string auf_col = "Aufgabe,Beschreibung"; readonly string auf_col = "Aufgabe,Beschreibung";
readonly string auftrag_col = "Kunde,Liefertag,Container"; readonly string auftrag_col = "Kunde,Liefertag,Container";
private Timer timer; public Timer timer;
private readonly string kndService; private readonly string kndService;
@ -73,12 +73,9 @@ namespace Deckungsbeitrag
private void FormListe_Load(object sender, EventArgs e) private void FormListe_Load(object sender, EventArgs e)
{ {
// Timer für Wartezeit bis TextChanged eintritt. timer = new Timer();
//timer = new Timer timer.Interval = 700; // 0,7 Sekunden
//{ timer.Tick += Timer_Tick;
// Interval = 2000 // 0,7 Sekunden
//};
//timer.Tick += Timer_Tick;
this.buttonOK.Visible = this.buttonOK.Enabled = false; this.buttonOK.Visible = this.buttonOK.Enabled = false;
@ -328,9 +325,6 @@ namespace Deckungsbeitrag
{ {
this.textBoxKunde.ForeColor = Color.Black; this.textBoxKunde.ForeColor = Color.Black;
this.textBoxKunde.Clear(); this.textBoxKunde.Clear();
//GetKeyboard();
} }
private void TextBoxKunde_TextChanged(object sender, EventArgs e) private void TextBoxKunde_TextChanged(object sender, EventArgs e)
{ {

View File

@ -7,6 +7,7 @@ using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -25,7 +26,7 @@ namespace Deckungsbeitrag
public FormLogin() public FormLogin()
{ {
InitializeComponent(); InitializeComponent();
this.Text += Assembly.GetExecutingAssembly().GetName().Version.ToString();
} }
private void buttonAnmelden_Click(object sender, EventArgs e) private void buttonAnmelden_Click(object sender, EventArgs e)
@ -60,7 +61,6 @@ namespace Deckungsbeitrag
break; break;
case -3: case -3:
MessageBox.Show(lex.Message, "Registrieren", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show(lex.Message, "Registrieren", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
if (Program.ShowOnBoarding(string.Empty, onBoardingArt) == DialogResult.Cancel) Application.Exit();
this.buttonRegistrieren.Visible = true; this.buttonRegistrieren.Visible = true;
this.buttonAnmelden.Enabled = false; this.buttonAnmelden.Enabled = false;
this.groupBox1.Height = 146; 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) 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", ""); string eingabe = Interaction.InputBox("Welchen Benutzername möchtest du verwenden?\n\nBenutzername:", "Neuer Benutzername", "");
person.BenutzerName = eingabe; if (!string.IsNullOrWhiteSpace(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); if (person.Save() != 1) MessageBox.Show("Benutzername konnte nicht gespeichert werden. Melde dich bei deinem Vorgesetzten.", "SPEICHERFEHLER", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
this.textBoxBenutzer.Focus(); this.textBoxBenutzer.Focus();

View File

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

View File

@ -48,6 +48,7 @@ namespace Deckungsbeitrag
this.tSBTourenplanung = new System.Windows.Forms.ToolStripButton(); this.tSBTourenplanung = new System.Windows.Forms.ToolStripButton();
this.toolStripBeenden = new System.Windows.Forms.ToolStripButton(); this.toolStripBeenden = new System.Windows.Forms.ToolStripButton();
this.panelMain = new System.Windows.Forms.Panel(); this.panelMain = new System.Windows.Forms.Panel();
this.buttonSonderAuftrag = new System.Windows.Forms.Button();
this.groupBoxAuftrag = new System.Windows.Forms.GroupBox(); this.groupBoxAuftrag = new System.Windows.Forms.GroupBox();
this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView(); this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView();
this.rBAufAbruf = new System.Windows.Forms.RadioButton(); this.rBAufAbruf = new System.Windows.Forms.RadioButton();
@ -57,7 +58,6 @@ namespace Deckungsbeitrag
this.rBAlle = new System.Windows.Forms.RadioButton(); this.rBAlle = new System.Windows.Forms.RadioButton();
this.buttonAufAbruf = new System.Windows.Forms.Button(); this.buttonAufAbruf = new System.Windows.Forms.Button();
this.buttonAusgeliefert = 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.panelProgress = new System.Windows.Forms.Panel();
this.buttonKundeArtikelUpdate = new System.Windows.Forms.Button(); this.buttonKundeArtikelUpdate = new System.Windows.Forms.Button();
this.progressBarKundeArtikelUpdate = new System.Windows.Forms.ProgressBar(); this.progressBarKundeArtikelUpdate = new System.Windows.Forms.ProgressBar();
@ -93,8 +93,6 @@ namespace Deckungsbeitrag
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.groupBoxSaison = new System.Windows.Forms.GroupBox(); this.groupBoxSaison = new System.Windows.Forms.GroupBox();
this.comboBoxSaison = new System.Windows.Forms.ComboBox(); 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.buttonNeueAufgabe = new System.Windows.Forms.Button();
this.buttonNeuerAuftrag = new System.Windows.Forms.Button(); this.buttonNeuerAuftrag = new System.Windows.Forms.Button();
this.buttonNeuerUser = new System.Windows.Forms.Button(); this.buttonNeuerUser = new System.Windows.Forms.Button();
@ -474,14 +472,12 @@ namespace Deckungsbeitrag
// //
this.panelMain.AllowDrop = true; this.panelMain.AllowDrop = true;
this.panelMain.BackColor = System.Drawing.Color.White; this.panelMain.BackColor = System.Drawing.Color.White;
this.panelMain.Controls.Add(this.buttonSonderAuftrag);
this.panelMain.Controls.Add(this.groupBoxAuftrag); this.panelMain.Controls.Add(this.groupBoxAuftrag);
this.panelMain.Controls.Add(this.buttonNeuerRegAuft);
this.panelMain.Controls.Add(this.panelProgress); this.panelMain.Controls.Add(this.panelProgress);
this.panelMain.Controls.Add(this.buttonTourenliste); this.panelMain.Controls.Add(this.buttonTourenliste);
this.panelMain.Controls.Add(this.groupBoxContAnz); this.panelMain.Controls.Add(this.groupBoxContAnz);
this.panelMain.Controls.Add(this.groupBoxSaison); 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.buttonNeueAufgabe);
this.panelMain.Controls.Add(this.buttonNeuerAuftrag); this.panelMain.Controls.Add(this.buttonNeuerAuftrag);
this.panelMain.Controls.Add(this.buttonNeuerUser); this.panelMain.Controls.Add(this.buttonNeuerUser);
@ -496,6 +492,27 @@ namespace Deckungsbeitrag
this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.PanelMain_Paint); this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.PanelMain_Paint);
this.panelMain.Resize += new System.EventHandler(this.PanelMain_Resize); 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 // groupBoxAuftrag
// //
this.groupBoxAuftrag.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupBoxAuftrag.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -546,9 +563,8 @@ namespace Deckungsbeitrag
// rBAufAbruf // rBAufAbruf
// //
this.rBAufAbruf.AutoSize = true; 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.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(59, 167); this.rBAufAbruf.Location = new System.Drawing.Point(13, 167);
this.rBAufAbruf.Margin = new System.Windows.Forms.Padding(4); this.rBAufAbruf.Margin = new System.Windows.Forms.Padding(4);
this.rBAufAbruf.Name = "rBAufAbruf"; this.rBAufAbruf.Name = "rBAufAbruf";
this.rBAufAbruf.Size = new System.Drawing.Size(115, 29); this.rBAufAbruf.Size = new System.Drawing.Size(115, 29);
@ -561,9 +577,8 @@ namespace Deckungsbeitrag
// rBAusgeliefert // rBAusgeliefert
// //
this.rBAusgeliefert.AutoSize = true; 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.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(36, 130); this.rBAusgeliefert.Location = new System.Drawing.Point(13, 130);
this.rBAusgeliefert.Margin = new System.Windows.Forms.Padding(4); this.rBAusgeliefert.Margin = new System.Windows.Forms.Padding(4);
this.rBAusgeliefert.Name = "rBAusgeliefert"; this.rBAusgeliefert.Name = "rBAusgeliefert";
this.rBAusgeliefert.Size = new System.Drawing.Size(136, 29); this.rBAusgeliefert.Size = new System.Drawing.Size(136, 29);
@ -576,9 +591,8 @@ namespace Deckungsbeitrag
// rBFertig // rBFertig
// //
this.rBFertig.AutoSize = true; 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.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(95, 94); this.rBFertig.Location = new System.Drawing.Point(13, 94);
this.rBFertig.Margin = new System.Windows.Forms.Padding(4); this.rBFertig.Margin = new System.Windows.Forms.Padding(4);
this.rBFertig.Name = "rBFertig"; this.rBFertig.Name = "rBFertig";
this.rBFertig.Size = new System.Drawing.Size(82, 29); this.rBFertig.Size = new System.Drawing.Size(82, 29);
@ -591,9 +605,8 @@ namespace Deckungsbeitrag
// rBVorbereitet // rBVorbereitet
// //
this.rBVorbereitet.AutoSize = true; 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.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(44, 57); this.rBVorbereitet.Location = new System.Drawing.Point(13, 57);
this.rBVorbereitet.Margin = new System.Windows.Forms.Padding(4); this.rBVorbereitet.Margin = new System.Windows.Forms.Padding(4);
this.rBVorbereitet.Name = "rBVorbereitet"; this.rBVorbereitet.Name = "rBVorbereitet";
this.rBVorbereitet.Size = new System.Drawing.Size(128, 29); this.rBVorbereitet.Size = new System.Drawing.Size(128, 29);
@ -606,9 +619,8 @@ namespace Deckungsbeitrag
// rBAlle // rBAlle
// //
this.rBAlle.AutoSize = true; 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.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(115, 20); this.rBAlle.Location = new System.Drawing.Point(13, 20);
this.rBAlle.Margin = new System.Windows.Forms.Padding(4); this.rBAlle.Margin = new System.Windows.Forms.Padding(4);
this.rBAlle.Name = "rBAlle"; this.rBAlle.Name = "rBAlle";
this.rBAlle.Size = new System.Drawing.Size(66, 29); this.rBAlle.Size = new System.Drawing.Size(66, 29);
@ -658,27 +670,6 @@ namespace Deckungsbeitrag
this.buttonAusgeliefert.Visible = false; this.buttonAusgeliefert.Visible = false;
this.buttonAusgeliefert.Click += new System.EventHandler(this.ButtonAusgeliefert_Click); 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 // panelProgress
// //
this.panelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.panelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -732,7 +723,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.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.ForeColor = System.Drawing.Color.Black;
this.buttonTourenliste.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.buttonTourenliste.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonTourenliste.Location = new System.Drawing.Point(11, 80); this.buttonTourenliste.Location = new System.Drawing.Point(11, 141);
this.buttonTourenliste.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.buttonTourenliste.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonTourenliste.Name = "buttonTourenliste"; this.buttonTourenliste.Name = "buttonTourenliste";
this.buttonTourenliste.Size = new System.Drawing.Size(333, 50); this.buttonTourenliste.Size = new System.Drawing.Size(333, 50);
@ -1219,48 +1210,6 @@ namespace Deckungsbeitrag
this.comboBoxSaison.TabIndex = 66; this.comboBoxSaison.TabIndex = 66;
this.comboBoxSaison.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSaison_SelectedIndexChanged); 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 // buttonNeueAufgabe
// //
this.buttonNeueAufgabe.BackColor = System.Drawing.Color.DarkOrange; this.buttonNeueAufgabe.BackColor = System.Drawing.Color.DarkOrange;
@ -1271,7 +1220,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.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.ForeColor = System.Drawing.Color.Black;
this.buttonNeueAufgabe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.buttonNeueAufgabe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeueAufgabe.Location = new System.Drawing.Point(11, 206); this.buttonNeueAufgabe.Location = new System.Drawing.Point(11, 265);
this.buttonNeueAufgabe.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.buttonNeueAufgabe.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeueAufgabe.Name = "buttonNeueAufgabe"; this.buttonNeueAufgabe.Name = "buttonNeueAufgabe";
this.buttonNeueAufgabe.Size = new System.Drawing.Size(333, 50); this.buttonNeueAufgabe.Size = new System.Drawing.Size(333, 50);
@ -1313,7 +1262,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.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.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerUser.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.buttonNeuerUser.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerUser.Location = new System.Drawing.Point(11, 143); this.buttonNeuerUser.Location = new System.Drawing.Point(11, 203);
this.buttonNeuerUser.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.buttonNeuerUser.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.buttonNeuerUser.Name = "buttonNeuerUser"; this.buttonNeuerUser.Name = "buttonNeuerUser";
this.buttonNeuerUser.Size = new System.Drawing.Size(333, 50); this.buttonNeuerUser.Size = new System.Drawing.Size(333, 50);
@ -1583,8 +1532,6 @@ namespace Deckungsbeitrag
private System.Windows.Forms.ToolStripButton tSBHilfe; private System.Windows.Forms.ToolStripButton tSBHilfe;
private System.Windows.Forms.Button buttonNeuerUser; private System.Windows.Forms.Button buttonNeuerUser;
private System.Windows.Forms.Button buttonNeueAufgabe; 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.ToolStripButton tSBTourenplanung;
private System.Windows.Forms.ComboBox comboBoxSaison; private System.Windows.Forms.ComboBox comboBoxSaison;
private System.Windows.Forms.GroupBox groupBoxSaison; private System.Windows.Forms.GroupBox groupBoxSaison;
@ -1628,7 +1575,7 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Button buttonKundeArtikelUpdate; private System.Windows.Forms.Button buttonKundeArtikelUpdate;
private System.Windows.Forms.ProgressBar progressBarKundeArtikelUpdate; private System.Windows.Forms.ProgressBar progressBarKundeArtikelUpdate;
private System.Windows.Forms.Panel panelProgress; private System.Windows.Forms.Panel panelProgress;
private System.Windows.Forms.Button buttonNeuerRegAuft; private System.Windows.Forms.Button buttonSonderAuftrag;
} }
} }

View File

@ -55,6 +55,7 @@ namespace Deckungsbeitrag
private UCInventur uCInventur; private UCInventur uCInventur;
private readonly Screen screen = Screen.PrimaryScreen; private readonly Screen screen = Screen.PrimaryScreen;
private Kunde kunde; private Kunde kunde;
private Tour tour;
#endregion #endregion
public FormMain() public FormMain()
{ {
@ -104,6 +105,18 @@ namespace Deckungsbeitrag
GetInventuren(); GetInventuren();
GetSaison(); 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) if (this.groupBoxContAnz.Visible)
{ {
@ -127,6 +140,8 @@ namespace Deckungsbeitrag
private void FormMain_Shown(object sender, EventArgs e) private void FormMain_Shown(object sender, EventArgs e)
{ {
if (this.benutzer.Rolle != BenutzerRolle.Fahrer)
{
// Meldung wenn Updates oder Imports erledigt wurden. // Meldung wenn Updates oder Imports erledigt wurden.
if (Program.Artikelliste_Importiert | Program.Kundenliste_Importiert | Program.Software_Updated) if (Program.Artikelliste_Importiert | Program.Kundenliste_Importiert | Program.Software_Updated)
{ {
@ -136,8 +151,7 @@ namespace Deckungsbeitrag
updates[2] = Program.Software_Updated ? "Software: ✅" : "Sofware: ❌"; 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); 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.ResumeLayout();
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
@ -172,9 +186,8 @@ namespace Deckungsbeitrag
try try
{ {
_settings.LocationButtonNeueAufgabe = this.buttonNeueAufgabe.Location; _settings.LocationButtonNeueAufgabe = this.buttonNeueAufgabe.Location;
_settings.LocationButtonNeueInventur = this.buttonNeueInventur.Location; _settings.LocationButtonSonderAuftrag = this.buttonSonderAuftrag.Location;
_settings.LocationButtonNeuerAuftrag = this.buttonNeuerAuftrag.Location; _settings.LocationButtonNeuerAuftrag = this.buttonNeuerAuftrag.Location;
_settings.LocationButtonNeuerStand = this.buttonNeuerStand.Location;
_settings.LocationButtonNeuerUser = this.buttonNeuerUser.Location; _settings.LocationButtonNeuerUser = this.buttonNeuerUser.Location;
_settings.LocationGroupBoxContainer = this.groupBoxContAnz.Location; _settings.LocationGroupBoxContainer = this.groupBoxContAnz.Location;
@ -194,6 +207,16 @@ namespace Deckungsbeitrag
} }
#endregion #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 #region ToolStripButton-Events
private void Get_Border_Paint(object sender, PaintEventArgs e) private void Get_Border_Paint(object sender, PaintEventArgs e)
@ -341,11 +364,8 @@ namespace Deckungsbeitrag
/// <param name="e"></param> /// <param name="e"></param>
private void ButtonNeuerAuftrag_Click(object sender, EventArgs e) 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); FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standart);
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; ButtonNeueInventur_Click(this.buttonNeueInventur, null); } if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
} }
private void ButtonScannTest_Click(object sender, EventArgs e) private void ButtonScannTest_Click(object sender, EventArgs e)
{ {
@ -358,44 +378,6 @@ namespace Deckungsbeitrag
FormNeueAufgabe neueAufgabe = new FormNeueAufgabe(); FormNeueAufgabe neueAufgabe = new FormNeueAufgabe();
neueAufgabe.ShowDialog(); 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> /// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN /// AUFTRAGSVERWALTUNG FUNKTIONEN
@ -416,7 +398,7 @@ namespace Deckungsbeitrag
++tosave; ++tosave;
Auftrag a = (Auftrag)item.RowObject; Auftrag a = (Auftrag)item.RowObject;
a.ArbeiterID = this.benutzer.BenutzerID;
a.Erledigt = DateTime.Now; a.Erledigt = DateTime.Now;
a.ErledigtVon = this.benutzer.BenutzerID; a.ErledigtVon = this.benutzer.BenutzerID;
a.Status = AuftragStatus.Ausgeliefert; a.Status = AuftragStatus.Ausgeliefert;
@ -441,6 +423,7 @@ namespace Deckungsbeitrag
newAuftrag.Status = AuftragStatus.Herrichten; newAuftrag.Status = AuftragStatus.Herrichten;
newAuftrag.ErstelltVon = (int)this.benutzer.BenutzerID; newAuftrag.ErstelltVon = (int)this.benutzer.BenutzerID;
newAuftrag.Erstellt = DateTime.Now; newAuftrag.Erstellt = DateTime.Now;
newAuftrag.TourID = a.TourID;
// Werte des alten Auftrags zurücksetzen. // Werte des alten Auftrags zurücksetzen.
newAuftrag.Erledigt = null; newAuftrag.Erledigt = null;
@ -544,15 +527,15 @@ namespace Deckungsbeitrag
this.buttonKundeArtikelUpdate.BringToFront(); this.buttonKundeArtikelUpdate.BringToFront();
Application.UseWaitCursor = false; Application.UseWaitCursor = false;
} }
private void ButtonRegAuftrag_Click(object sender, EventArgs e) private void buttonSonderAuftrag_Click(object sender, EventArgs e)
{ {
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Regelmäßig); FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, null);
neuerAuftrag.ShowDialog(); if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
} }
#endregion #endregion
#region Auftrag GroupBox #region GroupBox Auftrag
/// <summary> /// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN /// AUFTRAGSVERWALTUNG FUNKTIONEN
/// RadioButtons für Auftragsverwaltung & Laden der Auftragsliste nach Status. /// RadioButtons für Auftragsverwaltung & Laden der Auftragsliste nach Status.
@ -606,7 +589,8 @@ namespace Deckungsbeitrag
try try
{ {
await conn.OpenAsync(); await conn.OpenAsync();
if (status == null & this.benutzer.Rolle == BenutzerRolle.Fahrer) alist = await Auftrag.GetFahrerListAsync(this.benutzer.BenutzerID, conn); //TODO: Richtige Liste holen, wahrscheinlich mit TourID von ShowTourenplan.
if (status == null & this.benutzer.Rolle == BenutzerRolle.Fahrer) alist = await Auftrag.GetFahrerListAsync(tour.TourID, conn);
else alist = await Auftrag.GetStatusListAsync(status, conn); else alist = await Auftrag.GetStatusListAsync(status, conn);
} }
finally finally
@ -616,7 +600,7 @@ namespace Deckungsbeitrag
conn.Dispose(); conn.Dispose();
} }
if (alist.Count == 0) meldung.KeineAufträge(); if (alist.Count == 0) { meldung.KeineAufträge(); this.groupBoxAuftrag.Visible = false; }
else Load_OLV(alist); // Load_ListView(alist); else Load_OLV(alist); // Load_ListView(alist);
this.objectListViewAuftrag.EndUpdate(); this.objectListViewAuftrag.EndUpdate();
@ -1081,6 +1065,25 @@ namespace Deckungsbeitrag
} }
#endregion #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() private async void GetInventuren()
{ {
foreach (UCInventur uci in panelMain.Controls.OfType<UCInventur>()) foreach (UCInventur uci in panelMain.Controls.OfType<UCInventur>())
@ -1469,6 +1472,7 @@ namespace Deckungsbeitrag
textBox1.Width = (int)size.Width + 10; // +10 als Puffer textBox1.Width = (int)size.Width + 10; // +10 als Puffer
} }
} }
} }
} }
//CHANGES: Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren. //CHANGES: Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren.

View File

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

View File

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

View File

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

View File

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

View File

@ -18,17 +18,6 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace DatenDB namespace DatenDB
{ {
#region Enums #region Enums
public enum AuftragPriority
{
None = 0,
First = 1,
Second = 2,
Third = 3,
Fourth = 4,
Fifth = 5
}
/// <summary> /// <summary>
/// Enum AuftragStatus /// Enum AuftragStatus
/// </summary> /// </summary>
@ -52,13 +41,14 @@ namespace DatenDB
public enum AuftragTyp public enum AuftragTyp
{ {
Geschäft = 0, Geschäft = 0,
Standart = 1, Standart = 10,
Inventur = 2, Inventur = 20,
Standerhöhung = 3, SOLL_Erhoehung = 30,
Standverminderung = 4, IST_Erhoehung = 32,
Regelmäßig = 5, SOLL_Verminderung = 40,
AufAbruf = 6, Regelmäßig = 50,
Einmalig = 7 AufAbruf = 60,
Laufzettel = 70
} }
[Flags] [Flags]
@ -97,67 +87,6 @@ namespace DatenDB
} }
#region async Tasks #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) public static async Task<List<Auftrag>> GetStatusListAsync(int? status, NpgsqlConnection conn)
{ {
List<Auftrag> resultList = new List<Auftrag>(); List<Auftrag> resultList = new List<Auftrag>();
@ -178,7 +107,7 @@ namespace DatenDB
//isExpedit = false; //isExpedit = false;
return resultList; return resultList;
} }
public static async Task<List<Auftrag>> GetFahrerListAsync(int? fahrerID, NpgsqlConnection conn) public static async Task<List<Auftrag>> GetFahrerListAsync(int? tourID, NpgsqlConnection conn)
{ {
List<Auftrag> resultList = new List<Auftrag>(); List<Auftrag> resultList = new List<Auftrag>();
isExpedit = true; isExpedit = true;
@ -186,7 +115,7 @@ namespace DatenDB
{ {
command.Connection = conn; 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.benutzer_id = {fahrerID} 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.tour_id = {tourID} and liefertag = CURRENT_DATE and status < {(int)AuftragStatus.Ausgeliefert} ORDER BY status DESC";
using (var reader = await command.ExecuteReaderAsync()) using (var reader = await command.ExecuteReaderAsync())
{ {
@ -594,7 +523,7 @@ namespace DatenDB
this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18); this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19); this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20); this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
this.Priority = (AuftragPriority)reader.GetInt32(21); this.Priority = (Priority)reader.GetInt32(21);
if (isExpedit) if (isExpedit)
{ {
@ -629,7 +558,7 @@ namespace DatenDB
this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18); this.AufgabeErledigt = !reader.IsDBNull(18) && reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19); this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20); this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
this.Priority = (AuftragPriority)reader.GetInt32(21); this.Priority = (Priority)reader.GetInt32(21);
} }
#region Properties #region Properties
@ -757,7 +686,7 @@ namespace DatenDB
{ {
get get
{ {
if(Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.Standverminderung) if(Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.SOLL_Verminderung)
{ {
if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty; if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty;
else return _fertig = "✅"; else return _fertig = "✅";
@ -821,7 +750,7 @@ namespace DatenDB
[OLVIgnore] [OLVIgnore]
public RegRhythmen Rhythmus { get; set; } public RegRhythmen Rhythmus { get; set; }
[OLVIgnore] [OLVIgnore]
public AuftragPriority Priority { get; set; } = 0; public Priority Priority { get; set; } = 0;
#endregion #endregion
private void SpeicherStatus() private void SpeicherStatus()

View File

@ -167,6 +167,14 @@ namespace Deckungsbeitrag.AA_Klassen
parameters.Add(new NpgsqlParameter("@typ", (int)typFilter.Value)); 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 // Frottee-Filter
if (frottee.HasValue && frottee.Value) if (frottee.HasValue && frottee.Value)
@ -199,11 +207,11 @@ namespace Deckungsbeitrag.AA_Klassen
AufgabeErledigt = SafeBool(reader, "aufgabe_erledigt"), AufgabeErledigt = SafeBool(reader, "aufgabe_erledigt"),
AbteilungenStatus = (AbteilungsStatus)SafeInt(reader, "abteilungen_status"), AbteilungenStatus = (AbteilungsStatus)SafeInt(reader, "abteilungen_status"),
Rhythmus = (RegRhythmen)SafeInt(reader, "rhythmus"), Rhythmus = (RegRhythmen)SafeInt(reader, "rhythmus"),
Priority = (AuftragPriority)SafeInt(reader, "priority"), Priority = (Priority)SafeInt(reader, "priority"),
Gedruckt = SafeDateTime(reader, "gedruckt"), Gedruckt = SafeDateTime(reader, "gedruckt"),
AufgabeBezeichnung = SafeString(reader, "aufgabe_bez"), AufgabeBezeichnung = SafeString(reader, "aufgabe_bez"),
KundeName = SafeString(reader, "suchtext"), KundeName = SafeString(reader, "suchtext"),
Fahrer = SafeString(reader, "fahrer"), Tour = SafeString(reader, "tour"),
FrotteeStatus = SafeInt(reader, "frottee_status"), FrotteeStatus = SafeInt(reader, "frottee_status"),
KleinteileStatus = SafeInt(reader, "kleinteile_status"), KleinteileStatus = SafeInt(reader, "kleinteile_status"),
GrossteileStatus = SafeInt(reader, "grossteile_status") GrossteileStatus = SafeInt(reader, "grossteile_status")
@ -232,24 +240,24 @@ namespace Deckungsbeitrag.AA_Klassen
[OLVIgnore]public int BenutzerID { get; set; } [OLVIgnore]public int BenutzerID { get; set; }
[OLVIgnore]public int? AufgabeID { get; set; } [OLVIgnore]public int? AufgabeID { get; set; }
[OLVIgnore]public int KundeID { get; set; } [OLVIgnore]public int KundeID { 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; } [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; }
[OLVIgnore]public bool AufgabeErledigt { get; set; } [OLVIgnore]public bool AufgabeErledigt { get; set; }
[OLVIgnore]public AbteilungsStatus AbteilungenStatus { get; set; } [OLVIgnore]public AbteilungsStatus AbteilungenStatus { get; set; }
[OLVIgnore]public RegRhythmen Rhythmus { get; set; } [OLVIgnore]public RegRhythmen Rhythmus { get; set; }
[OLVColumn("Priority", DisplayIndex = 15)]public AuftragPriority Priority { get; set; }
[OLVIgnore]private DateTime? Gedruckt { 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; }
[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; }
// Join-Felder aus Table kunde & benutzer // Join-Felder aus Table kunde & benutzer
[OLVColumn("Aufgabe", DisplayIndex = 55)]public string AufgabeBezeichnung { get; set; } [OLVColumn("Aufgabe", DisplayIndex = 55)]public string AufgabeBezeichnung { get; set; }
[OLVColumn("Kunde", DisplayIndex = 0)]public string KundeName { get; set; } [OLVColumn("Kunde", DisplayIndex = 0)]public string KundeName { get; set; }
[OLVColumn("Fahrer", DisplayIndex = 70)]public string Fahrer { get; set; } [OLVColumn("Tour", DisplayIndex = 70, IsEditable = false)]public string Tour { get; set; }
// **3 Status-Spalten statt 12 Flags** // **3 Status-Spalten statt 12 Flags**
[OLVIgnore]public int FrotteeStatus { get; set; } [OLVIgnore]public int FrotteeStatus { get; set; }

View File

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

View File

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

View File

@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using ZXing; using ZXing;
@ -11,8 +12,8 @@ namespace Deckungsbeitrag.AA_Klassen
{ {
public class Tour public class Tour
{ {
// 0 1 2 3 4 5 6 7 8 9 10 11 // 0 1 2 3 4
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 COLUMNS = "tour_id, benutzer_id, saison_id, bezeichnung, priority";
public const string TABLE = "kundenverwaltung.tour"; public const string TABLE = "kundenverwaltung.tour";
#region Class-Standarts (Properties, Save, reader) #region Class-Standarts (Properties, Save, reader)
@ -21,15 +22,8 @@ namespace Deckungsbeitrag.AA_Klassen
public int? TourID { get; set; } public int? TourID { get; set; }
public int? BenutzerID { get; set; } public int? BenutzerID { get; set; }
public int? SaisonID { get; set; } public int? SaisonID { get; set; }
public int? Kundenanzahl { get; set; } public string Bezeichnung { get; set; }
public DateTime Liefertag { get; set; } public Priority Priority { 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() public int? Save()
{ {
@ -42,28 +36,23 @@ namespace Deckungsbeitrag.AA_Klassen
int? result; int? result;
if (this.TourID.HasValue & this.TourID != 0) if (this.TourID.HasValue & this.TourID != 0)
{ {
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"; command.CommandText = $"update {TABLE} set benutzer_id = :p1, saison_id = :p2, bezeichnung = :p3, priority = :p4 WHERE tour_id = :p0";
} }
else else
{ {
command.CommandText = "select nextval('kundenverwaltung.tour_seq')"; command.CommandText = "select nextval('kundenverwaltung.tour_seq')";
this.TourID = (int)(long)command.ExecuteScalar(); this.TourID = (int)(long)command.ExecuteScalar();
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11)"; command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4)";
} }
command.Parameters.AddWithValue("p0", this.TourID); Match match = Regex.Match(this.Bezeichnung ?? "", @"\d+");
command.Parameters.AddWithValue("p1", this.BenutzerID); int zahl = match.Success ? int.Parse(match.Value) : 0; // oder throw bei Fehler
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);
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);
result = command.ExecuteNonQuery(); result = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close(); DatenbankConnection.GetConnection().Close();
@ -75,17 +64,10 @@ namespace Deckungsbeitrag.AA_Klassen
public Tour(NpgsqlDataReader reader) public Tour(NpgsqlDataReader reader)
{ {
this.TourID = reader.GetInt32(0); this.TourID = reader.GetInt32(0);
this.BenutzerID = reader.GetInt32(1); this.BenutzerID = reader.IsDBNull(1) ? (int?)null : reader.GetInt32(1);
this.Kundenanzahl = reader.GetInt32(2); this.SaisonID = reader.GetInt32(2);
this.Liefertag = reader.GetDateTime(3); this.Bezeichnung = reader.IsDBNull(3) ? string.Empty : reader.GetString(3);
this.Start = reader.IsDBNull(4) ? (DateTime?)null : reader.GetDateTime(4); this.Priority = reader.IsDBNull(4) ? Priority.None : (Priority)reader.GetInt32(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 #endregion
@ -122,14 +104,14 @@ namespace Deckungsbeitrag.AA_Klassen
return result; return result;
} }
internal static Tour GetTour(int? tourID) internal static Tour GetTour(int? saison, string bez)
{ {
Tour result = null; Tour result = null;
DatenbankConnection.GetConnection().Open(); DatenbankConnection.GetConnection().Open();
using (NpgsqlCommand command = new NpgsqlCommand()) using (NpgsqlCommand command = new NpgsqlCommand())
{ {
command.Connection = DatenbankConnection.GetConnection(); command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where tour_id = {tourID}"; command.CommandText = $"select {COLUMNS} from {TABLE} where saison_id = {saison} and bezeichnung = '{bez}'";
NpgsqlDataReader reader = command.ExecuteReader(); NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Tour(reader); while (reader.Read()) result = new Tour(reader);
reader.Close(); reader.Close();
@ -140,6 +122,25 @@ namespace Deckungsbeitrag.AA_Klassen
return result; 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 #endregion
} }
public class TDaten public class TDaten
@ -155,11 +156,3 @@ 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,6 +15,7 @@ using System.Net;
using System.Reflection; using System.Reflection;
using System.Runtime; using System.Runtime;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -26,12 +27,22 @@ using System.Windows.Forms;
namespace Deckungsbeitrag 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 Color Wirlblau = Settings.Default.Wirlblau;
public static ImageList imagelist = new ImageList(); public static ImageList imagelist = new ImageList();
public static string userid; public static string userid;
public static Benutzer benutzer = new Benutzer(); public static Benutzer benutzer;
public static bool Artikelliste_Importiert = false; public static bool Artikelliste_Importiert = false;
public static bool Kundenliste_Importiert = false; public static bool Kundenliste_Importiert = false;
public static bool Software_Updated = false; public static bool Software_Updated = false;
@ -113,7 +124,7 @@ namespace Deckungsbeitrag
switch (userid) switch (userid)
{ {
case var s when s.Contains("wstrasse"): case var s when s.Contains("wstrasse"):
benutzer = Benutzer.GetBenutzer(null, 4); //benutzer = Benutzer.GetBenutzer(null, 4);
Application.Run(new FormAufleger(userid)); Application.Run(new FormAufleger(userid));
break; break;
case var s when s.Contains("frottee"): case var s when s.Contains("frottee"):
@ -537,11 +548,11 @@ namespace Deckungsbeitrag
foreach (Process p in Process.GetProcessesByName("SetupVerwaltung")) foreach (Process p in Process.GetProcessesByName("SetupVerwaltung"))
p.Kill(); p.Kill();
// 3. 2 Sekunden warten (Restart Manager) // 3. 10 Sekunden warten (Restart Manager)
Thread.Sleep(2000); //Thread.Sleep(10000);
Process.Start(psi)?.Dispose(); //Process.Start(psi)?.Dispose();
return true; return true;
} }
catch (Exception ex) 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, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben: // indem Sie "*" wie unten gezeigt eingeben:
[assembly: AssemblyVersion("1.0.9.4")] [assembly: AssemblyVersion("1.0.9.7")]
[assembly: AssemblyFileVersion("1.0.9.4")] [assembly: AssemblyFileVersion("1.0.9.7")]

View File

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

View File

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

View File

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

View File

@ -38,6 +38,10 @@
this.dTPInvDatum = new System.Windows.Forms.DateTimePicker(); this.dTPInvDatum = new System.Windows.Forms.DateTimePicker();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox(); this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.dGArtikel = new System.Windows.Forms.DataGridView(); 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.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -45,11 +49,6 @@
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = 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(); this.groupBoxInventur.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
@ -187,6 +186,69 @@
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGArtikel_CellValueChanged); this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGArtikel_CellValueChanged);
this.dGArtikel.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.DGArtikel_DataBindingComplete); 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 // Column1
// //
this.Column1.DataPropertyName = "ArtikelNR"; this.Column1.DataPropertyName = "ArtikelNR";
@ -208,11 +270,11 @@
// Column3 // Column3
// //
this.Column3.DataPropertyName = "Stand"; this.Column3.DataPropertyName = "Stand";
this.Column3.HeaderText = "Ist-Stand"; this.Column3.HeaderText = "Soll-Stand";
this.Column3.MinimumWidth = 6; this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3"; this.Column3.Name = "Column3";
this.Column3.ReadOnly = true; this.Column3.ReadOnly = true;
this.Column3.Width = 129; this.Column3.Width = 143;
// //
// Column4 // Column4
// //
@ -249,90 +311,6 @@
this.Column7.ReadOnly = true; this.Column7.ReadOnly = true;
this.Column7.Width = 171; 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 // UCInventur
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -366,6 +344,11 @@
private System.Windows.Forms.PictureBox pictureBoxClose; private System.Windows.Forms.PictureBox pictureBoxClose;
private System.Windows.Forms.Panel panelButtons; private System.Windows.Forms.Panel panelButtons;
private System.Windows.Forms.Label labelInvText; 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 Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2; private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
@ -373,11 +356,5 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column5; private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6; private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7; 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,14 +41,11 @@ namespace Deckungsbeitrag.UserControls
_tosave = value; _tosave = value;
if (_tosave) if (_tosave)
{ {
buttonSpeichern.Enabled = true; buttonFreigeben.Enabled = true;
buttonSpeichern.BackColor = Color.FromArgb(0, 192, 0); buttonFreigeben.BackColor = Color.Turquoise;
if ((this.user.Rolle == BenutzerRolle.Verwaltung) || (this.user.Rolle == BenutzerRolle.Admin)) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
} }
else else
{ {
buttonSpeichern.Enabled = false;
buttonSpeichern.BackColor = Color.Gray;
buttonFreigeben.Enabled = false; buttonFreigeben.Enabled = false;
buttonFreigeben.BackColor = Color.Gray; buttonFreigeben.BackColor = Color.Gray;
} }
@ -80,12 +77,11 @@ namespace Deckungsbeitrag.UserControls
private void UCInventur_Load(object sender, EventArgs e) 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; string kundeName = this.kunde.Suchtext ?? this.kunde.KundeName;
this.groupBoxInventur.Text = $"Inventur-{this.kunde.KundeNummer} {kundeName}"; this.groupBoxInventur.Text = $"Inventur-{this.kunde.KundeNummer} {kundeName}";
if (lines == null || lines.Length == 0) { this.dTPInvDatum.Value = DateTime.Today.Date; } 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; } else { this.dTPInvDatum.Value = DateTime.Parse(lines[4].Split(':')[1]); this.dTPInvDatum.Enabled = true; this.buttonAbbrechen.Visible = false; }
if (auftrag != null) this.dTPLieferDat.Value = auftrag.Liefertag; if (auftrag != null) this.dTPLieferDat.Value = auftrag.Liefertag;
Load_DGV(); Load_DGV();
if (lines != null & Sender is FormMain) PictureBoxClose_Click(sender, e); if (lines != null & Sender is FormMain) PictureBoxClose_Click(sender, e);
@ -205,9 +201,22 @@ namespace Deckungsbeitrag.UserControls
Funktionen.GetGroupBoxBoarder(gb, e); 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) private void ButtonFreigeben_Click(object sender, EventArgs e)
{ {
if (this.auftrag == null) return; 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) ButtonSpeichern_Click("Speichern", null);
this.auftrag.Liefertag = dTPLieferDat.Value; this.auftrag.Liefertag = dTPLieferDat.Value;
foreach (DataGridViewRow row in this.dGArtikel.Rows) foreach (DataGridViewRow row in this.dGArtikel.Rows)
{ {
@ -240,11 +249,10 @@ namespace Deckungsbeitrag.UserControls
} }
auftrag.Status = AuftragStatus.Herrichten; auftrag.Status = AuftragStatus.Herrichten;
auftrag.Save(); auftrag.Save();
GetInventurCSV(sender, auftrag.AuftragID); GetInventurCSV(sender, auftrag.AuftragID);
UCInventur_Update(); UCInventur_Update();
} }
}
/// <summary> /// <summary>
/// DataGridView wird geladen. /// DataGridView wird geladen.
@ -388,12 +396,10 @@ namespace Deckungsbeitrag.UserControls
/// <param name="e"></param> /// <param name="e"></param>
private void PictureBoxClose_Click(object sender, EventArgs e) 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(this.buttonSpeichern, 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("Speichern", null);
if (groupBoxInventur.Visible) if (groupBoxInventur.Visible)
{ {
this.buttonFreigeben.Visible = false;
this.buttonSpeichern.Visible = false;
this.labelInvText.Text = groupBoxInventur.Text; this.labelInvText.Text = groupBoxInventur.Text;
this.groupBoxInventur.Visible = false; this.groupBoxInventur.Visible = false;
this.labelInvText.Visible = true; this.labelInvText.Visible = true;
@ -445,7 +451,6 @@ namespace Deckungsbeitrag.UserControls
this.dTPInvDatum.Location = new Point(x += labelInvDat.Width, this.pictureBoxPlus.Location.Y); 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.labelLieferDat.Location = new Point(x = x + dTPInvDatum.Width + 10, label_y);
this.dTPLieferDat.Location = new Point(x + labelLieferDat.Width, this.pictureBoxPlus.Location.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(); if (Sender is FormAuftragDetail) SizeChangedForParent?.Invoke();
} }
@ -461,8 +466,6 @@ namespace Deckungsbeitrag.UserControls
uci_loc = this.Location; uci_loc = this.Location;
DataGridView_GetNewSize(this.dGArtikel); DataGridView_GetNewSize(this.dGArtikel);
this.buttonFreigeben.Visible = true; this.buttonFreigeben.Visible = true;
this.buttonSpeichern.Visible = true;
groupBoxInventur.Visible = true;
this.labelInvText.Visible = false; this.labelInvText.Visible = false;
} }
} }
@ -482,15 +485,11 @@ namespace Deckungsbeitrag.UserControls
iststand += int.TryParse(row.Cells[j].Value.ToString(), out int r) ? r : 0; iststand += int.TryParse(row.Cells[j].Value.ToString(), out int r) ? r : 0;
} }
if (e.ColumnIndex >= 7) if (e.ColumnIndex >= 7 || e.ColumnIndex == 2)
{ {
row.Cells[5].Value = sollstand - fehlmenge - iststand; row.Cells[5].Value = sollstand - fehlmenge - iststand;
row.Cells[6].Value = artikelListe[e.RowIndex].Korrektur = sollstand - 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; else return;
dgv.Refresh(); dgv.Refresh();
@ -502,6 +501,11 @@ namespace Deckungsbeitrag.UserControls
else Tosave = false; 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) private void ButtonSpeichern_Click(object sender, EventArgs e)
{ {
this.dGArtikel.EndEdit(); // beendet aktuelle ZellBearbeitung this.dGArtikel.EndEdit(); // beendet aktuelle ZellBearbeitung
@ -543,13 +547,25 @@ 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) 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(); } 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 UCInventur_Delete();
} }
else
{
PictureBoxClose_Click(this.pictureBoxClose, null);
} }
} }
//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. //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.

View File

@ -173,4 +173,25 @@
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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> </root>

View File

@ -35,7 +35,21 @@ namespace Deckungsbeitrag.UserControls
{ {
ReadCSV(); 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> /// <summary>
@ -48,7 +62,6 @@ namespace Deckungsbeitrag.UserControls
string row; string row;
string[] rows; string[] rows;
try try
{ {
if (File.Exists(Path.Combine(updatePath, dateiName))) if (File.Exists(Path.Combine(updatePath, dateiName)))

View File

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

View File

@ -157,6 +157,12 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<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"> <Compile Include="AA-Forms\FehlmengeChart.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@ -1,88 +1,70 @@
===================================== =====================================
NEUIGKEITEN - Version 1.0.9.4 NEUIGKEITEN - Version 1.0.9.7
===================================== =====================================
Build-Info: Build-Info:
- Build-Typ: Release Build - Build-Typ: Release Build
- Erledigte TODOs: 15 - Erledigte TODOs: 6
- Offene TODOs: 31 - Offene TODOs: 24
- Install-Reminders: 2 - Install-Reminders: 1
- Changes: 16 - 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.
=== ⚙️ INSTALL-REMINDER (2) === === ⚙️ INSTALL-REMINDER (1) ===
- ⚙️ DB anpassen. (Priority in Auftrag etc.) [Auftrag.cs] - ⚙️ DB anpassen. (Priority in Auftrag etc.) [Auftrag.cs]
- ⚙️ Tabelle Tour in Datenbank einfügen [Tour.cs]
=== ✨ CHANGES (16) === Installation: 24.04.2026 17:10
- ✨ 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
===================================== =====================================