Compare commits

...

6 Commits

Author SHA1 Message Date
d3fdada8b0 Div. Anpassungen und Verbesserungen. 2026-03-06 16:40:24 +01:00
9805aae717 Auftrag_Status wird bei Change gespeichert. 2026-02-25 17:10:48 +01:00
9411a5b8e3 Change AppStarter 2026-02-25 08:44:11 +01:00
efd3758c4f AppStarter hinzugefügt 2026-02-25 08:37:56 +01:00
9b2d3e2689 Wechsel AutoStart 2026-02-25 08:34:15 +01:00
2b9cf48fb5 AutoStart 2026-02-25 08:29:57 +01:00
62 changed files with 4149 additions and 1493 deletions

View File

@ -103,6 +103,7 @@
this.labelContT5.Tag = "FR";
this.labelContT5.Text = "0";
this.labelContT5.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.labelContT5.DoubleClick += new System.EventHandler(this.labelCont_DoubleClick);
//
// labelContT4
//
@ -118,6 +119,7 @@
this.labelContT4.Tag = "DO";
this.labelContT4.Text = "0";
this.labelContT4.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.labelContT4.DoubleClick += new System.EventHandler(this.labelCont_DoubleClick);
//
// labelContT3
//
@ -133,6 +135,7 @@
this.labelContT3.Tag = "MI";
this.labelContT3.Text = "0";
this.labelContT3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.labelContT3.DoubleClick += new System.EventHandler(this.labelCont_DoubleClick);
//
// labelContT2
//
@ -148,6 +151,7 @@
this.labelContT2.Tag = "DI";
this.labelContT2.Text = "0";
this.labelContT2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.labelContT2.DoubleClick += new System.EventHandler(this.labelCont_DoubleClick);
//
// labelContT1
//
@ -163,6 +167,7 @@
this.labelContT1.Tag = "MO";
this.labelContT1.Text = "0";
this.labelContT1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.labelContT1.DoubleClick += new System.EventHandler(this.labelCont_DoubleClick);
//
// fLP_T5
//
@ -326,6 +331,7 @@
//
this.labelVersion.AutoSize = true;
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.ForeColor = System.Drawing.Color.White;
this.labelVersion.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.labelVersion.Location = new System.Drawing.Point(417, 555);
this.labelVersion.Name = "labelVersion";

View File

@ -16,6 +16,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Input;
namespace Deckungsbeitrag
{
@ -26,6 +27,7 @@ namespace Deckungsbeitrag
private Auftrag auftrag;
private Meldungen meldung = new Meldungen();
private bool iswechsel = false;
private string userid;
public FormAufleger()
{
@ -37,12 +39,16 @@ namespace Deckungsbeitrag
timer.Tick += Timer_Tick;
}
public FormAufleger(string userid) : this()
{
this.userid = userid;
}
private async void FormAufleger_Load(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
this.SuspendLayout();
this.labelVersion.Text += Assembly.GetExecutingAssembly().GetName().Version;
this.labelVersion.Text += Assembly.GetExecutingAssembly().GetName().Version.ToString();
try
{
@ -53,7 +59,6 @@ namespace Deckungsbeitrag
this.Invoke(new Action(() =>
{
LoadPanel();
SortFlowLayoutPanels();
}));
}
@ -79,14 +84,20 @@ namespace Deckungsbeitrag
foreach (var key in auftragliste.Keys.OrderBy(k => k))
{
Control ctr = this.tLPAuftrag.GetControlFromPosition(index, i);
ctr.Text = Funktionen.GetWochentagDeutsch(key.DayOfWeek);
ctr.Text += " (" + key.ToShortDateString() + ")"; // "13.02.2026"
if (index == 4) ctr.Text = "Rest";
else
{
ctr.Text = Funktionen.GetWochentagDeutsch(key.DayOfWeek);
ctr.Text += " (" + key.ToShortDateString() + ")";
}
ctr.Font = Funktionen.GetFontSizeByWidth(ctr.Font, ctr.Text, ctr.Width);
index++;
}
}
if(i == 1)
{
float flpsize = 0;
// 1. Dictionary: Column-Index → FlowLayoutPanel
var flpDictionary = new Dictionary<int, FlowLayoutPanel>();
for (int column = 0; column < this.tLPAuftrag.ColumnCount; column++)
@ -94,6 +105,7 @@ namespace Deckungsbeitrag
Control ctr = this.tLPAuftrag.GetControlFromPosition(column, i);
if (ctr is FlowLayoutPanel flp)
flpDictionary[column] = flp;
flpsize = ctr.Width;
}
// 2. Dictionary: Column → Array aller UCAuftrag für diesen Tag
@ -115,8 +127,7 @@ namespace Deckungsbeitrag
this.auftrag = auftrag;
uca.BackColor = Color.YellowGreen;
}
else
uca.BackColor = Color.Silver;
uca.Size = new Size(flpDictionary[col].Width - 30, uca.Height);
alleUCA[anzUCA] = uca;
@ -127,6 +138,21 @@ namespace Deckungsbeitrag
col++;
}
var ucA = new Dictionary<int, UCAuftrag[]>();
foreach (KeyValuePair<int, UCAuftrag[]> auftraglist in ucArrays)
{
int key = auftraglist.Key;
// Innerhalb jedes Arrays nach Fahrer sortieren
UCAuftrag[] sortiert = auftraglist.Value
.OrderBy(a => a.Fahrer) // oder a.FahrerName
.ToArray();
ucA[key] = sortiert;
}
ucArrays = ucA;
// 3. ATOMAR: Alle FLPs leeren + Arrays auf einmal hinzufügen
foreach (var kvp in flpDictionary)
{
@ -143,7 +169,14 @@ namespace Deckungsbeitrag
{
int column = this.tLPAuftrag.GetColumn(flowpanel);
int container = 0;
foreach (UCAuftrag uca in flowpanel.Controls) container += int.Parse(uca.ContainerAnzahl);
foreach (UCAuftrag uca in flowpanel.Controls)
{
container += int.Parse(uca.ContainerAnzahl);
Label lblKunde = uca.Controls["labelKunde"] as Label;
lblKunde.Font = Funktionen.GetFontSizeByWidth(lblKunde.Font, lblKunde.Text, uca.Width);
uca.Refresh();
}
Control ctr = this.tLPAuftrag.GetControlFromPosition(column, i);
ctr.Text = container.ToString();
@ -173,12 +206,22 @@ namespace Deckungsbeitrag
private void FormAufleger_Shown(object sender, EventArgs e)
{
this.ResumeLayout(true);
this.Cursor = Cursors.Default;
this.textBoxScan.Focus();
}
/// <summary>
/// Erfassen von Tasten für Tastaturlose Steuerung.
/// </summary>
/// <param name="keyData"></param>
/// <returns></returns>
protected override bool ProcessDialogKey(Keys keyData)
{
//TODO: Umbau in Switch.
@ -207,7 +250,7 @@ namespace Deckungsbeitrag
Kunde kunde;
string zusatz = string.Empty;
if (string.IsNullOrEmpty(textBoxScan.Text)) { return; }
if (string.IsNullOrEmpty(textBoxScan.Text)) { this.Cursor = Cursors.Default; return; }
if (int.TryParse(textBoxScan.Text, out _)) kunde = Kunde.GetKunde(textBoxScan.Text, null, null);
else
{
@ -244,26 +287,6 @@ namespace Deckungsbeitrag
SucheAuftrag();
this.Cursor = Cursors.Default;
}
private void SortFlowLayoutPanels()
{
foreach (FlowLayoutPanel flp in this.tLPAuftrag.Controls.OfType<FlowLayoutPanel>())
{
if (flp.Controls.Count > 0)
{
var controls = flp.Controls.Cast<Control>()
.OrderBy(c => ((Auftrag)c.Tag).Fahrer) // oder c.Tag
.ToArray();
flp.SuspendLayout();
for (int i = 0; i < controls.Length; i++)
{
flp.Controls.SetChildIndex(controls[i], i);
}
flp.ResumeLayout();
}
}
}
private void SucheAuftrag()
{
this.textBoxScan.TextChanged -= textBoxScan_TextChanged;
@ -307,10 +330,25 @@ namespace Deckungsbeitrag
Application.Exit();
}
/// <summary>
/// Waschzeitberechnung bei DoppelClick auf Container Label.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void labelCont_DoubleClick(object sender, EventArgs e)
{
Label lbl = sender as Label;
double[] zeit = { 0, 0 };
for (int i = 1; i < 3; i++)
{
if (double.TryParse(lbl.Text, out double cont)) zeit[i-1] = (cont * 2.7 * 3.5) / 60 / i;
}
meldung.GetInfo(this, $"Die Waschzeiten für den gewünschten Tag lauten:\n\n[Eine Waschstraße] => {zeit[0].ToString("F1")} Stunden\n[Zwei Waschstraßen] => {zeit[1].ToString("F1")} Stunden", false);
}
}
}
//CHANGES: Form für Aufleger soweit fertig.
//CHANGES: Kontrolle ob mehrere Aufträge vorhanden fertig.
//CHANGES: Status anpassen fertig.
//CHANGES: Programm wird mit Button geschlossen. (Sicherheitsabfrage ob wirklich gewollt wird gemacht.)
//CHANGES: Hintergrundfarbe wird jetzt immer richtig zugewiesen.

View File

@ -120,7 +120,7 @@ namespace Deckungsbeitrag
if(auftrag.Status == AuftragStatus.Herrichten)
{
this.listViewArtikel.Visible = true;
this.artikelList = AuftragArtikel.GetList(auftrag.AuftragID.ToString());
this.artikelList = AuftragArtikel.GetList(auftrag.AuftragID);
this.listViewArtikel.Columns.Clear();
this.listViewArtikel.Columns.Add("ARTIKEL");
this.listViewArtikel.Columns.Add("ANZAHL");

View File

@ -52,7 +52,7 @@ namespace Deckungsbeitrag
Funktionen.HideControls(this.Controls);
this.BackColor = Properties.Settings.Default.Wirlblau;
this.BackColor = Program.Wirlblau;
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;

View File

@ -36,7 +36,7 @@ namespace Deckungsbeitrag
List<Benutzer> list = new List<Benutzer>();
try
{
if (this.fahrerliste.Count > 0) list = this.fahrerliste;
if (this.fahrerliste != null && this.fahrerliste.Count > 0) list = this.fahrerliste;
else list = new List<Benutzer>(Benutzer.GetList());
Load_OLV(list);
this.Width = this.objectListViewBenutzer.Width + 10;

View File

@ -105,6 +105,10 @@
this.label15 = new System.Windows.Forms.Label();
this.tabPageAllgemein = new System.Windows.Forms.TabPage();
this.panelButtons = new System.Windows.Forms.Panel();
this.comboBoxTourenlisteDrucker = new System.Windows.Forms.ComboBox();
this.label24 = new System.Windows.Forms.Label();
this.groupBoxPfade = new System.Windows.Forms.GroupBox();
this.tabPageExpedit = new System.Windows.Forms.TabPage();
((System.ComponentModel.ISupportInitialize)(this.numUpDownMinWert)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUpDownMaxWert)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUpDownAnzahl)).BeginInit();
@ -120,6 +124,7 @@
this.groupBoxRegeln.SuspendLayout();
this.tabPageAllgemein.SuspendLayout();
this.panelButtons.SuspendLayout();
this.groupBoxPfade.SuspendLayout();
this.SuspendLayout();
//
// buttonVarKost
@ -514,7 +519,7 @@
// textBoxSortiment
//
this.textBoxSortiment.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxSortiment.Location = new System.Drawing.Point(181, 75);
this.textBoxSortiment.Location = new System.Drawing.Point(170, 34);
this.textBoxSortiment.Margin = new System.Windows.Forms.Padding(2);
this.textBoxSortiment.Name = "textBoxSortiment";
this.textBoxSortiment.Size = new System.Drawing.Size(422, 26);
@ -527,7 +532,7 @@
// textBoxRatingbild
//
this.textBoxRatingbild.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxRatingbild.Location = new System.Drawing.Point(181, 104);
this.textBoxRatingbild.Location = new System.Drawing.Point(170, 63);
this.textBoxRatingbild.Margin = new System.Windows.Forms.Padding(2);
this.textBoxRatingbild.Name = "textBoxRatingbild";
this.textBoxRatingbild.Size = new System.Drawing.Size(422, 26);
@ -546,7 +551,7 @@
this.buttonSortiment.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSortiment.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSortiment.ForeColor = System.Drawing.Color.White;
this.buttonSortiment.Location = new System.Drawing.Point(16, 75);
this.buttonSortiment.Location = new System.Drawing.Point(5, 34);
this.buttonSortiment.Margin = new System.Windows.Forms.Padding(2);
this.buttonSortiment.Name = "buttonSortiment";
this.buttonSortiment.Size = new System.Drawing.Size(160, 24);
@ -564,7 +569,7 @@
this.buttonRatingbild.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRatingbild.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonRatingbild.ForeColor = System.Drawing.Color.White;
this.buttonRatingbild.Location = new System.Drawing.Point(16, 104);
this.buttonRatingbild.Location = new System.Drawing.Point(5, 63);
this.buttonRatingbild.Margin = new System.Windows.Forms.Padding(2);
this.buttonRatingbild.Name = "buttonRatingbild";
this.buttonRatingbild.Size = new System.Drawing.Size(160, 24);
@ -795,7 +800,7 @@
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label13.Location = new System.Drawing.Point(22, 37);
this.label13.Location = new System.Drawing.Point(5, 37);
this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(73, 13);
@ -806,7 +811,7 @@
//
this.label14.AutoSize = true;
this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label14.Location = new System.Drawing.Point(22, 64);
this.label14.Location = new System.Drawing.Point(5, 64);
this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(78, 13);
@ -833,6 +838,8 @@
//
// groupBoxDrucker
//
this.groupBoxDrucker.Controls.Add(this.comboBoxTourenlisteDrucker);
this.groupBoxDrucker.Controls.Add(this.label24);
this.groupBoxDrucker.Controls.Add(this.numericUpDownSWSKopien);
this.groupBoxDrucker.Controls.Add(this.label1);
this.groupBoxDrucker.Controls.Add(this.comboBoxSWSDrucker);
@ -842,7 +849,7 @@
this.groupBoxDrucker.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBoxDrucker.Location = new System.Drawing.Point(14, 32);
this.groupBoxDrucker.Name = "groupBoxDrucker";
this.groupBoxDrucker.Size = new System.Drawing.Size(547, 90);
this.groupBoxDrucker.Size = new System.Drawing.Size(547, 123);
this.groupBoxDrucker.TabIndex = 48;
this.groupBoxDrucker.TabStop = false;
this.groupBoxDrucker.Text = "Standart Drucker";
@ -871,11 +878,12 @@
this.tabControlEinstellung.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControlEinstellung.Controls.Add(this.tabPageAllgemein);
this.tabControlEinstellung.Controls.Add(this.tabPageFarben);
this.tabControlEinstellung.Controls.Add(this.tabPageDeckungsbeitrag);
this.tabControlEinstellung.Controls.Add(this.tabPageDrucker);
this.tabControlEinstellung.Controls.Add(this.tabPageTourenplanung);
this.tabControlEinstellung.Controls.Add(this.tabPageAllgemein);
this.tabControlEinstellung.Controls.Add(this.tabPageExpedit);
this.tabControlEinstellung.Location = new System.Drawing.Point(0, 0);
this.tabControlEinstellung.Name = "tabControlEinstellung";
this.tabControlEinstellung.SelectedIndex = 0;
@ -1137,10 +1145,7 @@
//
// tabPageAllgemein
//
this.tabPageAllgemein.Controls.Add(this.buttonSortiment);
this.tabPageAllgemein.Controls.Add(this.textBoxSortiment);
this.tabPageAllgemein.Controls.Add(this.textBoxRatingbild);
this.tabPageAllgemein.Controls.Add(this.buttonRatingbild);
this.tabPageAllgemein.Controls.Add(this.groupBoxPfade);
this.tabPageAllgemein.Location = new System.Drawing.Point(4, 22);
this.tabPageAllgemein.Name = "tabPageAllgemein";
this.tabPageAllgemein.Size = new System.Drawing.Size(1184, 597);
@ -1158,6 +1163,49 @@
this.panelButtons.Size = new System.Drawing.Size(1192, 49);
this.panelButtons.TabIndex = 50;
//
// comboBoxTourenlisteDrucker
//
this.comboBoxTourenlisteDrucker.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxTourenlisteDrucker.FormattingEnabled = true;
this.comboBoxTourenlisteDrucker.Location = new System.Drawing.Point(123, 83);
this.comboBoxTourenlisteDrucker.Name = "comboBoxTourenlisteDrucker";
this.comboBoxTourenlisteDrucker.Size = new System.Drawing.Size(195, 21);
this.comboBoxTourenlisteDrucker.TabIndex = 51;
//
// label24
//
this.label24.AutoSize = true;
this.label24.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label24.Location = new System.Drawing.Point(5, 91);
this.label24.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(100, 13);
this.label24.TabIndex = 50;
this.label24.Text = "Tourenliste-Drucker";
//
// groupBoxPfade
//
this.groupBoxPfade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBoxPfade.Controls.Add(this.textBoxSortiment);
this.groupBoxPfade.Controls.Add(this.buttonSortiment);
this.groupBoxPfade.Controls.Add(this.buttonRatingbild);
this.groupBoxPfade.Controls.Add(this.textBoxRatingbild);
this.groupBoxPfade.Location = new System.Drawing.Point(8, 454);
this.groupBoxPfade.Name = "groupBoxPfade";
this.groupBoxPfade.Size = new System.Drawing.Size(652, 131);
this.groupBoxPfade.TabIndex = 34;
this.groupBoxPfade.TabStop = false;
this.groupBoxPfade.Text = "Pfade für Dokumente";
//
// tabPageExpedit
//
this.tabPageExpedit.Location = new System.Drawing.Point(4, 22);
this.tabPageExpedit.Name = "tabPageExpedit";
this.tabPageExpedit.Size = new System.Drawing.Size(1184, 597);
this.tabPageExpedit.TabIndex = 5;
this.tabPageExpedit.Text = "Expedit";
this.tabPageExpedit.UseVisualStyleBackColor = true;
//
// FormEinstellung
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1191,8 +1239,9 @@
this.groupBoxRegeln.ResumeLayout(false);
this.groupBoxRegeln.PerformLayout();
this.tabPageAllgemein.ResumeLayout(false);
this.tabPageAllgemein.PerformLayout();
this.panelButtons.ResumeLayout(false);
this.groupBoxPfade.ResumeLayout(false);
this.groupBoxPfade.PerformLayout();
this.ResumeLayout(false);
}
@ -1275,5 +1324,9 @@
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.ComboBox comboBoxTourenlisteDrucker;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.GroupBox groupBoxPfade;
private System.Windows.Forms.TabPage tabPageExpedit;
}
}

View File

@ -1,4 +1,5 @@
using Deckungsbeitrag.Properties;
using DatenDB;
using Deckungsbeitrag.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -21,6 +22,7 @@ namespace Deckungsbeitrag
string fixmietkosten = ConfigurationManager.AppSettings["FixMiete"];
public bool changed = false;
public bool validating = true;
private Benutzer benutzer;
public FormEinstellung()
{
@ -35,12 +37,15 @@ namespace Deckungsbeitrag
}
else
{
if (x.GetType() == typeof(FormExpedit))
if (x.GetType() == typeof(Benutzer))
{
foreach(Control ctr in this.Controls)
this.benutzer = (Benutzer)x;
if (benutzer.Rolle == BenutzerRolle.Expedit)
{
if (ctr.Name.Contains("Drucker") || ctr.Name.Contains("Speichern") || ctr.Name.Contains("Abbrechen")) ctr.Enabled = true;
else ctr.Enabled = false;
foreach (TabPage tP in this.tabControlEinstellung.TabPages)
{
if (!tP.Name.Contains("Drucker")) this.tabControlEinstellung.Controls.Remove(tP);
}
}
}
}
@ -53,6 +58,7 @@ namespace Deckungsbeitrag
{
this.comboBoxEtikettDrucker.Items.Add(printer);
this.comboBoxSWSDrucker.Items.Add(printer);
this.comboBoxTourenlisteDrucker.Items.Add(printer);
}
@ -74,8 +80,10 @@ namespace Deckungsbeitrag
// Ab hier wurde bereits auf UserSettingsManager umgebaut.
this.comboBoxEtikettDrucker.SelectedText = _settings.DruckerEtikett;
this.comboBoxTourenlisteDrucker.SelectedText = _settings.DruckerTourenListe;
this.comboBoxSWSDrucker.SelectedText = _settings.DruckerSWS;
this.numericUpDownSWSKopien.Value = _settings.CopiesSWS;
foreach (Button btn in this.groupBoxFarben.Controls.OfType<Button>())
@ -108,11 +116,8 @@ namespace Deckungsbeitrag
if (this.comboBoxEtikettDrucker.SelectedItem != null) _settings.DruckerEtikett = this.comboBoxEtikettDrucker.SelectedItem.ToString();
if (this.comboBoxSWSDrucker.SelectedItem != null) { _settings.DruckerSWS = this.comboBoxSWSDrucker.SelectedItem.ToString(); _settings.CopiesSWS = this.numericUpDownSWSKopien.Value; }
if (this.comboBoxTourenlisteDrucker.SelectedItem != null) _settings.DruckerTourenListe = this.comboBoxTourenlisteDrucker.ToString();
//Settings.Default.ZAnzahl = (int)this.numUpDownAnzahl.Value;
//Settings.Default.Save();
_settings.Save();
}

View File

@ -731,7 +731,7 @@
//
this.buttonTourenListe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonTourenListe.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonTourenListe.BackColor = System.Drawing.Color.PaleVioletRed;
this.buttonTourenListe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.buttonTourenListe.FlatAppearance.BorderSize = 0;
this.buttonTourenListe.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonTourenListe.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

View File

@ -27,7 +27,7 @@ namespace Deckungsbeitrag
public Image etikett = null;
public Auftrag auftrag;
public Auftrag NeuerAuftrag; //NEU FÜR UPDATE
public AuftragArtikel auftragArtikel;
//public AuftragArtikel auftragArtikel;
public Benutzer benutzer;
public Kunde kunde;
DateTime? letzterLiefertag = null;
@ -39,7 +39,6 @@ namespace Deckungsbeitrag
public List<Auftrag> sonderlist;
public List<Auftrag> geschaeftlist;
int beforeedit = 0;
int? neuecontclean = null;
int? altecontclean = null;
Timer timer1 = new Timer(); // Timer für Nachwäsche
Timer timer2 = new Timer(); // Timer für Refresh Auftragliste
@ -55,25 +54,18 @@ namespace Deckungsbeitrag
#endregion
public FormExpedit(Benutzer benutzer)
{
this.Cursor = Cursors.WaitCursor;
InitializeComponent();
this.benutzer = benutzer;
this.StartPosition = FormStartPosition.CenterScreen;
this.tabControlAuftragList.Visible = true;
//Timer für Autorefresh & Auftragliste Refresh
//timer1.Interval = 10000; // 10 sekunden
//timer1.Tick += Timer1_Tick;
//timer1.Start();
//timer2.Interval = 60000; // 1 Minute
//timer2.Tick += Timer2_Tick;
//timer2.Start();
}
public FormExpedit(Benutzer benutzer, Screen[] screens) : this(benutzer)
{
this.Cursor = Cursors.WaitCursor;
this.screens = screens;
foreach (Screen screen in screens)
{
@ -85,10 +77,11 @@ namespace Deckungsbeitrag
}
private void FormExpedit_Load(object sender, EventArgs e)
{
//Application.UseWaitCursor = true;
this.Cursor = Cursors.WaitCursor;
this.Visible = false;
this.SuspendLayout();
this.Text += " Version: " + Assembly.GetExecutingAssembly().GetName().Version;
this.Text += " Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
_settings.Load();
@ -116,6 +109,8 @@ namespace Deckungsbeitrag
Enable_Controls();
this.Visible = true;
this.ResumeLayout(false);
this.Cursor = Cursors.Default;
}));
}
@ -123,9 +118,11 @@ namespace Deckungsbeitrag
{
// Vermeide $ für C# älter
this.BeginInvoke(new Action(() => MessageBox.Show(
string.Format("Laden fehlgeschlagen: {0}", ex.Message))));
string.Format($"Laden fehlgeschlagen: {0}", ex.Message))));
Program.AddFehler(this.benutzer, ex.Message, ex.StackTrace, null);
}
});
}
@ -134,19 +131,20 @@ namespace Deckungsbeitrag
/// </summary>
private void Enable_Controls()
{
this.Cursor = Cursors.WaitCursor;
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
this.buttonNeuerAuftrag.Enabled = this.buttonSWS_Drucken.Enabled = false;
GetUnvisibleButtonColumn();
GetUnvisibleColumns();
break;
case BenutzerRolle.Fahrer:
this.buttonNeuerAuftrag.Enabled = this.buttonSWS_Drucken.Enabled = false;
GetUnvisibleButtonColumn();
GetUnvisibleColumns();
break;
case BenutzerRolle.Admin:
break;
@ -154,7 +152,7 @@ namespace Deckungsbeitrag
this.buttonNeuerAuftrag.Enabled = this.buttonSWS_Drucken.Enabled = false;
GetUnvisibleButtonColumn();
GetUnvisibleColumns();
break;
case BenutzerRolle.Master:
break;
@ -165,14 +163,14 @@ namespace Deckungsbeitrag
this.buttonStats.Visible = this.buttonEinstellung.Visible = this.buttonReklamation.Visible = false; // buttonReklamation einblenden wenn Frottee-Expedit auch Reklamation bearbeitet.
GetUnvisibleButtonColumn();
GetUnvisibleColumns();
break;
case BenutzerRolle.Flach:
this.buttonNeuerAuftrag.Enabled = this.buttonSWS_Drucken.Enabled = false;
// WENN Rolle Frottee (Expedit Frottee) dann ButtonClick deaktiviert. Nur Expedit kann abschließen
GetUnvisibleButtonColumn();
GetUnvisibleColumns();
break;
default:
break;
@ -230,127 +228,6 @@ namespace Deckungsbeitrag
}
}
/// <summary>
/// Wenn Timer abgelaufen Funktion für Autorefresh & Neuer Timer für Auftragliste Refresh.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Timer1_Tick(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
// Nur durchführen wenn DataGridView ist sichtbar.
if (dGArtikel.Visible == true)
{
// Vermeide Überlappung (wenn vorheriger Tick noch läuft)
if (_isProcessing) return;
Cursor.Current = Cursors.WaitCursor;
_isProcessing = true;
try
{
if (auftrag != null)
{
const int maxRetries = 3;
Auftrag _auftrag = null;
for (int retry = 0; retry < maxRetries; retry++)
{
try
{
_auftrag = Auftrag.GetAuftrag(auftrag.AuftragID);
if (dGArtikel.Visible) Load_Gridview(_auftrag);
_consecutiveFailures = 0; // Erfolg -> Zähler reset
break;
}
catch (NpgsqlException ex) when ((ex.InnerException is SocketException || ex.InnerException is System.IO.IOException) && retry < maxRetries - 1)
{
_consecutiveFailures++;
Debug.WriteLine($"Retry {retry + 1}/{maxRetries}: {ex.Message}"); // Logging
System.Threading.Thread.Sleep(1000 * (int)Math.Pow(2, retry)); // Backoff: 1s, 2s, 4s
}
catch (Exception ex)
{
Debug.WriteLine($"Unexpected error: {ex.Message}"); // Logging
break;
}
}
// Timer stoppen bei zu vielen aufeinanderfolgenden Fehlern
if (_consecutiveFailures >= MAX_FAILURES)
{
timer1.Enabled = false;
Debug.WriteLine("Timer gestoppt nach " + MAX_FAILURES + " Fehlern. Bitte manuell neu starten.");
// Optional: Status-Label setzen oder MessageBox
}
}
}
catch (Exception ex)
{
Debug.WriteLine($"Timer1_Tick globaler Fehler: {ex}");
_consecutiveFailures++;
}
finally
{
_isProcessing = false;
Cursor.Current = Cursors.Default;
}
}
this.Cursor = Cursors.Default;
}
private async void Timer2_Tick(object sender, EventArgs e)
{
await GetAuftraege();
}
/// <summary>
/// Laden Events (GroupBox_Etikett und GridView)
/// </summary>
private void Load_Etikett_GroupBox()
{
//if (this.auftrag == null)
//{
// this.buttonKundeNr.Text = "Auftrag in der Liste wählen";
// this.pictureBoxEntwurf.Image = null;
// this.textBoxCont.Text = "0";
// this.pictureBoxMinus.Enabled = this.pictureBoxPlus.Enabled = this.buttonDrucken.Enabled = false;
// this.buttonDrucken.BackColor = Color.Gray;
// this.pictureBoxMinus.BackColor = Color.Gray;
// this.pictureBoxPlus.BackColor = Color.Gray;
// foreach (Control ctr in this.groupBoxEtikett.Controls)
// {
// if (ctr.GetType() == typeof(Label)) ctr.Enabled = true;
// else if (ctr.Enabled == true) ctr.Enabled = false;
// }
// this.dTPLiefertag.Enabled = true;
//}
//else
//{
// //Kunde holen und Name anzeigen
// this.kunde = Kunde.GetKunde(null, this.auftrag.KundeID, null);
// this.buttonKundeNr.Text = kunde.Suchtext;
// //Containeranzahl und Liefertag anzeigen
// if (neuecontclean != null) this.textBoxCont.Text = neuecontclean.ToString();
// else this.textBoxCont.Text = this.auftrag.ContainerClean.ToString();
// this.dTPLiefertag.Value = this.auftrag.Liefertag;
// this.dTPLiefertag.Enabled = false;
// //Buttons Enablen und BackColor wechsel
// this.buttonDrucken.BackColor = Color.FromArgb(0, 192, 0);
// this.pictureBoxPlus.BackColor = Color.FromArgb(0, 192, 0);
// this.buttonDrucken.Enabled = this.pictureBoxPlus.Enabled = true;
// this.auftrag.ContainerClean = int.Parse(this.textBoxCont.Text);
// etikett = Funktionen.Etikett_Entwurf(this, this.auftrag, nocont);
// this.pictureBoxEntwurf.Image = etikett;
//}
}
#region Button_Click-Events
private async void buttonNeuerAuftrag_Click(object sender, EventArgs e)
@ -372,7 +249,7 @@ namespace Deckungsbeitrag
}
private void buttonEinstellung_Click(object sender, EventArgs e)
{
FormEinstellung einstellung = new FormEinstellung(this);
FormEinstellung einstellung = new FormEinstellung(this.benutzer);
einstellung.ShowDialog();
}
private void buttonSuchen_Click(object sender, EventArgs e)
@ -412,15 +289,29 @@ namespace Deckungsbeitrag
FormFehlmengeCount reklamation = new FormFehlmengeCount(this.benutzer);
reklamation.ShowDialog();
}
private void buttonTourenListe_Click(object sender, EventArgs e)
{
List<Benutzer> fahrerliste = Benutzer.GetFahrerList();
Benutzer fahrer = new Benutzer();
FormBenutzerVW benutzerVW = new FormBenutzerVW(fahrerliste);
if (benutzerVW.ShowDialog() == DialogResult.OK)
{
fahrer = benutzerVW.user;
}
if (fahrer != null)
{
List<Auftrag> auftragliste = Auftrag.GetTourenListe(fahrer);
if (auftragliste.Count > 0) Funktionen.TourenListe_Drucken(auftragliste, fahrer, this, this.benutzer);
}
}
#endregion
#region ObjectListView-Events
private void OLV_Load(ObjectListView olv, List<Auftrag> auftraglist)
{
// Cursor auf Warte-Status setzen, um Benutzerfeedback zu geben
this.Cursor = Cursors.WaitCursor;
// Layout- und Update-Änderungen pausieren, um Flackern zu verhindern
olv.SuspendLayout(); // Stoppt Layout-Berechnungen (Anchor/Dock)
@ -625,11 +516,9 @@ namespace Deckungsbeitrag
olv.FilterMenuBuildStrategy = new MeinFilterMenu();
// ========== AUFRÄUMEN & AKTIVIEREN ==========
olv.ResumeLayout(); // Layout-Pause beenden, Positionen neu berechnen
//olv.ResumeLayout(); // Layout-Pause beenden, Positionen neu berechnen
olv.Focus(); // OLV fokussieren (Tastaturbedienung aktivieren)
// Cursor zurücksetzen
this.Cursor = Cursors.Default;
}
private void objectListViewAuftrag_FormatCell(object sender, FormatCellEventArgs e)
{
@ -682,8 +571,6 @@ namespace Deckungsbeitrag
{
this.auftrag = _auftrag;
this.kunde = Kunde.GetKunde(null, this.auftrag.KundeID, null);
this.neuecontclean = null;
Load_Etikett_GroupBox();
this.artikelListe = KundeArtikel.GetList(kunde.KundeID.ToString());
// Chart wird eingeblendet statt Gridview. NUR wenn isttest = true.
@ -796,7 +683,6 @@ namespace Deckungsbeitrag
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
Auftrag_Fertig();
Load_Etikett_GroupBox();
}
else return;
break;
@ -804,7 +690,6 @@ namespace Deckungsbeitrag
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
Auftrag_Fertig();
Load_Etikett_GroupBox();
}
else return;
break;
@ -812,7 +697,6 @@ namespace Deckungsbeitrag
if (meldung.SonderNoCleanContainer() == DialogResult.Yes)
{
Auftrag_Fertig();
Load_Etikett_GroupBox();
}
else return;
break;
@ -830,8 +714,8 @@ namespace Deckungsbeitrag
return;
case DialogResult.Yes:
{
this.auftrag.ContainerClean = (int)neuecontclean;
neuecontclean = null;
//this.auftrag.ContainerClean = (int)neuecontclean;
//neuecontclean = null;
//this.auftrag.Liefertag = dTPLiefertag.Value;
//WENN BEARBEITET UND AUSGEDRUCKT WIRD GEDRUCKT VERÄNDERT UND ERSTELLT IST URSPRUNGSDATUM
this.auftrag.Gedruckt = DateTime.Now;
@ -853,8 +737,8 @@ namespace Deckungsbeitrag
break;
case DialogResult.No:
{
this.auftrag.ContainerClean = (int)neuecontclean;
neuecontclean = null;
//this.auftrag.ContainerClean = (int)neuecontclean;
//neuecontclean = null;
//this.auftrag.Liefertag = dTPLiefertag.Value;
//WENN BEARBEITET UND NICHT GEDRUCKT WIRD ERSTELLT VERÄNDERT UND GEDRUCKT IST URSPRUNGSDATUM
this.auftrag.Erstellt = DateTime.Now;
@ -870,7 +754,6 @@ namespace Deckungsbeitrag
else
{
Auftrag_Fertig();
Load_Etikett_GroupBox();
}
}
@ -945,8 +828,11 @@ namespace Deckungsbeitrag
/// <summary>
/// Blendet die Button Spalten aus wenn der User dazu nicht berechtigt ist.
/// </summary>
private void GetUnvisibleButtonColumn()
private void GetUnvisibleColumns()
{
this.Cursor = Cursors.WaitCursor;
this.SuspendLayout();
foreach (OLVColumn col in this.objectListViewAuftrag.Columns)
{
if (this.benutzer.Rolle == BenutzerRolle.Frottee)
@ -954,8 +840,38 @@ namespace Deckungsbeitrag
if (col.Text == "Etikett" & col.IsButton) col.IsVisible = false;
}
else if (col.IsButton) col.IsVisible = false;
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
break;
case BenutzerRolle.Fahrer:
if (col.IsButton) col.IsVisible = false;
if (col.Text == "FR" || col.Text == "GT" || col.Text == "KT") col.IsVisible = false;
break;
case BenutzerRolle.Admin:
break;
case BenutzerRolle.Waschstrasse:
break;
case BenutzerRolle.Master:
break;
case BenutzerRolle.Expedit:
break;
case BenutzerRolle.Frottee:
if (col.Text == "Etikett" & col.IsButton) col.IsVisible = false;
break;
case BenutzerRolle.Flach:
break;
default:
break;
}
}
this.objectListViewAuftrag.RebuildColumns();
this.ResumeLayout(false);
}
private void objectListViewAuftrag_CellEditFinished(object sender, CellEditEventArgs e)
{
Auftrag auftrag = (Auftrag)e.RowObject;
@ -1018,6 +934,7 @@ namespace Deckungsbeitrag
if (_kunde.Save() != 1) meldung.GetFehler(this, $"Der Kunde {name} konnte nicht gespeichert und die Aufgabe nicht entfernt werden. Melde das bitte deinem Vorgesetzten.");
}
/// <summary>
/// Wird aufgerufen wenn ein Auftrag Fertig ist und so gespeichert werden soll.
/// </summary>
@ -1236,9 +1153,10 @@ namespace Deckungsbeitrag
_settings.OLV_State = this.objectListViewAuftrag.SaveState();
_settings.Save();
}
private void FormExpedit_Resize(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
int chartHeight = (int)(this.tabControlAuftragList.Height * 0.75);
int gbHeight = (int)(this.tabControlAuftragList.Height * 0.25);
@ -1247,58 +1165,25 @@ namespace Deckungsbeitrag
groupBoxKndInfo.Height = gbHeight;
groupBoxKndInfo.Location = new Point(chartFehlmenge.Left, chartHeight + 10);
}
private void FormExpedit_Shown(object sender, EventArgs e)
{
this.ResumeLayout();
//this.Cursor = Cursors.Default;
Application.UseWaitCursor = false;
WindowState = FormWindowState.Maximized;
}
/// <summary>
/// Male Border der GroupBox für Anmerkungen. Farbe wechseln wenn ROT schlecht.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void groupBoxKndInfo_Paint(object sender, PaintEventArgs e)
{
Funktionen.GetGroupBoxBoarder(groupBoxKndInfo, e);
}
private void FormExpedit_Shown(object sender, EventArgs e)
{
this.ResumeLayout();
this.Cursor = Cursors.Default;
WindowState = FormWindowState.Maximized;
}
private void buttonTourenListe_Click(object sender, EventArgs e)
{
List<Benutzer> fahrerliste = Benutzer.GetFahrerList();
Benutzer fahrer = new Benutzer();
FormBenutzerVW benutzerVW = new FormBenutzerVW(fahrerliste);
if (benutzerVW.ShowDialog() == DialogResult.OK)
{
fahrer = benutzerVW.user;
List<Auftrag> auftragliste = Auftrag.GetTourenListe(fahrer);
if (fahrer != null) Funktionen.TourenListe_Drucken(auftragliste, fahrer, this);
}
}
}
}
//INSTALL-REMINDER: Spalte Abteilungen in Auftrag muss in Wirl_DB_17012023 eingefügt werden.
//CHANGES: Expedit hat Button für Reklamation statt Nachwäsche. Dadurch kann Mirka die Reklamation bearbeiten und eingeben. (AKTUELL NUR MIRKA)
//CHANGES: Frottee Expedit zeigt Aufträge die bei Frottee nicht Beendet wurden.
//CHANGES: Frottee Expedit alle Buttons werden ausgeblendet.
//CHANGES: Chart statt GridView für Fehlmengen.
//CHANGES: Bei DoppelClick auf Kundename wird KundenVW geöffnet.
//CHANGES: Es wird der zuständige Fahrer angezeigt. ToolTip zeigt den Grund falls vorhanden(Bei Sonderzuteilung).
//CHANGES: Geschäftaufträge werden in neuem Tab angezeigt.
//CHANGES: Kundeneingabe mit ? fügt einmaligen Kundenname als ZusatzInfo hinzu und wählt Kunde BAR DIVERSE 2320000
//CHANGES: Highlightfarbe bleibt auch wenn unfocused. (Farbe ändern?)
//CHANGES: Sortierte Spalte hat leicht andere Farbe. (Besser zu erkennen wonach sortiert wird)
//CHANGES: Als zweite Sortierung wird immer der Liefertag gewählt.
//CHANGES: Rechtsklick auf Spaltenheader ermöglicht Filtern.
//CHANGES: Wenn HEUTE als Liefertag gewählt, kommt Frage ob heute oder in einer Woche. Wenn JA dann HEUTE.
//CHANGES: Bearbeiten in ObjectListView möglich. (Kundename wird aber zurückgesetzt)
//CHANGES: Wenn Doppelklick auf Zelle, wird gefragt ob bearbeiten wirklich gewollt. Sonst wird blockiert.
//CHANGES: GroupBox nicht mehr notwendig. Etikette Druck über ObjectListView.
//CHANGES: Datumfilter funktioniert.
//CHANGES: Keine Timer da Probleme mit DB-Connection. DataGridView wird neu geladen wenn Auftrag neu gewählt wird.
//CHANGES: ObjectListView speichert Status automatisch beim schließen des Fensters und läd wieder wenn neu gestartet wird.
//CHANGES: AbteilungsStatus ist implementiert.
//CHANGES: Aus und Einblenden der Nachwäsche möglich.
//CHANGES: Suchen eines Auftrags mit Scan möglich.
//TODO: Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten)
//DONE: Etikett GroupBox entfernen. Änderungen direkt in ObjectListView vornehmen PrintPreview für Etikett.
//DONE: Etikett Drucken als Button in Row. Dann Vorschau anzeigen und Drucken.
//DONE: StartUp von Expedit verfeinern.
//DONE: Einmalige Kunden für Geschäft ermöglichen
//DONE: Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten)

View File

@ -20,7 +20,7 @@ namespace Deckungsbeitrag
public Auftrag Auftrag;
public List<FahrerAuftrag> fahrerauftragliste;
private ListViewItem.ListViewSubItem _currentsubitem = null;
Color Wirlblau = Color.FromArgb(1, 53, 101);
Color Wirlblau = Program.Wirlblau;
ToolTip toolTip1 = new ToolTip();
public FormFahrerScreen()
{

View File

@ -52,7 +52,7 @@ namespace Deckungsbeitrag
private void FormFehlmengeCount_Load(object sender, EventArgs e)
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
this.Text = " Version: " + Assembly.GetExecutingAssembly().GetName().Version;
this.Text = " Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
//Kunde wird durch Scan oder Handeingabe Ausgewählt.
//this.kunde = Funktionen.KundenAuswahl();
@ -101,7 +101,7 @@ namespace Deckungsbeitrag
this.artikelListe = KundeArtikel.GetList(kunde.KundeID.ToString());
this.textBoxScann.Text = this.kunde.KundeNummer;
this.textBoxScann.Enabled = false;
if (userid.Contains("reklamation") || (this.benutzer != null & this.benutzer.Rolle == BenutzerRolle.Expedit)) Reklamation_GroupBox();
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit)) Reklamation_GroupBox();
else GroupBox_Load();
if (kunde.Aufgabe != null)
@ -111,15 +111,16 @@ namespace Deckungsbeitrag
}
}
if(this.benutzer == null || !userid.Contains("reklamation"))
if (auftrag != null)
{
// AbteilungsStatus Begonnen wird hier gesetzt.
if (userid.Contains("kleinteile")) { auftrag.Abteilungen |= AbteilungsStatus.KleinteileBegonnen; auftrag.Save(); }
if (userid.Contains("grossteile")) { auftrag.Abteilungen |= AbteilungsStatus.GrossteileBegonnen; auftrag.Save(); }
if (userid.Contains("frottee") || userid.Contains("spannleintuch")) { auftrag.Abteilungen |= AbteilungsStatus.FrotteeBegonnen; auftrag.Save(); }
if (this.benutzer == null | (userid != null && !userid.Contains("reklamation")))
{
// AbteilungsStatus Begonnen wird hier gesetzt.
if (userid.Contains("kleinteile")) { auftrag.Abteilungen |= AbteilungsStatus.KleinteileBegonnen; auftrag.Save(); }
if (userid.Contains("grossteile")) { auftrag.Abteilungen |= AbteilungsStatus.GrossteileBegonnen; auftrag.Save(); }
if (userid.Contains("frottee") || userid.Contains("spannleintuch")) { auftrag.Abteilungen |= AbteilungsStatus.FrotteeBegonnen; auftrag.Save(); }
}
}
CloseKeyboard();
}
@ -371,7 +372,7 @@ namespace Deckungsbeitrag
}
}
if (userid.Contains("reklamation") || (this.benutzer != null & this.benutzer.Rolle == BenutzerRolle.Expedit))
if (userid.Contains("reklamation") || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit))
{
DialogResult result = meldung.GetFrage(this, "Möchtest du eine weitere Reklamation eingeben?", false);
switch (result)
@ -407,7 +408,7 @@ namespace Deckungsbeitrag
if (userid.Contains("reklamation") || (this.benutzer != null & this.benutzer.Rolle == BenutzerRolle.Expedit)) auftragsliste = null;
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit)) auftragsliste = null;
else auftragsliste = new List<object>(Auftrag.GetFinishingList());
FormListe liste = new FormListe(auftragsliste, 0);
@ -481,7 +482,8 @@ namespace Deckungsbeitrag
// Beim geklickten Artikel wird Fehlmenge erhöht
Button btn = (Button)sender;
KundeArtikel artstand = (KundeArtikel)btn.Tag;
if (userid.Contains("reklamation") || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit)) artstand.Reklamation++;
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit)) artstand.Reklamation++;
else { artstand.Fehlmenge++; artstand.Save(); return; }
// Wenn speichern nicht möglich, wird darauf hingewiesen.
@ -496,15 +498,9 @@ namespace Deckungsbeitrag
}
private void textBoxScann_Enter(object sender, EventArgs e)
{
//GetKunde();
}
}
}
//CHANGES: Wenn BenutzerRolle ist Expedit wird abgefragt ob weitere Reklamation eingegeben wird.
//CHANGES: Wenn BenutzerRolle ist Expedit wird statt Fehlmenge Reklamation erhöht.
//TODO: Wenn Frottee-Expedit auch Relamation bearbeitet, muss BenutzerRolle abgefragt werden. siehe CHANGES.
//DONE: Auftrag über FormListe holen und daraus den Kunden für Fehlmenge holen.
//DONE: Logik überlegen wie ein bearbeiteter Auftrag nicht doppelt gewählt werden kann. (Abteilungen zu Auftrag hinzufügen und bei Ausschlager Druck definieren?)

View File

@ -80,7 +80,10 @@ namespace Deckungsbeitrag
if (this.kunde == null) this.kunde = Funktionen.KundenAuswahl();
DatenLesen();
if (this.kunde != null) DatenLesen();
else this.Close();
formloading = false;
}
@ -132,6 +135,10 @@ namespace Deckungsbeitrag
if (KundeArtikel.GetList(kundeid).Count > 0)
{
this.standListe = KundeArtikel.GetList(kundeid);
if (this.standListe[0].ArtikelID == null || this.standListe[0].Reihung == 0)
{
CompareToSortiment(sortNr);
}
Load_Gridview(this.standListe);
}
@ -143,17 +150,23 @@ namespace Deckungsbeitrag
//Sortiment holen und Standliste filtern.
standListe = new List<KundeArtikel>();
foreach(Sortiment sort in sortimentListe.FindAll(Sortiment => Sortiment.KundeNummer == sortNr))
int reihung = 1;
foreach(Sortiment sort in sortimentListe.FindAll(Sortiment => Sortiment.KundeNummer == sortNr))
{
KundeArtikel item = new KundeArtikel();
item.ArtikelNR = sort.ArtNr;
item.ArtikelName = sort.ArtName;
item.KundeID = Kunde.GetKundeID(sort.KundeNummer, null);
item.ArtikelID = Artikel.GetArtikelID(sort.ArtNr);
item.Reihung = reihung;
standListe.Add(item);
}
//GridView mit der jeweiligen Liste füllen.
Load_Gridview(this.standListe);
reihung++;
}
standListe = standListe.OrderBy(x => x.Reihung).ToList();
//GridView mit der jeweiligen Liste füllen.
Load_Gridview(standListe);
}
// QR-Code wird erstellt
@ -207,6 +220,24 @@ namespace Deckungsbeitrag
Chart_Load();
}
private void CompareToSortiment(string sortNr)
{
int reihung = 1;
Kunde _kunde = Kunde.GetKunde(null, this.standListe[0].KundeID, null);
foreach (Sortiment sort in sortimentListe.FindAll(Sortiment => Sortiment.KundeNummer == _kunde.KundeNummer))
{
KundeArtikel kndart = this.standListe.Find(s => s.ArtikelNR == sort.ArtNr);
kndart.ArtikelID = Artikel.GetArtikelID(sort.ArtNr);
kndart.Reihung = reihung;
kndart.Save();
reihung++;
}
this.standListe = this.standListe.OrderBy(x => x.Reihung).ToList();
}
/// <summary>
/// TextBox Events
/// </summary>
@ -568,3 +599,5 @@ namespace Deckungsbeitrag
}
}
//INSTALL-REMINDER: Tabelle KundeArtikel Spalten ArtikelID und Reihung hinzufügen.
//CHANGES: KundeArtikel wird mit Reihung gespeichert und angezeigt.

View File

@ -63,6 +63,7 @@ namespace Deckungsbeitrag
this.tabControlKunde = new System.Windows.Forms.TabControl();
this.tabPageVorschau = new System.Windows.Forms.TabPage();
this.buttonSWS_Drucken = new System.Windows.Forms.Button();
this.pictureBoxEntwurf = new System.Windows.Forms.PictureBox();
this.tabPageUmsatz = new System.Windows.Forms.TabPage();
this.labelMonatsumsatz = new System.Windows.Forms.Label();
this.chartMonatsumsatz = new System.Windows.Forms.DataVisualization.Charting.Chart();
@ -76,6 +77,17 @@ namespace Deckungsbeitrag
this.tabPageArtikel = new System.Windows.Forms.TabPage();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.dGArtikel = new System.Windows.Forms.DataGridView();
this.KundeArtikelID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KundeID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ArtikelNR = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ArtikelName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Stand = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Fehlmenge = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Reklamation = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Korrektur = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FehlmengeBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KorrekturBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonNextKunde = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.comboBoxService = new System.Windows.Forms.ComboBox();
@ -89,23 +101,12 @@ namespace Deckungsbeitrag
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.buttonServiceBearbeiten = new System.Windows.Forms.Button();
this.pictureBoxEntwurf = new System.Windows.Forms.PictureBox();
this.buttonAufgEnt = new System.Windows.Forms.Button();
this.pictureBoxQRCode = new System.Windows.Forms.PictureBox();
this.KundeArtikelID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KundeID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ArtikelNR = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ArtikelName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Stand = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Fehlmenge = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Reklamation = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Korrektur = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FehlmengeBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KorrekturBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.contextMenuStrip1.SuspendLayout();
this.tabControlKunde.SuspendLayout();
this.tabPageVorschau.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxEntwurf)).BeginInit();
this.tabPageUmsatz.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chartMonatsumsatz)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.olvMonatsumsatz)).BeginInit();
@ -116,7 +117,6 @@ namespace Deckungsbeitrag
this.tabPageArtikel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownAufgabeCount)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxEntwurf)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxQRCode)).BeginInit();
this.SuspendLayout();
//
@ -369,6 +369,20 @@ namespace Deckungsbeitrag
this.buttonSWS_Drucken.UseVisualStyleBackColor = false;
this.buttonSWS_Drucken.Click += new System.EventHandler(this.ButtonDrucken_Click);
//
// pictureBoxEntwurf
//
this.pictureBoxEntwurf.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxEntwurf.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.pictureBoxEntwurf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxEntwurf.Location = new System.Drawing.Point(0, 0);
this.pictureBoxEntwurf.Name = "pictureBoxEntwurf";
this.pictureBoxEntwurf.Size = new System.Drawing.Size(925, 647);
this.pictureBoxEntwurf.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxEntwurf.TabIndex = 16;
this.pictureBoxEntwurf.TabStop = false;
//
// tabPageUmsatz
//
this.tabPageUmsatz.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
@ -612,6 +626,63 @@ namespace Deckungsbeitrag
this.dGArtikel.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dGArtikel_CellBeginEdit);
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellValueChanged);
//
// KundeArtikelID
//
this.KundeArtikelID.HeaderText = "KundeArtikelID";
this.KundeArtikelID.Name = "KundeArtikelID";
this.KundeArtikelID.Visible = false;
//
// KundeID
//
this.KundeID.HeaderText = "KundeID";
this.KundeID.Name = "KundeID";
this.KundeID.Visible = false;
//
// ArtikelNR
//
this.ArtikelNR.HeaderText = "Art. Nr.";
this.ArtikelNR.Name = "ArtikelNR";
//
// ArtikelName
//
this.ArtikelName.HeaderText = "Art. Name";
this.ArtikelName.Name = "ArtikelName";
//
// Stand
//
this.Stand.HeaderText = "Stand";
this.Stand.Name = "Stand";
//
// Fehlmenge
//
this.Fehlmenge.HeaderText = "Fehlmenge";
this.Fehlmenge.Name = "Fehlmenge";
//
// Reklamation
//
this.Reklamation.HeaderText = "Reklamation";
this.Reklamation.Name = "Reklamation";
//
// Korrektur
//
this.Korrektur.HeaderText = "Korrektur";
this.Korrektur.Name = "Korrektur";
//
// StandBearbeitet
//
this.StandBearbeitet.HeaderText = "Stand Bearbeitet";
this.StandBearbeitet.Name = "StandBearbeitet";
//
// FehlmengeBearbeitet
//
this.FehlmengeBearbeitet.HeaderText = "Fehlmenge Bearbeitet";
this.FehlmengeBearbeitet.Name = "FehlmengeBearbeitet";
//
// KorrekturBearbeitet
//
this.KorrekturBearbeitet.HeaderText = "Korrektur Bearbeitet";
this.KorrekturBearbeitet.Name = "KorrekturBearbeitet";
//
// buttonNextKunde
//
this.buttonNextKunde.BackColor = System.Drawing.Color.Turquoise;
@ -657,6 +728,7 @@ namespace Deckungsbeitrag
this.textBoxAnmerkung.MaxLength = 200;
this.textBoxAnmerkung.Multiline = true;
this.textBoxAnmerkung.Name = "textBoxAnmerkung";
this.textBoxAnmerkung.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxAnmerkung.Size = new System.Drawing.Size(352, 141);
this.textBoxAnmerkung.TabIndex = 50;
this.textBoxAnmerkung.TextChanged += new System.EventHandler(this.textBoxAnmerkung_TextChanged);
@ -764,20 +836,6 @@ namespace Deckungsbeitrag
this.buttonServiceBearbeiten.UseVisualStyleBackColor = true;
this.buttonServiceBearbeiten.Click += new System.EventHandler(this.buttonServiceBearbeiten_Click);
//
// pictureBoxEntwurf
//
this.pictureBoxEntwurf.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxEntwurf.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.pictureBoxEntwurf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxEntwurf.Location = new System.Drawing.Point(0, 0);
this.pictureBoxEntwurf.Name = "pictureBoxEntwurf";
this.pictureBoxEntwurf.Size = new System.Drawing.Size(925, 647);
this.pictureBoxEntwurf.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxEntwurf.TabIndex = 16;
this.pictureBoxEntwurf.TabStop = false;
//
// buttonAufgEnt
//
this.buttonAufgEnt.Image = global::Deckungsbeitrag.Properties.Resources.Close_red_16x;
@ -798,63 +856,6 @@ namespace Deckungsbeitrag
this.pictureBoxQRCode.TabIndex = 27;
this.pictureBoxQRCode.TabStop = false;
//
// KundeArtikelID
//
this.KundeArtikelID.HeaderText = "KundeArtikelID";
this.KundeArtikelID.Name = "KundeArtikelID";
this.KundeArtikelID.Visible = false;
//
// KundeID
//
this.KundeID.HeaderText = "KundeID";
this.KundeID.Name = "KundeID";
this.KundeID.Visible = false;
//
// ArtikelNR
//
this.ArtikelNR.HeaderText = "Art. Nr.";
this.ArtikelNR.Name = "ArtikelNR";
//
// ArtikelName
//
this.ArtikelName.HeaderText = "Art. Name";
this.ArtikelName.Name = "ArtikelName";
//
// Stand
//
this.Stand.HeaderText = "Stand";
this.Stand.Name = "Stand";
//
// Fehlmenge
//
this.Fehlmenge.HeaderText = "Fehlmenge";
this.Fehlmenge.Name = "Fehlmenge";
//
// Reklamation
//
this.Reklamation.HeaderText = "Reklamation";
this.Reklamation.Name = "Reklamation";
//
// Korrektur
//
this.Korrektur.HeaderText = "Korrektur";
this.Korrektur.Name = "Korrektur";
//
// StandBearbeitet
//
this.StandBearbeitet.HeaderText = "Stand Bearbeitet";
this.StandBearbeitet.Name = "StandBearbeitet";
//
// FehlmengeBearbeitet
//
this.FehlmengeBearbeitet.HeaderText = "Fehlmenge Bearbeitet";
this.FehlmengeBearbeitet.Name = "FehlmengeBearbeitet";
//
// KorrekturBearbeitet
//
this.KorrekturBearbeitet.HeaderText = "Korrektur Bearbeitet";
this.KorrekturBearbeitet.Name = "KorrekturBearbeitet";
//
// FormKundeVW
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -897,16 +898,18 @@ namespace Deckungsbeitrag
this.Controls.Add(this.textBoxKundeName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(962, 800);
this.MinimumSize = new System.Drawing.Size(962, 670);
this.Name = "FormKundeVW";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "KUNDENVERWALTUNG";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormKundeVW_FormClosing);
this.Load += new System.EventHandler(this.KundeDaten_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.KundeDaten_KeyDown);
this.contextMenuStrip1.ResumeLayout(false);
this.tabControlKunde.ResumeLayout(false);
this.tabPageVorschau.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxEntwurf)).EndInit();
this.tabPageUmsatz.ResumeLayout(false);
this.tabPageUmsatz.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.chartMonatsumsatz)).EndInit();
@ -918,7 +921,6 @@ namespace Deckungsbeitrag
this.tabPageArtikel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownAufgabeCount)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxEntwurf)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxQRCode)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -47,6 +47,7 @@ namespace Deckungsbeitrag
string progFiles = @"C:\Program Files\Common Files\Microsoft Shared\ink";
string keyboardPath;
private Timer timer;
private string kndService;
#region Form-Konstruktor
@ -81,6 +82,10 @@ namespace Deckungsbeitrag
}
}
}
public FormListe(List<object> objliste, int listentyp, string kndService) : this(objliste, listentyp)
{
this.kndService = kndService;
}
#endregion
private void FormListe_Load(object sender, EventArgs e)
@ -112,32 +117,38 @@ namespace Deckungsbeitrag
switch (type_of_list)
{
case var kndliste when type_of_list == (int)Listentyp.Kundenliste:
{
{
//SPALTEN ERSTELLEN UND EINFÜGEN
string[] colname = knd_col.Split(',');
foreach (string s in colname)
{
ColumnHeader ch = new ColumnHeader();
ch.Text = s;
string[] colname = knd_col.Split(',');
foreach (string s in colname)
{
ColumnHeader ch = new ColumnHeader();
ch.Text = s;
this.listViewKunde.Columns.Add(ch);
}
this.listViewKunde.Columns.Add(ch);
}
//KUNDEN LADEN
this.Text = "KUNDE WÄHLEN";
if (this.Kundenliste == null) this.Kundenliste = Kunde.GetTmpList(string.Empty);
foreach (Kunde kunde in this.Kundenliste)
{
ListViewItem item = new ListViewItem();
item.Tag = kunde;
item.Text = kunde.KundeNummer;
this.Text = "KUNDE WÄHLEN";
if (this.Kundenliste == null) this.Kundenliste = Kunde.GetTmpList(string.Empty, kndService);
foreach (Kunde kunde in this.Kundenliste)
{
ListViewItem item = new ListViewItem();
item.Tag = kunde;
item.Text = kunde.KundeNummer;
item.SubItems.Add(kunde.Suchtext);
item.SubItems.Add(kunde.KundeName);
item.SubItems.Add(kunde.Ort);
item.SubItems.Add(kunde.KundeName);
item.SubItems.Add(kunde.Ort);
this.listViewKunde.Items.Add(item);
}
if (listViewKunde.Items.Count == 1)
{
kunde = (Kunde)listViewKunde.Items[0].Tag;
this.DialogResult = DialogResult.OK;
this.Close();
this.listViewKunde.Items.Add(item);
}
if (listViewKunde.Items.Count == 1) kunde = (Kunde)listViewKunde.Items[0].Tag;
this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false;
this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false;
}
break;
case var aufliste when type_of_list == (int)Listentyp.Aufgabenliste:
@ -202,7 +213,16 @@ namespace Deckungsbeitrag
this.listViewKunde.Items.Add(item);
}
this.textBoxKunde.Enabled = false;
break;
if (listViewKunde.Items.Count == 1)
{
auftrag = (Auftrag)listViewKunde.Items[0].Tag;
this.DialogResult = DialogResult.OK;
this.Close();
}
this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false;
break;
case var finishliste when type_of_list == (int)Listentyp.Finishingliste:
//SPALTEN ERSTELLEN UND EINFÜGEN
string[] colname1 = knd_col.Split(',');
@ -228,10 +248,15 @@ namespace Deckungsbeitrag
this.listViewKunde.Items.Add(item);
}
if (listViewKunde.Items.Count == 1) kunde = (Kunde)listViewKunde.Items[0].Tag;
this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false;
if (listViewKunde.Items.Count == 1)
{
kunde = (Kunde)listViewKunde.Items[0].Tag;
this.DialogResult = DialogResult.OK;
this.Close();
}
this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false;
break;
break;
default:
break;
}
@ -274,13 +299,25 @@ namespace Deckungsbeitrag
private void Timer_Tick(object sender, EventArgs e)
{
timer.Stop(); // Timer stoppen
string text = string.Empty;
if (string.IsNullOrEmpty(textBoxKunde.Text)) { return; }
// Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt.
if (!textBoxKunde.Text.StartsWith("?"))
{
this.Kundenliste = Kunde.GetTmpList(this.textBoxKunde.Text);
if (textBoxKunde.Text.StartsWith("http"))
{
int index = 1;
int i = 0;
index += textBoxKunde.Text.IndexOf("=", index);
i = textBoxKunde.Text.IndexOf("%", index);
text = textBoxKunde.Text.Substring(index, i - index);
textBoxKunde.Text = text;
}
else text = this.textBoxKunde.Text;
this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
listViewKunde_Load();
return;
}

View File

@ -1,16 +1,17 @@
using System;
using DatenDB;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Security.Cryptography;
using DatenDB;
using System.Threading;
using System.Diagnostics;
namespace Deckungsbeitrag
{
@ -47,15 +48,18 @@ namespace Deckungsbeitrag
{
case -1:
MessageBox.Show(lex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
Program.AddFehler(null, lex.Message, null, DateTime.Now.ToString("dd.MM.yyyy-HH-mm"));
this.buttonRegistrieren.Visible = false;
break;
case -2:
MessageBox.Show(lex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.buttonRegistrieren.Visible = false;
Program.AddFehler(null, lex.Message, null, DateTime.Now.ToString("dd.MM.yyyy-HH-mm"));
this.buttonRegistrieren.Visible = false;
break;
case -3:
MessageBox.Show(lex.Message, "Registrieren", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.buttonRegistrieren.Visible = true;
Program.AddFehler(null, lex.Message, null, DateTime.Now.ToString("dd.MM.yyyy-HH-mm"));
this.buttonRegistrieren.Visible = true;
this.buttonAnmelden.Enabled = false;
this.groupBox1.Height = 146;
this.Height = 265;
@ -64,7 +68,8 @@ namespace Deckungsbeitrag
break;
case -4:
MessageBox.Show(lex.Message, "Server Fehler", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
break;
Program.AddFehler(null, lex.Message, null, DateTime.Now.ToString("dd.MM.yyyy-HH-mm"));
break;
default:
break;
}
@ -75,23 +80,6 @@ namespace Deckungsbeitrag
MessageBox.Show(ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
CloseKeyboard();
}
private void CloseKeyboard()
{
foreach (var process in Process.GetProcessesByName("TabTip"))
{
try
{
process.Close();
}
catch (Exception es)
{
// Fehlerbehandlung falls Prozess nicht beendet werden kann
MessageBox.Show($"Fehler beim Schließen: " + es.Message);
}
}
}
private void buttonAbbrechen_Click(object sender, EventArgs e)
{
@ -120,7 +108,13 @@ namespace Deckungsbeitrag
this.textBoxPwdWh.Visible = false;
this.buttonRegistrieren.Visible = false;
this.textBoxPasswort.Text = this.textBoxPwdWh.Text = string.Empty;
MessageBox.Show($"Benutzer {this.textBoxBenutzer.Text} wurde erfolgreich angelegt!", "Hinweis", MessageBoxButtons.OK, MessageBoxIcon.Information);
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", "");
person.BenutzerName = eingabe;
if (person.Save() != 1) MessageBox.Show("Benutzername konnte nicht gespeichert werden. Melde dich bei deinem Vorgesetzten.", "SPEICHERFEHLER", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
this.textBoxBenutzer.Focus();
this.buttonAnmelden.Enabled = true;
}
}
@ -156,24 +150,25 @@ namespace Deckungsbeitrag
private void textBoxBenutzer_Enter(object sender, EventArgs e)
{
// Pfad zur Touch-Tastatur
keyboardPath = System.IO.Path.Combine(progFiles, "TabTip.exe");
this.textBoxBenutzer.SelectAll();
// Bildschirmtastatur starten
Process.Start(keyboardPath);
//// Pfad zur Touch-Tastatur
//keyboardPath = System.IO.Path.Combine(progFiles, "TabTip.exe");
//// Bildschirmtastatur starten
//Process.Start(keyboardPath);
}
private void textBoxPasswort_Enter(object sender, EventArgs e)
{
// Pfad zur Touch-Tastatur
keyboardPath = System.IO.Path.Combine(progFiles, "TabTip.exe");
//// Pfad zur Touch-Tastatur
//keyboardPath = System.IO.Path.Combine(progFiles, "TabTip.exe");
// Bildschirmtastatur starten
Process.Start(keyboardPath);
//// Bildschirmtastatur starten
//Process.Start(keyboardPath);
}
private void textBox_Leave(object sender, EventArgs e)
{
CloseKeyboard();
}
}
}

View File

@ -44,9 +44,16 @@ namespace Deckungsbeitrag
this.tSBHilfe = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonImport = new System.Windows.Forms.ToolStripButton();
this.tSBEinstellung = new System.Windows.Forms.ToolStripButton();
this.tSBWaschstrasse = new System.Windows.Forms.ToolStripButton();
this.tSBTourenplanung = new System.Windows.Forms.ToolStripButton();
this.toolStripBeenden = new System.Windows.Forms.ToolStripButton();
this.panelMain = new System.Windows.Forms.Panel();
this.buttonNeuerRegAuft = new System.Windows.Forms.Button();
this.panelProgress = new System.Windows.Forms.Panel();
this.buttonKundeArtikelUpdate = new System.Windows.Forms.Button();
this.progressBarKundeArtikelUpdate = new System.Windows.Forms.ProgressBar();
this.labelProgress = new System.Windows.Forms.Label();
this.buttonTourenliste = new System.Windows.Forms.Button();
this.groupBoxContAnz = new System.Windows.Forms.GroupBox();
this.tLPContAnz = new System.Windows.Forms.TableLayoutPanel();
this.label14 = new System.Windows.Forms.Label();
@ -100,11 +107,12 @@ namespace Deckungsbeitrag
this.labelStatistik1 = new System.Windows.Forms.Label();
this.groupBoxUpdate = new System.Windows.Forms.GroupBox();
this.tableLayoutPanelUpdate = new System.Windows.Forms.TableLayoutPanel();
this.progressBarSortiment = new System.Windows.Forms.ProgressBar();
this.buttonSortimentUpdate = new System.Windows.Forms.Button();
this.buttonArtikelUpdate = new System.Windows.Forms.Button();
this.progressBarArtikel = new System.Windows.Forms.ProgressBar();
this.buttonAllUpdate = new System.Windows.Forms.Button();
this.labelSoftwareDatum = new System.Windows.Forms.Label();
this.labelArtikelDatum = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.labelKundenDatum = new System.Windows.Forms.Label();
this.groupBoxAuftrag = new System.Windows.Forms.GroupBox();
this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView();
this.rBAufAbruf = new System.Windows.Forms.RadioButton();
@ -121,6 +129,7 @@ namespace Deckungsbeitrag
this.labelScannTest = new System.Windows.Forms.Label();
this.toolStripMenu.SuspendLayout();
this.panelMain.SuspendLayout();
this.panelProgress.SuspendLayout();
this.groupBoxContAnz.SuspendLayout();
this.tLPContAnz.SuspendLayout();
this.groupBoxSaison.SuspendLayout();
@ -155,6 +164,7 @@ namespace Deckungsbeitrag
this.tSBHilfe,
this.toolStripButtonImport,
this.tSBEinstellung,
this.tSBWaschstrasse,
this.tSBTourenplanung,
this.toolStripBeenden});
this.toolStripMenu.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
@ -414,6 +424,26 @@ namespace Deckungsbeitrag
this.tSBEinstellung.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.tSBEinstellung.Click += new System.EventHandler(this.tSBEinstellung_Click);
//
// tSBWaschstrasse
//
this.tSBWaschstrasse.AutoSize = false;
this.tSBWaschstrasse.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.tSBWaschstrasse.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.tSBWaschstrasse.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tSBWaschstrasse.ForeColor = System.Drawing.Color.White;
this.tSBWaschstrasse.Image = ((System.Drawing.Image)(resources.GetObject("tSBWaschstrasse.Image")));
this.tSBWaschstrasse.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.tSBWaschstrasse.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tSBWaschstrasse.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tSBWaschstrasse.Name = "tSBWaschstrasse";
this.tSBWaschstrasse.Size = new System.Drawing.Size(180, 40);
this.tSBWaschstrasse.Text = "STATUS RAMPE";
this.tSBWaschstrasse.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.tSBWaschstrasse.Click += new System.EventHandler(this.tSBWaschstrasse_Click);
this.tSBWaschstrasse.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter);
this.tSBWaschstrasse.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave);
this.tSBWaschstrasse.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint);
//
// tSBTourenplanung
//
this.tSBTourenplanung.AutoSize = false;
@ -457,7 +487,13 @@ namespace Deckungsbeitrag
// panelMain
//
this.panelMain.AllowDrop = true;
this.panelMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelMain.BackColor = System.Drawing.Color.White;
this.panelMain.Controls.Add(this.buttonNeuerRegAuft);
this.panelMain.Controls.Add(this.panelProgress);
this.panelMain.Controls.Add(this.buttonTourenliste);
this.panelMain.Controls.Add(this.groupBoxContAnz);
this.panelMain.Controls.Add(this.groupBoxSaison);
this.panelMain.Controls.Add(this.buttonNeuerStand);
@ -469,25 +505,126 @@ namespace Deckungsbeitrag
this.panelMain.Controls.Add(this.groupBoxUpdate);
this.panelMain.Controls.Add(this.groupBoxAuftrag);
this.panelMain.Controls.Add(this.groupBoxScannTest);
this.panelMain.Dock = System.Windows.Forms.DockStyle.Right;
this.panelMain.Location = new System.Drawing.Point(218, 0);
this.panelMain.Margin = new System.Windows.Forms.Padding(2);
this.panelMain.Name = "panelMain";
this.panelMain.Size = new System.Drawing.Size(938, 689);
this.panelMain.Size = new System.Drawing.Size(1063, 689);
this.panelMain.TabIndex = 5;
this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMain_Paint);
this.panelMain.Resize += new System.EventHandler(this.panelMain_Resize);
//
// buttonNeuerRegAuft
//
this.buttonNeuerRegAuft.BackColor = System.Drawing.Color.DarkSlateGray;
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.White;
this.buttonNeuerRegAuft.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerRegAuft.Location = new System.Drawing.Point(790, 14);
this.buttonNeuerRegAuft.Margin = new System.Windows.Forms.Padding(5);
this.buttonNeuerRegAuft.Name = "buttonNeuerRegAuft";
this.buttonNeuerRegAuft.Size = new System.Drawing.Size(250, 41);
this.buttonNeuerRegAuft.TabIndex = 71;
this.buttonNeuerRegAuft.Text = "Regelmäßiger Auftrag";
this.buttonNeuerRegAuft.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeuerRegAuft.UseVisualStyleBackColor = false;
this.buttonNeuerRegAuft.Visible = false;
this.buttonNeuerRegAuft.Click += new System.EventHandler(this.buttonRegAuftrag_Click);
//
// panelProgress
//
this.panelProgress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panelProgress.BackColor = System.Drawing.Color.LightGray;
this.panelProgress.Controls.Add(this.buttonKundeArtikelUpdate);
this.panelProgress.Controls.Add(this.progressBarKundeArtikelUpdate);
this.panelProgress.Controls.Add(this.labelProgress);
this.panelProgress.Enabled = false;
this.panelProgress.Location = new System.Drawing.Point(806, 639);
this.panelProgress.Name = "panelProgress";
this.panelProgress.Size = new System.Drawing.Size(250, 41);
this.panelProgress.TabIndex = 70;
this.panelProgress.Visible = false;
//
// buttonKundeArtikelUpdate
//
this.buttonKundeArtikelUpdate.BackColor = System.Drawing.SystemColors.Control;
this.buttonKundeArtikelUpdate.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonKundeArtikelUpdate.Enabled = false;
this.buttonKundeArtikelUpdate.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonKundeArtikelUpdate.FlatAppearance.BorderSize = 0;
this.buttonKundeArtikelUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonKundeArtikelUpdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonKundeArtikelUpdate.ForeColor = System.Drawing.Color.Black;
this.buttonKundeArtikelUpdate.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonKundeArtikelUpdate.Location = new System.Drawing.Point(0, 0);
this.buttonKundeArtikelUpdate.Margin = new System.Windows.Forms.Padding(5);
this.buttonKundeArtikelUpdate.Name = "buttonKundeArtikelUpdate";
this.buttonKundeArtikelUpdate.Size = new System.Drawing.Size(250, 41);
this.buttonKundeArtikelUpdate.TabIndex = 67;
this.buttonKundeArtikelUpdate.Text = "KundeArtikel Update";
this.buttonKundeArtikelUpdate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonKundeArtikelUpdate.UseVisualStyleBackColor = false;
this.buttonKundeArtikelUpdate.Visible = false;
this.buttonKundeArtikelUpdate.Click += new System.EventHandler(this.buttonKundeArtikelUpdate_Click);
//
// progressBarKundeArtikelUpdate
//
this.progressBarKundeArtikelUpdate.Dock = System.Windows.Forms.DockStyle.Fill;
this.progressBarKundeArtikelUpdate.Location = new System.Drawing.Point(0, 0);
this.progressBarKundeArtikelUpdate.Name = "progressBarKundeArtikelUpdate";
this.progressBarKundeArtikelUpdate.Size = new System.Drawing.Size(250, 41);
this.progressBarKundeArtikelUpdate.TabIndex = 68;
//
// labelProgress
//
this.labelProgress.BackColor = System.Drawing.Color.Transparent;
this.labelProgress.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProgress.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelProgress.Location = new System.Drawing.Point(0, 0);
this.labelProgress.Name = "labelProgress";
this.labelProgress.Size = new System.Drawing.Size(250, 41);
this.labelProgress.TabIndex = 69;
this.labelProgress.Text = "KundeArtikel Update";
this.labelProgress.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labelProgress.Visible = false;
//
// buttonTourenliste
//
this.buttonTourenliste.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.buttonTourenliste.Enabled = false;
this.buttonTourenliste.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonTourenliste.FlatAppearance.BorderSize = 0;
this.buttonTourenliste.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonTourenliste.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonTourenliste.ForeColor = System.Drawing.Color.Black;
this.buttonTourenliste.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonTourenliste.Location = new System.Drawing.Point(8, 65);
this.buttonTourenliste.Margin = new System.Windows.Forms.Padding(5);
this.buttonTourenliste.Name = "buttonTourenliste";
this.buttonTourenliste.Size = new System.Drawing.Size(250, 41);
this.buttonTourenliste.TabIndex = 66;
this.buttonTourenliste.Text = "Tourenliste drucken";
this.buttonTourenliste.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonTourenliste.UseVisualStyleBackColor = false;
this.buttonTourenliste.Visible = false;
this.buttonTourenliste.Click += new System.EventHandler(this.buttonTourenliste_Click);
//
// groupBoxContAnz
//
this.groupBoxContAnz.AutoSize = true;
this.groupBoxContAnz.Controls.Add(this.tLPContAnz);
this.groupBoxContAnz.Enabled = false;
this.groupBoxContAnz.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxContAnz.Location = new System.Drawing.Point(324, 57);
this.groupBoxContAnz.Location = new System.Drawing.Point(296, 251);
this.groupBoxContAnz.Name = "groupBoxContAnz";
this.groupBoxContAnz.Size = new System.Drawing.Size(305, 248);
this.groupBoxContAnz.TabIndex = 62;
this.groupBoxContAnz.TabStop = false;
this.groupBoxContAnz.Text = "CONT. ANZAHL / WASCHZEIT";
this.groupBoxContAnz.Visible = false;
this.groupBoxContAnz.GiveFeedback += new System.Windows.Forms.GiveFeedbackEventHandler(this.groupBox_GiveFeedback);
this.groupBoxContAnz.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox_Paint);
//
@ -893,13 +1030,15 @@ namespace Deckungsbeitrag
// groupBoxSaison
//
this.groupBoxSaison.Controls.Add(this.comboBoxSaison);
this.groupBoxSaison.Enabled = false;
this.groupBoxSaison.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxSaison.Location = new System.Drawing.Point(8, 457);
this.groupBoxSaison.Location = new System.Drawing.Point(8, 251);
this.groupBoxSaison.Name = "groupBoxSaison";
this.groupBoxSaison.Size = new System.Drawing.Size(279, 59);
this.groupBoxSaison.TabIndex = 62;
this.groupBoxSaison.TabStop = false;
this.groupBoxSaison.Text = "AKTIVE SAISON";
this.groupBoxSaison.Visible = false;
this.groupBoxSaison.GiveFeedback += new System.Windows.Forms.GiveFeedbackEventHandler(this.groupBox_GiveFeedback);
this.groupBoxSaison.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox_Paint);
//
@ -916,14 +1055,15 @@ namespace Deckungsbeitrag
//
// buttonNeuerStand
//
this.buttonNeuerStand.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.buttonNeuerStand.BackColor = System.Drawing.Color.CadetBlue;
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.White;
this.buttonNeuerStand.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerStand.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerStand.Location = new System.Drawing.Point(8, 116);
this.buttonNeuerStand.Location = new System.Drawing.Point(530, 14);
this.buttonNeuerStand.Margin = new System.Windows.Forms.Padding(5);
this.buttonNeuerStand.Name = "buttonNeuerStand";
this.buttonNeuerStand.Size = new System.Drawing.Size(250, 41);
@ -931,18 +1071,20 @@ namespace Deckungsbeitrag
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.Green;
this.buttonNeueInventur.BackColor = System.Drawing.Color.MediumTurquoise;
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.White;
this.buttonNeueInventur.ForeColor = System.Drawing.Color.Black;
this.buttonNeueInventur.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeueInventur.Location = new System.Drawing.Point(8, 65);
this.buttonNeueInventur.Location = new System.Drawing.Point(268, 14);
this.buttonNeueInventur.Margin = new System.Windows.Forms.Padding(5);
this.buttonNeueInventur.Name = "buttonNeueInventur";
this.buttonNeueInventur.Size = new System.Drawing.Size(250, 41);
@ -950,18 +1092,20 @@ namespace Deckungsbeitrag
this.buttonNeueInventur.Text = "Neue Inventur";
this.buttonNeueInventur.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeueInventur.UseVisualStyleBackColor = false;
this.buttonNeueInventur.Visible = false;
this.buttonNeueInventur.Click += new System.EventHandler(this.buttonNeueInventur_Click);
//
// buttonNeueAufgabe
//
this.buttonNeueAufgabe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.buttonNeueAufgabe.BackColor = System.Drawing.Color.Yellow;
this.buttonNeueAufgabe.Enabled = false;
this.buttonNeueAufgabe.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeueAufgabe.FlatAppearance.BorderSize = 0;
this.buttonNeueAufgabe.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeueAufgabe.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeueAufgabe.ForeColor = System.Drawing.Color.Black;
this.buttonNeueAufgabe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeueAufgabe.Location = new System.Drawing.Point(8, 218);
this.buttonNeueAufgabe.Location = new System.Drawing.Point(8, 167);
this.buttonNeueAufgabe.Margin = new System.Windows.Forms.Padding(5);
this.buttonNeueAufgabe.Name = "buttonNeueAufgabe";
this.buttonNeueAufgabe.Size = new System.Drawing.Size(250, 41);
@ -969,16 +1113,18 @@ namespace Deckungsbeitrag
this.buttonNeueAufgabe.Text = "Neue Aufgabe";
this.buttonNeueAufgabe.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeueAufgabe.UseVisualStyleBackColor = false;
this.buttonNeueAufgabe.Visible = false;
this.buttonNeueAufgabe.Click += new System.EventHandler(this.buttonNeueAufgabe_Click);
//
// buttonNeuerAuftrag
//
this.buttonNeuerAuftrag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeuerAuftrag.BackColor = System.Drawing.Color.PaleTurquoise;
this.buttonNeuerAuftrag.Enabled = false;
this.buttonNeuerAuftrag.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0;
this.buttonNeuerAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeuerAuftrag.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerAuftrag.ForeColor = System.Drawing.Color.White;
this.buttonNeuerAuftrag.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerAuftrag.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerAuftrag.Location = new System.Drawing.Point(8, 14);
this.buttonNeuerAuftrag.Margin = new System.Windows.Forms.Padding(5);
@ -988,18 +1134,20 @@ namespace Deckungsbeitrag
this.buttonNeuerAuftrag.Text = "Neuer Auftrag";
this.buttonNeuerAuftrag.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeuerAuftrag.UseVisualStyleBackColor = false;
this.buttonNeuerAuftrag.Visible = false;
this.buttonNeuerAuftrag.Click += new System.EventHandler(this.buttonNeuerAuftrag_Click);
//
// buttonNeuerUser
//
this.buttonNeuerUser.BackColor = System.Drawing.Color.Yellow;
this.buttonNeuerUser.Enabled = false;
this.buttonNeuerUser.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.buttonNeuerUser.FlatAppearance.BorderSize = 0;
this.buttonNeuerUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNeuerUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonNeuerUser.ForeColor = System.Drawing.Color.Black;
this.buttonNeuerUser.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonNeuerUser.Location = new System.Drawing.Point(8, 167);
this.buttonNeuerUser.Location = new System.Drawing.Point(8, 116);
this.buttonNeuerUser.Margin = new System.Windows.Forms.Padding(5);
this.buttonNeuerUser.Name = "buttonNeuerUser";
this.buttonNeuerUser.Size = new System.Drawing.Size(250, 41);
@ -1007,6 +1155,7 @@ namespace Deckungsbeitrag
this.buttonNeuerUser.Text = "Neuer User";
this.buttonNeuerUser.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonNeuerUser.UseVisualStyleBackColor = false;
this.buttonNeuerUser.Visible = false;
this.buttonNeuerUser.Click += new System.EventHandler(this.buttonNeuerUser_Click);
//
// groupBoxStatistik
@ -1014,13 +1163,15 @@ namespace Deckungsbeitrag
this.groupBoxStatistik.AutoSize = true;
this.groupBoxStatistik.Controls.Add(this.dateTimePicker1);
this.groupBoxStatistik.Controls.Add(this.tableLayoutPanelStatistik);
this.groupBoxStatistik.Enabled = false;
this.groupBoxStatistik.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxStatistik.Location = new System.Drawing.Point(299, 317);
this.groupBoxStatistik.Location = new System.Drawing.Point(8, 316);
this.groupBoxStatistik.Name = "groupBoxStatistik";
this.groupBoxStatistik.Size = new System.Drawing.Size(282, 250);
this.groupBoxStatistik.TabIndex = 61;
this.groupBoxStatistik.TabStop = false;
this.groupBoxStatistik.Text = "STATISTIK";
this.groupBoxStatistik.Visible = false;
this.groupBoxStatistik.GiveFeedback += new System.Windows.Forms.GiveFeedbackEventHandler(this.groupBox_GiveFeedback);
this.groupBoxStatistik.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox_Paint);
//
@ -1228,93 +1379,110 @@ namespace Deckungsbeitrag
//
this.groupBoxUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBoxUpdate.Controls.Add(this.tableLayoutPanelUpdate);
this.groupBoxUpdate.Enabled = false;
this.groupBoxUpdate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxUpdate.Location = new System.Drawing.Point(8, 573);
this.groupBoxUpdate.Name = "groupBoxUpdate";
this.groupBoxUpdate.Size = new System.Drawing.Size(573, 110);
this.groupBoxUpdate.Size = new System.Drawing.Size(593, 110);
this.groupBoxUpdate.TabIndex = 60;
this.groupBoxUpdate.TabStop = false;
this.groupBoxUpdate.Text = "UPDATE";
this.groupBoxUpdate.Text = "PFAD FÜR UPDATES ODER IMPORTE";
this.groupBoxUpdate.Visible = false;
this.groupBoxUpdate.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBox_Paint);
//
// tableLayoutPanelUpdate
//
this.tableLayoutPanelUpdate.ColumnCount = 2;
this.tableLayoutPanelUpdate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanelUpdate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.tableLayoutPanelUpdate.Controls.Add(this.progressBarSortiment, 1, 1);
this.tableLayoutPanelUpdate.Controls.Add(this.buttonSortimentUpdate, 0, 1);
this.tableLayoutPanelUpdate.Controls.Add(this.buttonArtikelUpdate, 0, 0);
this.tableLayoutPanelUpdate.Controls.Add(this.progressBarArtikel, 1, 0);
this.tableLayoutPanelUpdate.Controls.Add(this.buttonAllUpdate, 0, 2);
this.tableLayoutPanelUpdate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelUpdate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 510F));
this.tableLayoutPanelUpdate.Controls.Add(this.labelSoftwareDatum, 1, 2);
this.tableLayoutPanelUpdate.Controls.Add(this.labelArtikelDatum, 1, 1);
this.tableLayoutPanelUpdate.Controls.Add(this.label16, 0, 2);
this.tableLayoutPanelUpdate.Controls.Add(this.label11, 0, 1);
this.tableLayoutPanelUpdate.Controls.Add(this.label3, 0, 0);
this.tableLayoutPanelUpdate.Controls.Add(this.labelKundenDatum, 1, 0);
this.tableLayoutPanelUpdate.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelUpdate.ForeColor = System.Drawing.Color.Black;
this.tableLayoutPanelUpdate.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanelUpdate.Name = "tableLayoutPanelUpdate";
this.tableLayoutPanelUpdate.RowCount = 3;
this.tableLayoutPanelUpdate.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanelUpdate.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanelUpdate.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanelUpdate.Size = new System.Drawing.Size(567, 91);
this.tableLayoutPanelUpdate.Size = new System.Drawing.Size(587, 91);
this.tableLayoutPanelUpdate.TabIndex = 0;
//
// progressBarSortiment
// labelSoftwareDatum
//
this.progressBarSortiment.Dock = System.Windows.Forms.DockStyle.Left;
this.progressBarSortiment.Location = new System.Drawing.Point(144, 33);
this.progressBarSortiment.Name = "progressBarSortiment";
this.progressBarSortiment.Size = new System.Drawing.Size(420, 24);
this.progressBarSortiment.TabIndex = 62;
this.labelSoftwareDatum.AutoSize = true;
this.labelSoftwareDatum.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelSoftwareDatum.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelSoftwareDatum.Location = new System.Drawing.Point(80, 60);
this.labelSoftwareDatum.Name = "labelSoftwareDatum";
this.labelSoftwareDatum.Size = new System.Drawing.Size(504, 31);
this.labelSoftwareDatum.TabIndex = 7;
this.labelSoftwareDatum.Text = "label17";
this.labelSoftwareDatum.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// buttonSortimentUpdate
// labelArtikelDatum
//
this.buttonSortimentUpdate.BackColor = System.Drawing.Color.White;
this.buttonSortimentUpdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSortimentUpdate.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonSortimentUpdate.Location = new System.Drawing.Point(2, 32);
this.buttonSortimentUpdate.Margin = new System.Windows.Forms.Padding(2);
this.buttonSortimentUpdate.Name = "buttonSortimentUpdate";
this.buttonSortimentUpdate.Size = new System.Drawing.Size(137, 24);
this.buttonSortimentUpdate.TabIndex = 61;
this.buttonSortimentUpdate.Text = "Sortiment-Update";
this.buttonSortimentUpdate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonSortimentUpdate.UseVisualStyleBackColor = false;
this.buttonSortimentUpdate.Click += new System.EventHandler(this.buttonSortimentUpdate_Click);
this.labelArtikelDatum.AutoSize = true;
this.labelArtikelDatum.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelArtikelDatum.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelArtikelDatum.Location = new System.Drawing.Point(80, 30);
this.labelArtikelDatum.Name = "labelArtikelDatum";
this.labelArtikelDatum.Size = new System.Drawing.Size(504, 30);
this.labelArtikelDatum.TabIndex = 6;
this.labelArtikelDatum.Text = "label15";
this.labelArtikelDatum.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// buttonArtikelUpdate
// label16
//
this.buttonArtikelUpdate.BackColor = System.Drawing.Color.White;
this.buttonArtikelUpdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonArtikelUpdate.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonArtikelUpdate.Location = new System.Drawing.Point(2, 2);
this.buttonArtikelUpdate.Margin = new System.Windows.Forms.Padding(2);
this.buttonArtikelUpdate.Name = "buttonArtikelUpdate";
this.buttonArtikelUpdate.Size = new System.Drawing.Size(137, 24);
this.buttonArtikelUpdate.TabIndex = 59;
this.buttonArtikelUpdate.Text = "Artikel-Update";
this.buttonArtikelUpdate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonArtikelUpdate.UseVisualStyleBackColor = false;
this.buttonArtikelUpdate.Click += new System.EventHandler(this.buttonArtikelUpdate_Click);
this.label16.AutoSize = true;
this.label16.Dock = System.Windows.Forms.DockStyle.Fill;
this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label16.Location = new System.Drawing.Point(3, 60);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(71, 31);
this.label16.TabIndex = 4;
this.label16.Text = "Software:";
this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// progressBarArtikel
// label11
//
this.progressBarArtikel.Dock = System.Windows.Forms.DockStyle.Left;
this.progressBarArtikel.Location = new System.Drawing.Point(144, 3);
this.progressBarArtikel.Name = "progressBarArtikel";
this.progressBarArtikel.Size = new System.Drawing.Size(420, 24);
this.progressBarArtikel.TabIndex = 58;
this.label11.AutoSize = true;
this.label11.Dock = System.Windows.Forms.DockStyle.Fill;
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label11.Location = new System.Drawing.Point(3, 30);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(71, 30);
this.label11.TabIndex = 2;
this.label11.Text = "Artikel:";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// buttonAllUpdate
// label3
//
this.buttonAllUpdate.BackColor = System.Drawing.Color.White;
this.buttonAllUpdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAllUpdate.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.buttonAllUpdate.Location = new System.Drawing.Point(2, 62);
this.buttonAllUpdate.Margin = new System.Windows.Forms.Padding(2);
this.buttonAllUpdate.Name = "buttonAllUpdate";
this.buttonAllUpdate.Size = new System.Drawing.Size(137, 25);
this.buttonAllUpdate.TabIndex = 60;
this.buttonAllUpdate.Text = "Alle-Updates starten";
this.buttonAllUpdate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.buttonAllUpdate.UseVisualStyleBackColor = false;
this.buttonAllUpdate.Click += new System.EventHandler(this.buttonAllUpdate_Click);
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(3, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 30);
this.label3.TabIndex = 0;
this.label3.Text = "Kunden:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelKundenDatum
//
this.labelKundenDatum.AutoSize = true;
this.labelKundenDatum.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelKundenDatum.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelKundenDatum.Location = new System.Drawing.Point(80, 0);
this.labelKundenDatum.Name = "labelKundenDatum";
this.labelKundenDatum.Size = new System.Drawing.Size(504, 30);
this.labelKundenDatum.TabIndex = 5;
this.labelKundenDatum.Text = "label7";
this.labelKundenDatum.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// groupBoxAuftrag
//
@ -1329,9 +1497,10 @@ namespace Deckungsbeitrag
this.groupBoxAuftrag.Controls.Add(this.rBAlle);
this.groupBoxAuftrag.Controls.Add(this.buttonAufAbruf);
this.groupBoxAuftrag.Controls.Add(this.buttonAusgeliefert);
this.groupBoxAuftrag.Location = new System.Drawing.Point(662, 150);
this.groupBoxAuftrag.Enabled = false;
this.groupBoxAuftrag.Location = new System.Drawing.Point(662, 87);
this.groupBoxAuftrag.Name = "groupBoxAuftrag";
this.groupBoxAuftrag.Size = new System.Drawing.Size(663, 479);
this.groupBoxAuftrag.Size = new System.Drawing.Size(788, 479);
this.groupBoxAuftrag.TabIndex = 51;
this.groupBoxAuftrag.TabStop = false;
this.groupBoxAuftrag.Visible = false;
@ -1352,7 +1521,7 @@ namespace Deckungsbeitrag
this.objectListViewAuftrag.HideSelection = false;
this.objectListViewAuftrag.Location = new System.Drawing.Point(165, 14);
this.objectListViewAuftrag.Name = "objectListViewAuftrag";
this.objectListViewAuftrag.Size = new System.Drawing.Size(492, 459);
this.objectListViewAuftrag.Size = new System.Drawing.Size(617, 459);
this.objectListViewAuftrag.TabIndex = 58;
this.objectListViewAuftrag.UseAlternatingBackColors = true;
this.objectListViewAuftrag.UseCompatibleStateImageBehavior = false;
@ -1477,9 +1646,10 @@ namespace Deckungsbeitrag
this.groupBoxScannTest.Controls.Add(this.textBoxScannTest);
this.groupBoxScannTest.Controls.Add(this.buttonScannTest);
this.groupBoxScannTest.Controls.Add(this.labelScannTest);
this.groupBoxScannTest.Location = new System.Drawing.Point(746, 223);
this.groupBoxScannTest.Enabled = false;
this.groupBoxScannTest.Location = new System.Drawing.Point(8, 572);
this.groupBoxScannTest.Name = "groupBoxScannTest";
this.groupBoxScannTest.Size = new System.Drawing.Size(932, 264);
this.groupBoxScannTest.Size = new System.Drawing.Size(1057, 264);
this.groupBoxScannTest.TabIndex = 50;
this.groupBoxScannTest.TabStop = false;
this.groupBoxScannTest.Visible = false;
@ -1492,7 +1662,6 @@ namespace Deckungsbeitrag
this.pictureBoxScannTest.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxScannTest.TabIndex = 14;
this.pictureBoxScannTest.TabStop = false;
this.pictureBoxScannTest.Visible = false;
//
// textBoxScannTest
//
@ -1501,7 +1670,6 @@ namespace Deckungsbeitrag
this.textBoxScannTest.Name = "textBoxScannTest";
this.textBoxScannTest.Size = new System.Drawing.Size(129, 26);
this.textBoxScannTest.TabIndex = 13;
this.textBoxScannTest.Visible = false;
this.textBoxScannTest.TextChanged += new System.EventHandler(this.textBoxScannTest_TextChanged);
//
// buttonScannTest
@ -1512,7 +1680,6 @@ namespace Deckungsbeitrag
this.buttonScannTest.TabIndex = 12;
this.buttonScannTest.Text = "Test starten";
this.buttonScannTest.UseVisualStyleBackColor = true;
this.buttonScannTest.Visible = false;
this.buttonScannTest.Click += new System.EventHandler(this.buttonScannTest_Click);
//
// labelScannTest
@ -1524,14 +1691,13 @@ namespace Deckungsbeitrag
this.labelScannTest.Size = new System.Drawing.Size(60, 24);
this.labelScannTest.TabIndex = 11;
this.labelScannTest.Text = "label1";
this.labelScannTest.Visible = false;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.ClientSize = new System.Drawing.Size(1156, 689);
this.ClientSize = new System.Drawing.Size(1281, 689);
this.Controls.Add(this.toolStripMenu);
this.Controls.Add(this.panelMain);
this.HelpButton = true;
@ -1544,12 +1710,14 @@ namespace Deckungsbeitrag
this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.FormMain_HelpButtonClicked);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing);
this.Load += new System.EventHandler(this.FormMain_Load);
this.Shown += new System.EventHandler(this.FormMain_Shown);
this.ResizeBegin += new System.EventHandler(this.FormMain_ResizeBegin);
this.Resize += new System.EventHandler(this.FormMain_Resize);
this.toolStripMenu.ResumeLayout(false);
this.toolStripMenu.PerformLayout();
this.panelMain.ResumeLayout(false);
this.panelMain.PerformLayout();
this.panelProgress.ResumeLayout(false);
this.groupBoxContAnz.ResumeLayout(false);
this.groupBoxContAnz.PerformLayout();
this.tLPContAnz.ResumeLayout(false);
@ -1561,6 +1729,7 @@ namespace Deckungsbeitrag
this.tableLayoutPanelStatistik.PerformLayout();
this.groupBoxUpdate.ResumeLayout(false);
this.tableLayoutPanelUpdate.ResumeLayout(false);
this.tableLayoutPanelUpdate.PerformLayout();
this.groupBoxAuftrag.ResumeLayout(false);
this.groupBoxAuftrag.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListViewAuftrag)).EndInit();
@ -1602,14 +1771,9 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Button buttonAusgeliefert;
private System.Windows.Forms.Button buttonNeuerAuftrag;
private System.Windows.Forms.ToolStripButton tSBArtikelVW;
private System.Windows.Forms.ProgressBar progressBarArtikel;
private System.Windows.Forms.Button buttonArtikelUpdate;
private System.Windows.Forms.GroupBox groupBoxUpdate;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelUpdate;
private System.Windows.Forms.Button buttonAllUpdate;
private BrightIdeasSoftware.ObjectListView objectListViewAuftrag;
private System.Windows.Forms.Button buttonSortimentUpdate;
private System.Windows.Forms.ProgressBar progressBarSortiment;
private System.Windows.Forms.ToolStripButton tSBHilfe;
private System.Windows.Forms.GroupBox groupBoxStatistik;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelStatistik;
@ -1662,6 +1826,19 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label labelContGes;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button buttonTourenliste;
private System.Windows.Forms.ToolStripButton tSBWaschstrasse;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label labelSoftwareDatum;
private System.Windows.Forms.Label labelArtikelDatum;
private System.Windows.Forms.Label labelKundenDatum;
private System.Windows.Forms.Button buttonKundeArtikelUpdate;
private System.Windows.Forms.ProgressBar progressBarKundeArtikelUpdate;
private System.Windows.Forms.Label labelProgress;
private System.Windows.Forms.Panel panelProgress;
private System.Windows.Forms.Button buttonNeuerRegAuft;
}
}

View File

@ -3,12 +3,14 @@ using DatenDB;
using Deckungsbeitrag.AA_Forms;
using Deckungsbeitrag.AA_Klassen;
using Deckungsbeitrag.Properties;
using Deckungsbeitrag.UserControls;
using Npgsql;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
@ -47,6 +49,10 @@ namespace Deckungsbeitrag
private Button draggedButton;
private bool isButtonDragging = false;
private Timer dragEndTimer;
private Timer UserTimeout;
private int verbleibendeZeitMs = 5 * 60 * 1000;
private bool countdownAktiv = false;
private List<AuftragArtikel> ArtikellisteProAuftrag;
public FormMain()
{
@ -60,49 +66,6 @@ namespace Deckungsbeitrag
{
this.benutzer = benutzer;
this.groupBoxUpdate.Enabled = false;
// AKTIVE ELEMENTE JE BENUTZER ROLLE
switch (benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
this.toolStripDB.Enabled = this.toolStripButtonImport.Enabled = this.tSBExpedit.Enabled = false;
this.groupBoxUpdate.Visible = this.toolStripDB.Visible = this.toolStripButtonImport.Visible = this.tSBExpedit.Enabled = false;
break;
case BenutzerRolle.Fahrer:
// ToolStripButtons werden deaktiviert.
foreach(ToolStripButton tsb in this.toolStripMenu.Items)
{
// Ausgewählter ToolStripButton bleibt aktiv.
if(!tsb.Name.Contains("Auftrag")) tsb.Enabled = false;
}
// Controls im PanelMain werden deaktiviert.
foreach(Control ctr in this.panelMain.Controls)
{
// Ausgewählte Buttons bleiben aktiv.
if (ctr.Name.Contains("Auftrag")) ctr.Enabled = true;
else
{
if (ctr.GetType() == typeof(Button)) ctr.BackColor = Color.Gray;
ctr.Enabled = false;
}
}
break;
case BenutzerRolle.Admin:
this.groupBoxUpdate.Visible = false;
break;
case BenutzerRolle.Waschstrasse:
this.toolStripDB.Enabled = this.toolStripButtonImport.Enabled = this.tSBBenutzerVW.Enabled = this.tSBAufgabeVW.Enabled = this.tSBExpedit.Enabled = false;
this.groupBoxUpdate.Visible = this.toolStripDB.Visible = this.toolStripButtonImport.Visible = this.tSBBenutzerVW.Enabled = this.tSBAufgabeVW.Enabled = this.tSBExpedit.Enabled = false;
break;
case BenutzerRolle.Master:
break;
default:
break;
}
ghostImage = new PictureBox
{
Size = new Size(200, 100), // GroupBox-Größe
@ -112,38 +75,213 @@ namespace Deckungsbeitrag
};
panelMain.Controls.Add(ghostImage); // Zum Panel!
}
private async void FormMain_Load(object sender, EventArgs e)
{
private async void FormMain_Load(object sender, EventArgs e)
{
formloading = true;
_settings.Load();
this.buttonKundeArtikelUpdate.BringToFront();
// Feedback Button wird eingefügt. Location wird in FormMain_Shown berechnet.
UCFeedback feedback = new UCFeedback(this.benutzer);
this.panelMain.Controls.Add(feedback);
this.WindowState = FormWindowState.Maximized;
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
this.panelMain.Width = this.Width - this.toolStripMenu.Right - 20;
this.panelMain.Location = new Point(this.toolStripMenu.Right, 0);
this.Text += Assembly.GetExecutingAssembly().GetName().Version;
GetStatistik();
this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
this.panelMain.Width = this.Width - this.toolStripMenu.Right - 20;
this.panelMain.Location = new Point(this.toolStripMenu.Right, 0);
this.Text += Assembly.GetExecutingAssembly().GetName().Version.ToString();
this.labelKundenDatum.Text = @"N:\TECHNIK\Software\Wirl-Verwaltung\Listen\Kundenstammblatt.csv";
this.labelSoftwareDatum.Text = @"N:\TECHNIK\Software\Wirl-Verwaltung\Setup\SetupVerwaltung*.msi";
this.labelArtikelDatum.Text = @"N:\TECHNIK\Software\Wirl-Verwaltung\Listen\Artikelkurzliste.csv";
GetStatistik();
GetSaison();
await GetAuftraege();
GetContainerProTag();
// GroupBoxen im PanelMain werden ausgeblendet
foreach (GroupBox gb in this.panelMain.Controls.OfType<GroupBox>())
{
if (!gb.Name.Contains("Update") & !gb.Name.Contains("Statistik") & !gb.Name.Contains("Neuer") & !gb.Name.Contains("Saison") & !gb.Name.Contains("ContAnz"))
{
gb.Visible = false;
gb.Location = new Point(0, 0);
gb.Size = new Size(this.panelMain.Width, this.panelMain.Height);
}
RegisterDragEvents(gb);
if (this.groupBoxContAnz.Visible)
{
await GetAuftraege();
GetContainerProTag();
}
this.Activate();
_fixedSize = this.Size;
formloading = false;
}
private void FormMain_Shown(object sender, EventArgs e)
{
// Meldung wenn Updates oder Imports erledigt wurden.
if (Program.Artikelliste_Importiert | Program.Kundenliste_Importiert | Program.Software_Updated)
{
string[] updates = new string[3];
updates[0] = Program.Artikelliste_Importiert ? "Artikelliste: ✅" : "Artikelliste: ❌";
updates[1] = Program.Kundenliste_Importiert ? "Kundenliste: ✅" : "Kundenliste: ❌";
updates[2] = Program.Software_Updated ? "Software: ✅" : "Sofware: ❌";
MessageBox.Show($"Folgende Updates wurden heute durchgeführt:\n\n{updates[0]}\n{updates[1]}\n{updates[2]}", "UPDATES DURCHGEFÜHRT", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// Location des Feedback Buttons wird berechnet. (Screengröße ist hier klar)
UCFeedback fb = this.panelMain.Controls.Find("feedback", false)[0] as UCFeedback;
if (fb != null) fb.Location = new Point(panelMain.Width - fb.Width - 10, panelMain.Top + 10);
// Controls werde Enabled
Enable_Controls();
}
private void Enable_Controls()
{
// BUTTONS ENABLEN
foreach (Button button in this.panelMain.Controls.OfType<Button>())
{
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
button.Visible = button.Enabled = true;
break;
case BenutzerRolle.Fahrer:
button.Visible = button.Enabled = button.Name.Contains("NeuerAuftrag") || button.Name.Contains("Tourenliste") ? true : false;
break;
case BenutzerRolle.Admin:
button.Visible = button.Enabled = true;
break;
case BenutzerRolle.Waschstrasse:
button.Visible = button.Enabled = false;
break;
case BenutzerRolle.Master:
button.Visible = button.Enabled = true;
break;
case BenutzerRolle.Expedit:
button.Visible = button.Enabled = false;
break;
case BenutzerRolle.Frottee:
button.Visible = button.Enabled = false;
break;
case BenutzerRolle.Flach:
button.Visible = button.Enabled = false;
break;
default:
break;
}
}
// GROUPBOXES ENABLEN
foreach (GroupBox gb in this.panelMain.Controls.OfType<GroupBox>())
{
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
gb.Visible = gb.Enabled = gb.Name.Contains("Auftrag") || gb.Name.Contains("Saison") ? false : true;
break;
case BenutzerRolle.Fahrer:
gb.Visible = gb.Enabled = gb.Name.Contains("Auftrag") ? true : false;
if (gb.Name.Contains("Auftrag"))
{
this.groupBoxAuftrag.Size = new Size(this.panelMain.Width - this.buttonNeuerAuftrag.Right - 20, this.panelMain.Height - 20);
this.groupBoxAuftrag.Location = new Point(this.buttonNeuerAuftrag.Right + 10, this.panelMain.Top + 10);
}
break;
case BenutzerRolle.Admin:
gb.Visible = gb.Enabled = gb.Name.Contains("Auftrag") || gb.Name.Contains("ScannTest") ? false : true;
break;
case BenutzerRolle.Waschstrasse:
gb.Visible = gb.Enabled = false;
break;
case BenutzerRolle.Master:
gb.Visible = gb.Enabled = gb.Name.Contains("Auftrag") || gb.Name.Contains("ScannTest") ? false : true;
break;
case BenutzerRolle.Expedit:
gb.Visible = gb.Enabled = false;
break;
case BenutzerRolle.Frottee:
gb.Visible = gb.Enabled = false;
break;
case BenutzerRolle.Flach:
gb.Visible = gb.Enabled = false;
break;
default:
break;
}
if (!gb.Name.Contains("Auftrag")) RegisterDragEvents(gb);
}
// TOOLSTRIP-BUTTONS ENABLEN
foreach (ToolStripButton btn in this.toolStripMenu.Items)
{
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
btn.Enabled = true;
break;
case BenutzerRolle.Fahrer:
btn.Enabled = btn.Name.Contains("Auftrag") ? true : false;
break;
case BenutzerRolle.Admin:
btn.Enabled = true;
break;
case BenutzerRolle.Waschstrasse:
btn.Enabled = false;
break;
case BenutzerRolle.Master:
btn.Enabled = true;
break;
case BenutzerRolle.Expedit:
btn.Enabled = false;
break;
case BenutzerRolle.Frottee:
btn.Enabled = false;
break;
case BenutzerRolle.Flach:
btn.Enabled = false;
break;
default:
break;
}
}
if (this.groupBoxAuftrag.Visible)
{
GetExpeditList(null);
}
this.panelProgress.Visible = this.panelProgress.Enabled = this.benutzer.Rolle == BenutzerRolle.Master ? true : false;
this.buttonKundeArtikelUpdate.Visible = this.buttonKundeArtikelUpdate.Enabled = this.benutzer.Rolle == BenutzerRolle.Master ? true : false;
}
private void DoKundeArtikelImportOnce(IProgress<int> progress, List<Sortiment> sortimentListe)
{
int itemsDone = 0;
foreach (Sortiment sort in sortimentListe)
{
// Fortschrittswert an die ProgressBar melden
progress.Report(++itemsDone);
Console.WriteLine(itemsDone);
if (sort.ArtNr != 0)
{
int kundeid = Kunde.GetKundeID(sort.KundeNummer, null);
KundeArtikel kndart = KundeArtikel.GetItemIfAvailable(kundeid, sort.ArtNr);
if (kndart != null)
{
if (kndart.ArtikelID == 0)
{
try
{
kndart.ArtikelID = Artikel.GetArtikelID(sort.ArtNr);
kndart.Save();
}
catch (Exception ex)
{
MessageBox.Show($"Kundenartikel {kndart.KundeArtikelID} konnte nicht gespeichert werden. {ex.Message}");
}
}
}
}
}
}
private async Task GetAuftraege()
{
var conn = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); // Pro Task!
@ -151,6 +289,7 @@ namespace Deckungsbeitrag
{
await conn.OpenAsync();
auftragliste = await Auftrag.GetAuftraegeProLiefertagAsync(conn, AuftragTyp.Standart, AuftragStatus.Aufgelegt);
//TODO: nicht ganze Aufträge holen sondern nur die Zahlen?
}
finally
{
@ -163,14 +302,14 @@ namespace Deckungsbeitrag
private void Paint_Boarder(Size size, Point location, PaintEventArgs e)
{
Pen pen = new Pen(Color.FromArgb(1, 53, 101), 4);
e.Graphics.Clear(Color.White);
Pen pen = new Pen(Program.Wirlblau, 4);
Rectangle rect = new Rectangle(1, 2, size.Width - 4, size.Height - 4);
e.Graphics.DrawRectangle(pen, rect);
}
private void panelMain_Paint(object sender, PaintEventArgs e)
{
Paint_Boarder(this.panelMain.Size, this.panelMain.Location, e);
}
#region ToolStripButton_Click-Events
@ -201,12 +340,10 @@ namespace Deckungsbeitrag
FormNeuDeckungsbeitrag deckungsbeitrag = new FormNeuDeckungsbeitrag(this.benutzer, false);
if (deckungsbeitrag.ShowDialog() == DialogResult.OK) { }
}
private void tSBWaschstrasse1_Click(object sender, EventArgs e)
private void tSBWaschstrasse_Click(object sender, EventArgs e)
{
//FormWaschstrasse waschstrasse = new FormWaschstrasse(this.tSBWaschverlauf.Text);
//waschstrasse.ShowDialog();
//LISTVIEW MIT GEWASCHTEN FÄCHERN ERSTELLEN (KOMMT WENN BENUTZER = ADMIN)
FormAufleger aufleger = new FormAufleger();
aufleger.ShowDialog();
}
private void toolStripButtonImport_Click(object sender, EventArgs e)
{
@ -296,7 +433,7 @@ namespace Deckungsbeitrag
if (sender.GetType() == typeof(ToolStripButton))
{
ToolStripButton tsb = (ToolStripButton)sender;
tsb.ForeColor = Color.FromArgb(1, 53, 101);
tsb.ForeColor = Program.Wirlblau;
tsb.BackColor = Color.White;
}
}
@ -306,25 +443,18 @@ namespace Deckungsbeitrag
{
ToolStripButton tsb = (ToolStripButton)sender;
tsb.ForeColor = Color.White;
tsb.BackColor = Color.FromArgb(1, 53, 101);
tsb.BackColor = Program.Wirlblau;
}
}
/// <summary>
/// Hilfe Events
///
/// </summary>
private void buttonNeueMaschine_HelpRequested(object sender, HelpEventArgs hlpevent)
{
MessageBox.Show($"Hier kannst du eine neue Maschine anlegen.{Environment.NewLine}{Environment.NewLine}Wenn du bei einer Maschine einen Trockner aus- oder einschalten willst musst du die Maschine doppelt anklicken.", "Hilfe", MessageBoxButtons.OK, MessageBoxIcon.Information);
} //Hilfe bei Maschine Button und Maschine Groupbox.
#region Button-Click Events
/// <summary>
/// Panel Main Control Funktionen
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonNeuerAuftrag_Click(object sender, EventArgs e)
/// <summary>
/// Panel Main Control Funktionen
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonNeuerAuftrag_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standart); neuerAuftrag.ShowDialog();
}
@ -358,13 +488,168 @@ namespace Deckungsbeitrag
break;
}
}
private void buttonNeueInventur_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Inventur); neuerAuftrag.ShowDialog();
}
/// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN
/// Button-Click AufAbruf und Ausgeliefert sowie ItemsChecked
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonAusgeliefert_Click(object sender, EventArgs e)
{
int saved = 0;
int tosave = 0;
if (this.objectListViewAuftrag.CheckedItems.Count > 0)
{
if (meldung.AuftragAusgeliefert() == DialogResult.Yes)
{
foreach (OLVListItem item in this.objectListViewAuftrag.CheckedItems)
{
++tosave;
Auftrag a = (Auftrag)item.RowObject;
a.Erledigt = DateTime.Now;
a.ErledigtVon = this.benutzer.BenutzerID;
a.Status = AuftragStatus.Ausgeliefert;
if (a.Save()[0] == 1)
{
++saved;
ArtikellisteProAuftrag = AuftragArtikel.GetList(a.AuftragID);
foreach (AuftragArtikel auftragArtikel in this.ArtikellisteProAuftrag)
{
auftragArtikel.Erledigt = true;
if (auftragArtikel.Save() == 0) meldung.GetFehler(this, $"Der Artikel {auftragArtikel.AuftragArtikelID} konnte nicht gespeichert werden.");
}
}
// Wenn Typ ist Regelmäßig, wird ein neuer Auftrag laut Rhythmus hinterlegt.
if (a.Typ == AuftragTyp.Regelmäßig)
{
Auftrag newAuftrag = a;
newAuftrag.AuftragID = null;
newAuftrag.Liefertag = a.Liefertag.AddDays((int)a.Rhythmus);
newAuftrag.Status = AuftragStatus.Herrichten;
newAuftrag.ErstelltVon = (int)this.benutzer.BenutzerID;
newAuftrag.Erstellt = DateTime.Now;
// Werte des alten Auftrags zurücksetzen.
newAuftrag.Erledigt = null;
newAuftrag.ErledigtVon = null;
if (newAuftrag.Save()[0] != 1) meldung.Speicherfehler();
else
{
foreach (AuftragArtikel auftragArtikel in this.ArtikellisteProAuftrag)
{
auftragArtikel.AuftragArtikelID = null;
auftragArtikel.AuftragID = newAuftrag.AuftragID;
auftragArtikel.Erledigt = false;
if (auftragArtikel.Save() == 0) meldung.GetFehler(this, $"Der Artikel {auftragArtikel.AuftragArtikelID} konnte nicht gespeichert werden.");
}
}
}
}
if (saved == tosave) GetExpeditList(null);
}
}
}
private void buttonAufAbruf_Click(object sender, EventArgs e)
{
if (this.objectListViewAuftrag.CheckedItems.Count == 1)
{
if (meldung.AuftragAufAbruf() == DialogResult.Yes)
{
OLVListItem item = (OLVListItem)this.objectListViewAuftrag.CheckedItems[0];
Auftrag a = (Auftrag)item.RowObject;
a.Typ = AuftragTyp.AufAbruf;
if (a.Save()[0] == 1) GetExpeditList(null);
}
}
else
{
meldung.NurEinAuftrag();
}
}
/// <summary>
/// Buttons auf MainPanel. Schnellzugriff für Neuer User und Neuer Auftrag.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonNeuerUser_Click(object sender, EventArgs e)
{
FormNeuerBenutzer neuerBenutzer = new FormNeuerBenutzer();
neuerBenutzer.ShowDialog();
}
private void buttonTestChart_Click(object sender, EventArgs e)
{
FehlmengeChart chart = new FehlmengeChart();
chart.Show();
}
private void buttonTourenliste_Click(object sender, EventArgs e)
{
Benutzer fahrer = new Benutzer();
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) fahrer = this.benutzer;
else
{
List<Benutzer> fahrerliste = Benutzer.GetFahrerList();
FormBenutzerVW benutzerVW = new FormBenutzerVW(fahrerliste);
if (benutzerVW.ShowDialog() == DialogResult.OK)
{
fahrer = benutzerVW.user;
}
}
if (fahrer != null)
{
List<Auftrag> auftragliste = Auftrag.GetTourenListe(fahrer);
if (auftragliste.Count > 0) Funktionen.TourenListe_Drucken(auftragliste, fahrer, this, this.benutzer);
}
}
private async void buttonKundeArtikelUpdate_Click(object sender, EventArgs e)
{
if (this.buttonKundeArtikelUpdate.Visible == false) return;
Application.UseWaitCursor = true;
List<Sortiment> sortimentListe = Funktionen.SortimentLesen("Liste");
this.buttonKundeArtikelUpdate.Visible = false;
this.labelProgress.Visible = true;
this.labelProgress.BackColor = Color.Transparent;
this.progressBarKundeArtikelUpdate.Maximum = sortimentListe.Count();
this.progressBarKundeArtikelUpdate.Value = 0;
this.progressBarKundeArtikelUpdate.Visible = true;
this.progressBarKundeArtikelUpdate.Refresh();
this.progressBarKundeArtikelUpdate.BringToFront();
this.labelProgress.BringToFront();
IProgress<int> progress = new Progress<int>(percent => // ✅ Progress<T> verwenden
{
this.progressBarKundeArtikelUpdate.Value = percent; // ✅ Lambda-Block
});
await Task.Run(() => DoKundeArtikelImportOnce(progress, sortimentListe));
MessageBox.Show("Das Update der KundenArtikel ist erfolgreich beendet.", "Update erfolgreich");
this.progressBarKundeArtikelUpdate.Value = 0;
this.labelProgress.Visible = false;
this.buttonKundeArtikelUpdate.Visible = true;
Application.UseWaitCursor = false;
}
private void buttonRegAuftrag_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Regelmäßig);
neuerAuftrag.ShowDialog();
}
#endregion
/// <summary>
/// Scan QR-Code Test.
/// </summary>
@ -380,284 +665,11 @@ namespace Deckungsbeitrag
}
}
/// <summary>
/// Update Events mit Button-Click
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void buttonArtikelUpdate_Click(object sender, EventArgs e)
{
FormLaden laden = new FormLaden();
laden.Show();
List<Sortiment> sortiment = Funktionen.SortimentLesen("Liste");
sortiment = sortiment.GroupBy(a => a.ArtNr).Select(g => g.First()).ToList();
//TODO: Testen ob Get_ArtikelKurzliste funktioniert.
//List<Artikel> artikelkurzliste = Funktionen.Get_ArtikelKurzlisteFromDatei();
// Controls blockieren
progressBarArtikel.Value = 0;
progressBarArtikel.Visible = true;
// ProgressBar Maximum definieren
progressBarArtikel.Maximum = sortiment.Count();
tSBArtikelVW.Enabled = false;
// Fortschritt simulieren (z.B. Datenbankabfrage)
var progress = new Progress<int>(value => progressBarArtikel.Value = value);
await Task.Run(() =>
{
Update_Artikel(progress, sortiment);
//TODO: Einkommentieren wenn ArtikelUpdate auf ArtikelKurzliste umgestellt werden kann.
//Update_Artikel(progress, artikelkurzliste);
});
progressBarArtikel.Value = 0;
laden.Close();
this.Show();
//TODO: LadenScreen anzeigen etc.
}
private async void buttonSortimentUpdate_Click(object sender, EventArgs e)
{
//TODO: für Ladescreen den Progressbar programieren. (perplexity fragen wie der Status an einen anderen Screen übergeben werden kann)
// Form Laden anzeigen
FormLaden laden = new FormLaden();
laden.Show();
// Sortiment holen
List<Sortiment> sortiment = Funktionen.SortimentLesen("Liste");
// Controls blockieren
progressBarArtikel.Value = 0;
progressBarArtikel.Visible = true;
// ProgressBar Maximum definieren
progressBarArtikel.Maximum = sortiment.Count();
// Fortschritt simulieren (z.B. Datenbankabfrage)
var progress = new Progress<int>(value => progressBarArtikel.Value = value);
await Task.Run(() => Update_Sortiment(progress, sortiment));
progressBarArtikel.Value = 0;
//laden.Close();
//this.Show();
}
private void Update_Sortiment(IProgress<int> progress, List<Sortiment> sortiment)
{
int tosave = 0;
int saved = 0;
int artvorhanden = 0;
int anzahlkunden = 0;
string sortNr = string.Empty;
List<Kunde> kundenliste = Kunde.GetList(true, string.Empty);
// ProgressBar Maximum definieren
progressBarArtikel.Maximum = kundenliste.Count();
foreach (Kunde kunde in kundenliste)
{
// Fortschrittswert an die ProgressBar melden
progress.Report(++anzahlkunden);
//Jedes Innsbrucker Soziale Dienste Sortiment ist gleich.
if (kunde.KundeNummer == "010069" | kunde.KundeNummer == "010071") sortNr = "010068";
else sortNr = kunde.KundeNummer;
foreach (Sortiment sort in sortiment.FindAll(Sortiment => Sortiment.KundeNummer == sortNr))
{
KundeArtikel item = KundeArtikel.GetItemIfAvailable(Kunde.GetKundeID(sort.KundeNummer, null), sort.ArtNr);
if(item == null)
{
++tosave;
item = new KundeArtikel();
item.KundeID = Kunde.GetKundeID(sort.KundeNummer, null);
item.ArtikelNR = sort.ArtNr;
item.ArtikelName = sort.ArtName;
item.Stand = 0;
item.Fehlmenge = 0;
item.Korrektur = 0;
if (item.Save() == 1) saved++;
}
else ++artvorhanden;
}
}
// Überprüfung ob alle Zeilen gespeichert wurden.
if (tosave == saved)
{
meldung.Gespeichert();
meldung.VerarbeiteteDaten(saved, anzahlkunden, artvorhanden);
}
else meldung.Speicherfehler();
}
private void Update_Artikel(IProgress<int> progress, List<Sortiment> sortiment)
{
int i = 0;
//TODO: Artikel Update weiter testen und programmieren. Für ArtikelKurzliste ausprogrammieren.
foreach (Sortiment sort in sortiment)
{
// Fortschrittswert an die ProgressBar melden
progress.Report(++i);
if (sort.ArtNr != 0)
{
Artikel art = Artikel.GetArtikel(sort.ArtNr);
if (art.ArtikelID == null)
{
art = new Artikel();
art.Nummer = sort.ArtNr;
art.Bezeichnung = sort.ArtName;
art.Nachwaesche = 0;
art.Muellwaesche = 0;
art.LastReset = null;
//Switch für ArtikelKategorie
switch (sort.ArtNr)
{
case var nr when nr.ToString().StartsWith("63"):
art.Kategorie = ArtikelKategorie.Frottee;
break;
case var nr when nr.ToString().StartsWith("611"):
if (nr.ToString().StartsWith("61115") || nr.ToString().StartsWith("61116")) art.Kategorie = ArtikelKategorie.Spannleintuch;
else art.Kategorie = ArtikelKategorie.Grossteile;
break;
case var nr when nr.ToString().StartsWith("612"):
art.Kategorie = ArtikelKategorie.Kleinteile;
break;
default:
break;
}
//Erstellen der Shortbezeichnung für Buttons
if (art.Bezeichnung.Contains("DOPPEL") | art.Bezeichnung.Contains("D-")) art.Short = art.Short + "D-";
if (art.Bezeichnung.Contains("SPANN")) art.Short = art.Short + "SP";
if (art.Bezeichnung.Contains("LEINTUCH")) art.Short = art.Short + "LT";
if (art.Bezeichnung.Contains("SPANN"))
{
string[] s = art.Bezeichnung.Split(' ');
if (s.Length == 3) art.Short = art.Short + " " + s[2];
} //Farben zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("HANDTUCH")) art.Short = art.Short + "HT";
if (art.Bezeichnung.Contains("DUSCHTUCH")) art.Short = art.Short + "DT";
if (art.Bezeichnung.Contains("BADETUCH")) art.Short = art.Short + "BT";
if (art.Bezeichnung.Contains("BADEVORLEGER")) art.Short = art.Short + "BV";
if (art.Bezeichnung.Contains("BADEMANTEL")) art.Short = art.Short + "BM";
if (art.Bezeichnung.Contains("SAUNATUCH")) art.Short = art.Short + "ST";
if (art.Bezeichnung.Contains("GESICHTSTUCH")) art.Short = art.Short + "GT";
if (art.Bezeichnung.Contains("POLSTERBEZUG"))
{
art.Short = art.Short + "PB";
switch (art.Bezeichnung)
{
case var bez when bez.Contains("60x80"):
art.Short = art.Short + " 60x80";
break;
case var bez when bez.Contains("40x60"):
art.Short = art.Short + " 40x60";
break;
case var bez when bez.Contains("40x40"):
art.Short = art.Short + " 40x40";
break;
case var bez when bez.Contains("40x50"):
art.Short = art.Short + " 40x50";
break;
case var bez when bez.Contains("40x70"):
art.Short = art.Short + " 40x70";
break;
default:
break;
}
} //Größen zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("DECKENBEZUG")) art.Short = art.Short + "DB";
if (art.Bezeichnung.Contains("TISCHTUCH"))
{
art.Short = art.Short + "TT";
int index = art.Bezeichnung.IndexOf("x");
if (index > 0) art.Short = art.Short + art.Bezeichnung.Substring(index - 4, 8);
} //Tischtücher und Größen zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("MUNDSERVIETTE")) art.Short = art.Short + "MS";
if (art.Bezeichnung.Contains("DECKSERVIETTE")) art.Short = art.Short + "DS";
//Speichern jedes Artikels
art.Save();
}
else
{
art.Bezeichnung = sort.ArtName;
art.Save();
}
}
}
tSBArtikelVW.Enabled = true;
progressBarArtikel.Value = 0;
}
private void buttonAllUpdate_Click(object sender, EventArgs e)
{
//Update_Artikel();
}
/// <summary>
/// AUFTRAGSVERWALTUNG FUNKTIONEN
/// Button-Click AufAbruf und Ausgeliefert sowie ItemsChecked
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonAusgeliefert_Click(object sender, EventArgs e)
{
int saved = 0;
int tosave = 0;
if (this.objectListViewAuftrag.CheckedItems.Count > 0)
{
if (meldung.AuftragAusgeliefert() == DialogResult.Yes)
{
foreach (OLVListItem item in this.objectListViewAuftrag.CheckedItems)
{
++tosave;
Auftrag a = (Auftrag)item.RowObject;
a.Erledigt = DateTime.Today;
a.ErledigtVon = this.benutzer.BenutzerID;
a.Status = AuftragStatus.Ausgeliefert;
if (a.Save()[0] == 1) ++saved;
}
if (saved == tosave) GetExpeditList(null);
}
}
}
private void buttonAufAbruf_Click(object sender, EventArgs e)
{
if (this.objectListViewAuftrag.CheckedItems.Count == 1)
{
if (meldung.AuftragAufAbruf() == DialogResult.Yes)
{
OLVListItem item = (OLVListItem)this.objectListViewAuftrag.CheckedItems[0];
Auftrag a = (Auftrag)item.RowObject;
a.Status = AuftragStatus.AufAbruf;
if (a.Save()[0] == 1) GetExpeditList(null);
}
}
else
{
meldung.NurEinAuftrag();
}
}
private void objectListViewAuftrag_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (this.objectListViewAuftrag.CheckedItems.Count > 0) this.buttonAusgeliefert.Visible = true;
else this.buttonAusgeliefert.Visible = false;
if (this.objectListViewAuftrag.CheckedItems.Count == 1) this.buttonAufAbruf.Visible = true;
else this.buttonAufAbruf.Visible = false;
@ -696,9 +708,6 @@ namespace Deckungsbeitrag
case AuftragStatus.Ausgeliefert:
GetExpeditList((int?)rB.Tag);
break;
case AuftragStatus.AufAbruf:
GetExpeditList((int?)rB.Tag);
break;
default:
GetExpeditList((int?)rB.Tag);
break;
@ -709,6 +718,7 @@ namespace Deckungsbeitrag
}
private async void GetExpeditList(int? status)
{
Application.UseWaitCursor = true;
this.objectListViewAuftrag.SuspendLayout();
this.objectListViewAuftrag.BeginUpdate();
@ -718,7 +728,8 @@ namespace Deckungsbeitrag
try
{
await conn.OpenAsync();
alist = await Auftrag.GetStatusListAsync(status, conn);
if (status == null & this.benutzer.Rolle == BenutzerRolle.Fahrer) alist = await Auftrag.GetFahrerListAsync(this.benutzer.BenutzerID, conn);
else alist = await Auftrag.GetStatusListAsync(status, conn);
}
finally
{
@ -732,6 +743,46 @@ namespace Deckungsbeitrag
this.objectListViewAuftrag.EndUpdate();
this.objectListViewAuftrag.ResumeLayout();
Application.UseWaitCursor = false;
}
private void GetUnvisibleColumns()
{
foreach (OLVColumn col in this.objectListViewAuftrag.Columns)
{
if (this.benutzer.Rolle == BenutzerRolle.Frottee)
{
if (col.Text == "Etikett" & col.IsButton) col.IsVisible = false;
}
else if (col.IsButton) col.IsVisible = false;
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
break;
case BenutzerRolle.Fahrer:
if (col.IsButton) col.IsVisible = false;
if (col.Text == "FR" || col.Text == "GT" || col.Text == "KT") col.IsVisible = false;
break;
case BenutzerRolle.Admin:
break;
case BenutzerRolle.Waschstrasse:
break;
case BenutzerRolle.Master:
break;
case BenutzerRolle.Expedit:
break;
case BenutzerRolle.Frottee:
if (col.Text == "Etikett" & col.IsButton) col.IsVisible = false;
break;
case BenutzerRolle.Flach:
break;
default:
break;
}
}
this.objectListViewAuftrag.RebuildColumns();
}
/// <summary>
@ -935,7 +986,9 @@ namespace Deckungsbeitrag
this.objectListViewAuftrag.SetObjects(alist);
this.objectListViewAuftrag.RebuildColumns();
if (_settings.OLV_State != null) this.objectListViewAuftrag.RestoreState(_settings.OLV_State);
//if (_settings.OLV_State != null) this.objectListViewAuftrag.RestoreState(_settings.OLV_State);
GetUnvisibleColumns();
this.objectListViewAuftrag = Funktionen.Columns_Resize(null, this.objectListViewAuftrag).olv;
@ -966,7 +1019,7 @@ namespace Deckungsbeitrag
}
private void GetStatistik()
{
string[] statistik = { "Container gewaschen:", "Container abgeschlossen:", " Container abgeholt:", "Kunden gewaschen:", "Kunden abgeschlossen:", "Kunden abgeholt:" };
string[] statistik = { "Container gewaschen:", "Container abgeschlossen:", "Container abgeholt:", "Kunden gewaschen:", "Kunden abgeschlossen:", "Kunden abgeholt:" };
List<Auftrag> auftraglist = Auftrag.GetAuftragStatsListToday(this.dateTimePicker1.Value.Date);
for (int i = 1; i <= statistik.Length; i++)
@ -1224,6 +1277,13 @@ namespace Deckungsbeitrag
{
// Koordinaten an Parent weiterleiten
Control child = (Control)sender;
if (child is Button buttonBase)
{
//buttonBase.PerformClick(); // Löst Childs Click-Event aus
return;
}
GroupBox parentGb = FindParentGroupBox(child);
if (parentGb != null)
@ -1260,16 +1320,6 @@ namespace Deckungsbeitrag
return null;
}
/// <summary>
/// Buttons auf MainPanel. Schnellzugriff für Neuer User und Neuer Auftrag.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonNeuerUser_Click(object sender, EventArgs e)
{
FormNeuerBenutzer neuerBenutzer = new FormNeuerBenutzer();
neuerBenutzer.ShowDialog();
}
/// <summary>
/// Settings speichern bei Form_Closing.
@ -1326,7 +1376,6 @@ namespace Deckungsbeitrag
tourenplanung.ShowDialog();
this.Cursor = Cursors.Default;
}
private void comboBoxSaison_SelectedIndexChanged(object sender, EventArgs e)
{
if (formloading) { return; }
@ -1360,17 +1409,21 @@ namespace Deckungsbeitrag
saison.Save();
}
}
private void buttonTestChart_Click(object sender, EventArgs e)
private void panelMain_Resize(object sender, EventArgs e)
{
FehlmengeChart chart = new FehlmengeChart();
chart.Show();
panelMain.Invalidate();
}
}
}
//CHANGES: Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren.
//CHANGES: Auftragverwaltung Spalten wurden aktualisiert. Mit Icons, Buttons und Sortierung auf Liefertag.
//CHANGES: Saisonauswahl DropDown eingefügt. Wenn Zwischensaison gewählt wir Warnung wegen falschen Liefertagen gezeigt. Sonst wird Saisonrhythmus als Liefertag beachtet.
//CHANGES: Artikelliste und Kundenliste werden automatisch importiert wenn vorhanden.
//CHANGES: Datum von letztem Import verfügbar.
//TODO: Dateinamen aus Tikos anschauen. Eventuell Datum von letztem Import über Dateiname wählen?
//TODO: JSON nach angemeldeten Fahrer durchsuchen und Kundenliste des aktuellen Wochentag anzeigen.
//TODO: Auftrag Schnellerfassung erstellen. Kundenliste aus JSON in OLV einfügen wenn schmutzig > 0 dann Auftrag erstellen. Spalten: "Kunde, schmutzig, liefertag, zustellfahrer" evnetuell in AuftragVW?
//TODO: Auftrag Schnellerfassung erstellen. Kundenliste aus JSON in OLV einfügen wenn schmutzig > 0 dann Auftrag erstellen. Spalten: "Kunde, schmutzig, liefertag, zustellfahrer" evnetuell in AuftragVW?
//TODO: Auftragliste bei Fahrer anzeigen wenn Login.
//TODO: Wenn RegAuftrag wird als augeliefert markiert, wird dieser automatisch neu erstellt laut hinterlegtem Rhythmus.

View File

@ -461,6 +461,17 @@
HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb
1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC
nOccAdABIDXXE1nzAAAAAElFTkSuQmCC
</value>
</data>
<data name="tSBWaschstrasse.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEMSURBVDhPrZMxjoNADEVzpD1CRE9PzwW2pkpDzwEo0tEi
DkBPT09BSbORsCkneqM1yUxQtNLG0pdG/va3x+M5nT5p27adVbVVVRehhYvjA1PVapomV5alS9PUJUni
wRkfHDFxnjeIcRx9cJZlrmkaNwyDB2d8cIcitAZhleZ5vonIBT/gjK+qKtf3PQI/67p+PVdvSaQKgQH5
ayLyvSzLXiQQYUgQXdc5qh0kXwBJds08zx/FEGBY3Pdo0vB1Xe8oisLHm8hnBP57hX2ILxN+iARDDIYd
PyMiVCQA2DPSIdc8LCIiV0hbJIJpF2HObxfJDBFbZVtjg60yMXFeYM+fiQ7Anz9TbDaD2B/bHero49g9
VkT2AAAAAElFTkSuQmCC
</value>
</data>
<data name="tSBTourenplanung.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -471,7 +471,7 @@ namespace Deckungsbeitrag
else
{
quartale = new int[idx];
this.groupBoxQuartal.BackColor = Color.FromArgb(1, 53, 101);
this.groupBoxQuartal.BackColor = Program.Wirlblau;
}
} //Max 3 Quartale auswählbar sonst ganzes Jahr
private void tSBEinstellung_Click(object sender, EventArgs e)
@ -487,7 +487,7 @@ namespace Deckungsbeitrag
{
if (!string.IsNullOrEmpty(tSComboBoxKndName.Text))
{
List<Kunde> tmplist = Kunde.GetTmpList(tSComboBoxKndName.Text);
List<Kunde> tmplist = Kunde.GetTmpList(tSComboBoxKndName.Text, null);
if (int.TryParse(tSComboBoxKndName.Text, out _)) foreach (Kunde kunde in tmplist) tSComboBoxKndName.AutoCompleteCustomSource.Add(kunde.KundeNummer);
else foreach (Kunde kunde in tmplist) tSComboBoxKndName.AutoCompleteCustomSource.Add(kunde.KundeName);
}

View File

@ -39,8 +39,6 @@ namespace Deckungsbeitrag
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.pictureBoxMinus = new System.Windows.Forms.PictureBox();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.rBMO = new System.Windows.Forms.RadioButton();
this.rBFR = new System.Windows.Forms.RadioButton();
this.rBDO = new System.Windows.Forms.RadioButton();
@ -62,9 +60,21 @@ namespace Deckungsbeitrag
this.KorrekturBearbeitet = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label1 = new System.Windows.Forms.Label();
this.comboBoxFahrer = new System.Windows.Forms.ComboBox();
this.buttonEinstellung = new System.Windows.Forms.Button();
this.panelRegAuftrag = new System.Windows.Forms.Panel();
this.fLPArtikel = new System.Windows.Forms.FlowLayoutPanel();
this.comboBoxRhythmus = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.comboBoxArtikel = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.pictureBoxAddArtikel = new System.Windows.Forms.PictureBox();
this.pictureBoxMinus = new System.Windows.Forms.PictureBox();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
this.panelRegAuftrag.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxAddArtikel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
this.SuspendLayout();
//
// dTPLiefertag
@ -90,10 +100,10 @@ namespace Deckungsbeitrag
this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSpeichern.ForeColor = System.Drawing.Color.White;
this.buttonSpeichern.Location = new System.Drawing.Point(495, 376);
this.buttonSpeichern.Location = new System.Drawing.Point(496, 376);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(2);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(120, 41);
this.buttonSpeichern.Size = new System.Drawing.Size(115, 41);
this.buttonSpeichern.TabIndex = 11;
this.buttonSpeichern.Text = "Speichern";
this.buttonSpeichern.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
@ -110,10 +120,10 @@ namespace Deckungsbeitrag
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.White;
this.buttonAbbrechen.Location = new System.Drawing.Point(619, 376);
this.buttonAbbrechen.Location = new System.Drawing.Point(615, 376);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(2);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(114, 41);
this.buttonAbbrechen.Size = new System.Drawing.Size(115, 41);
this.buttonAbbrechen.TabIndex = 12;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
@ -185,32 +195,6 @@ namespace Deckungsbeitrag
this.label5.TabIndex = 24;
this.label5.Text = "Container schmutzig:";
//
// pictureBoxMinus
//
this.pictureBoxMinus.BackColor = System.Drawing.Color.Red;
this.pictureBoxMinus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxMinus.Image")));
this.pictureBoxMinus.Location = new System.Drawing.Point(174, 256);
this.pictureBoxMinus.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxMinus.Name = "pictureBoxMinus";
this.pictureBoxMinus.Size = new System.Drawing.Size(38, 40);
this.pictureBoxMinus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxMinus.TabIndex = 27;
this.pictureBoxMinus.TabStop = false;
this.pictureBoxMinus.Click += new System.EventHandler(this.Container_Click);
//
// pictureBoxPlus
//
this.pictureBoxPlus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxPlus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlus.Image")));
this.pictureBoxPlus.Location = new System.Drawing.Point(249, 256);
this.pictureBoxPlus.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxPlus.Name = "pictureBoxPlus";
this.pictureBoxPlus.Size = new System.Drawing.Size(38, 40);
this.pictureBoxPlus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxPlus.TabIndex = 26;
this.pictureBoxPlus.TabStop = false;
this.pictureBoxPlus.Click += new System.EventHandler(this.Container_Click);
//
// rBMO
//
this.rBMO.Appearance = System.Windows.Forms.Appearance.Button;
@ -470,6 +454,140 @@ namespace Deckungsbeitrag
this.comboBoxFahrer.TabIndex = 34;
this.comboBoxFahrer.Validating += new System.ComponentModel.CancelEventHandler(this.comboBoxFahrer_Validating);
//
// buttonEinstellung
//
this.buttonEinstellung.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonEinstellung.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.buttonEinstellung.FlatAppearance.BorderSize = 3;
this.buttonEinstellung.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEinstellung.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonEinstellung.Location = new System.Drawing.Point(9, 376);
this.buttonEinstellung.Name = "buttonEinstellung";
this.buttonEinstellung.Size = new System.Drawing.Size(41, 41);
this.buttonEinstellung.TabIndex = 46;
this.buttonEinstellung.Text = "i";
this.buttonEinstellung.UseVisualStyleBackColor = true;
this.buttonEinstellung.Click += new System.EventHandler(this.buttonEinstellung_Click);
//
// panelRegAuftrag
//
this.panelRegAuftrag.Controls.Add(this.pictureBoxAddArtikel);
this.panelRegAuftrag.Controls.Add(this.label8);
this.panelRegAuftrag.Controls.Add(this.comboBoxArtikel);
this.panelRegAuftrag.Controls.Add(this.label7);
this.panelRegAuftrag.Controls.Add(this.comboBoxRhythmus);
this.panelRegAuftrag.Controls.Add(this.fLPArtikel);
this.panelRegAuftrag.Enabled = false;
this.panelRegAuftrag.Location = new System.Drawing.Point(307, -3);
this.panelRegAuftrag.Name = "panelRegAuftrag";
this.panelRegAuftrag.Size = new System.Drawing.Size(427, 355);
this.panelRegAuftrag.TabIndex = 47;
this.panelRegAuftrag.Visible = false;
this.panelRegAuftrag.EnabledChanged += new System.EventHandler(this.panelRegAuftrag_EnabledChanged);
//
// fLPArtikel
//
this.fLPArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.fLPArtikel.AutoScroll = true;
this.fLPArtikel.BackColor = System.Drawing.SystemColors.Control;
this.fLPArtikel.Location = new System.Drawing.Point(19, 149);
this.fLPArtikel.Name = "fLPArtikel";
this.fLPArtikel.Size = new System.Drawing.Size(389, 206);
this.fLPArtikel.TabIndex = 0;
//
// comboBoxRhythmus
//
this.comboBoxRhythmus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.comboBoxRhythmus.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.comboBoxRhythmus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxRhythmus.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.comboBoxRhythmus.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxRhythmus.FormattingEnabled = true;
this.comboBoxRhythmus.Location = new System.Drawing.Point(19, 44);
this.comboBoxRhythmus.Margin = new System.Windows.Forms.Padding(2);
this.comboBoxRhythmus.Name = "comboBoxRhythmus";
this.comboBoxRhythmus.Size = new System.Drawing.Size(389, 33);
this.comboBoxRhythmus.TabIndex = 35;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(15, 20);
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(85, 20);
this.label7.TabIndex = 36;
this.label7.Text = "Rhythmus:";
//
// comboBoxArtikel
//
this.comboBoxArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.comboBoxArtikel.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.comboBoxArtikel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxArtikel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.comboBoxArtikel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxArtikel.FormattingEnabled = true;
this.comboBoxArtikel.Location = new System.Drawing.Point(19, 107);
this.comboBoxArtikel.Margin = new System.Windows.Forms.Padding(2);
this.comboBoxArtikel.Name = "comboBoxArtikel";
this.comboBoxArtikel.Size = new System.Drawing.Size(338, 33);
this.comboBoxArtikel.TabIndex = 37;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label8.Location = new System.Drawing.Point(15, 85);
this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(57, 20);
this.label8.TabIndex = 38;
this.label8.Text = "Artikel:";
//
// pictureBoxAddArtikel
//
this.pictureBoxAddArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxAddArtikel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxAddArtikel.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxAddArtikel.Image")));
this.pictureBoxAddArtikel.Location = new System.Drawing.Point(375, 107);
this.pictureBoxAddArtikel.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxAddArtikel.Name = "pictureBoxAddArtikel";
this.pictureBoxAddArtikel.Size = new System.Drawing.Size(33, 33);
this.pictureBoxAddArtikel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxAddArtikel.TabIndex = 39;
this.pictureBoxAddArtikel.TabStop = false;
this.pictureBoxAddArtikel.Click += new System.EventHandler(this.pictureBoxAddArtikel_Click);
//
// pictureBoxMinus
//
this.pictureBoxMinus.BackColor = System.Drawing.Color.Red;
this.pictureBoxMinus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxMinus.Image")));
this.pictureBoxMinus.Location = new System.Drawing.Point(174, 256);
this.pictureBoxMinus.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxMinus.Name = "pictureBoxMinus";
this.pictureBoxMinus.Size = new System.Drawing.Size(38, 40);
this.pictureBoxMinus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxMinus.TabIndex = 27;
this.pictureBoxMinus.TabStop = false;
this.pictureBoxMinus.Click += new System.EventHandler(this.Container_Click);
//
// pictureBoxPlus
//
this.pictureBoxPlus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxPlus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlus.Image")));
this.pictureBoxPlus.Location = new System.Drawing.Point(249, 256);
this.pictureBoxPlus.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxPlus.Name = "pictureBoxPlus";
this.pictureBoxPlus.Size = new System.Drawing.Size(38, 40);
this.pictureBoxPlus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxPlus.TabIndex = 26;
this.pictureBoxPlus.TabStop = false;
this.pictureBoxPlus.Click += new System.EventHandler(this.Container_Click);
//
// FormNeuerAuftrag
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -478,6 +596,8 @@ namespace Deckungsbeitrag
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.CancelButton = this.buttonAbbrechen;
this.ClientSize = new System.Drawing.Size(741, 431);
this.Controls.Add(this.panelRegAuftrag);
this.Controls.Add(this.buttonEinstellung);
this.Controls.Add(this.comboBoxFahrer);
this.Controls.Add(this.label1);
this.Controls.Add(this.dGArtikel);
@ -512,9 +632,12 @@ namespace Deckungsbeitrag
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "NEUER AUFTRAG";
this.Load += new System.EventHandler(this.FormNeuerAuftrag_Load);
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
this.panelRegAuftrag.ResumeLayout(false);
this.panelRegAuftrag.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxAddArtikel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -553,5 +676,13 @@ namespace Deckungsbeitrag
private System.Windows.Forms.DataGridViewTextBoxColumn KorrekturBearbeitet;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBoxFahrer;
private System.Windows.Forms.Button buttonEinstellung;
private System.Windows.Forms.Panel panelRegAuftrag;
private System.Windows.Forms.FlowLayoutPanel fLPArtikel;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox comboBoxRhythmus;
private System.Windows.Forms.PictureBox pictureBoxAddArtikel;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.ComboBox comboBoxArtikel;
}
}

View File

@ -17,6 +17,8 @@ using System.Web.Caching;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.Text.Json;
using System.Reflection;
using Deckungsbeitrag.UserControls;
namespace Deckungsbeitrag
@ -40,7 +42,7 @@ namespace Deckungsbeitrag
private string userid;
private AuftragTyp auftragtyp = AuftragTyp.Standart;
private string eingabe = string.Empty;
private DateTime nextLiefertag;
private DateTime nextLiefertag = DateTime.Today;
#endregion
#region Form-Konstruktor
@ -70,36 +72,43 @@ namespace Deckungsbeitrag
#endregion
private void FormNeuerAuftrag_Load(object sender, EventArgs e)
{
string kndService = string.Empty;
this.Text += " Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
// SortimentListe holen
sortimentListe = Funktionen.SortimentLesen("Liste");
// Kunde holen
this.kunde = Funktionen.KundenAuswahl();
if (auftragtyp == AuftragTyp.Regelmäßig) kndService = "Geschäft";
this.kunde = Funktionen.Open_List(kndService);
// ComboBox AuftragTyp wird geladen und richtiges Item selected.
// Falls KundenAuswahl null liefert wird Form geschlossen oder wenn Waschstrasse neu geladen.
if (this.kunde != null)
{
Saison Saison = Saison.GetAktivSaison();
if (Saison.Bezeichnung == "Sommer") nextLiefertag = Funktionen.GetNextLiefertag((Liefertage)this.kunde.SommerLieferRhythmus);
if (Saison.Bezeichnung == "Winter") nextLiefertag = Funktionen.GetNextLiefertag((Liefertage)this.kunde.WinterLieferRhythmus);
if (Saison.Bezeichnung == "Zwischensaison")
if (this.auftragtyp != AuftragTyp.Regelmäßig)
{
meldung.GetInfo(this, "Achtung Liefertag kann falsch sein, da Zwischensaison ist.", false);
DateTime datum = DateTime.Today;
int tage = 2;
while (tage > 0)
Saison Saison = Saison.GetAktivSaison();
if (Saison.Bezeichnung == "Sommer") nextLiefertag = Funktionen.GetNextLiefertag((Liefertage)this.kunde.SommerLieferRhythmus);
if (Saison.Bezeichnung == "Winter") nextLiefertag = Funktionen.GetNextLiefertag((Liefertage)this.kunde.WinterLieferRhythmus);
if (Saison.Bezeichnung == "Zwischensaison")
{
datum = datum.AddDays(1);
if (datum.DayOfWeek != DayOfWeek.Saturday && datum.DayOfWeek != DayOfWeek.Sunday)
meldung.GetInfo(this, "Achtung Liefertag kann falsch sein, da Zwischensaison ist.", false);
DateTime datum = DateTime.Today;
int tage = 2;
while (tage > 0)
{
tage--;
datum = datum.AddDays(1);
if (datum.DayOfWeek != DayOfWeek.Saturday && datum.DayOfWeek != DayOfWeek.Sunday)
{
tage--;
}
}
nextLiefertag = datum;
}
nextLiefertag = datum;
}
comboBoxTyp_Load();
comboBoxFahrer_Load();
DatenLaden();
@ -136,16 +145,33 @@ namespace Deckungsbeitrag
//textBoxCont_TextChanged(this.textBoxCont, EventArgs.Empty);
}
private void comboBoxTyp_Load()
{
// Items werden von AuftragTyp geladen.
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragTyp));
{
try
{
this.SuspendLayout();
this.comboBoxTyp.SelectedValueChanged -= comboBoxTyp_SelectedValueChanged;
// Items werden von AuftragTyp geladen.
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragTyp));
// Wenn der Kunde ein Geschäftskunde ist, wird AuftragTyp.Geschäft ausgewählt. Andernfalls wird der AuftragTyp aus dem Konstruktor gewählt.
this.comboBoxTyp.SelectedValueChanged += comboBoxTyp_SelectedValueChanged;
if (kunde.Service == "Geschäft") this.comboBoxTyp.SelectedItem = AuftragTyp.Geschäft;
else this.comboBoxTyp.SelectedItem = auftragtyp;
//TODO: Wenn kunde null dann return.
// Wenn der Kunde ein Geschäftskunde ist, wird AuftragTyp.Geschäft ausgewählt. Andernfalls wird der AuftragTyp aus dem Konstruktor gewählt.
if (kunde.Service == "Geschäft") this.comboBoxTyp.SelectedItem = AuftragTyp.Geschäft;
else this.comboBoxTyp.SelectedItem = auftragtyp;
this.comboBoxTyp.Enabled = false;
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
this.comboBoxTyp.Enabled = true;
}
else this.comboBoxTyp.Enabled = false;
this.ResumeLayout(false);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
Program.AddFehler(this.benutzer, ex.Message, ex.StackTrace, null);
throw;
}
}
private void comboBoxFahrer_Load()
{
@ -179,7 +205,7 @@ namespace Deckungsbeitrag
}
if (col.Name == "Korrektur")
{
if (auftragTyp >= AuftragTyp.Standerhöhung) col.Visible = true;
if (auftragTyp >= AuftragTyp.Standerhöhung & auftragTyp <= AuftragTyp.Standverminderung) col.Visible = true;
else
{
if (auftragTyp == AuftragTyp.Inventur)
@ -247,6 +273,7 @@ namespace Deckungsbeitrag
else Auftrag = new Auftrag();
if (this.benutzer.Rolle == BenutzerRolle.Fahrer) { AuftragSpeichern(); return; }
if ((AuftragTyp)comboBoxTyp.SelectedItem == AuftragTyp.Regelmäßig) { RegAuftragSpeichern(); return; }
//AUFTRAG DATEN ÜBERGEBEN
Auftrag.KundeID = (int)kunde.KundeID;
@ -272,10 +299,10 @@ namespace Deckungsbeitrag
{
if (benutzer.Rolle == BenutzerRolle.Verwaltung || benutzer.Rolle == BenutzerRolle.Admin) Auftrag.Status = AuftragStatus.Herrichten;
else Auftrag.Status = AuftragStatus.Aufgelegt;
else Auftrag.Status = AuftragStatus.Abgeholt;
//Wenn SONDERAUFTRAG(STH,STV,STA) dann ARTIKEL speichern.
if (Auftrag.Typ >= AuftragTyp.Inventur)
if (Auftrag.Typ >= AuftragTyp.Inventur & Auftrag.Typ <= AuftragTyp.Standverminderung)
{
int tosave = 0;
int saved = 0;
@ -356,7 +383,7 @@ namespace Deckungsbeitrag
}
//Wenn SONDERAUFTRAG(STH,STV,STA) dann ARTIKEL speichern.
if (Auftrag.Typ >= AuftragTyp.Inventur)
if (Auftrag.Typ >= AuftragTyp.Inventur & Auftrag.Typ <= AuftragTyp.Standverminderung)
{
int tosave = 0;
int saved = 0;
@ -434,6 +461,62 @@ namespace Deckungsbeitrag
}
private void AuftragUpdate()
{
//AUFTRAG DATEN ÜBERGEBEN
Auftrag.KundeID = (int)kunde.KundeID;
if (Auftrag.AufgabeID == null) { if (kunde.Aufgabe != null) Auftrag.AufgabeID = kunde.Aufgabe; }
Auftrag.Liefertag = this.dTPLiefertag.Value;
Auftrag.Container = int.Parse(this.textBoxCont.Text);
Auftrag.ErstelltVon = (int)this.benutzer.BenutzerID;
Auftrag.Erstellt = DateTime.Now;
if (!this.textBoxCont.Enabled) Auftrag.Container = int.Parse(this.textBoxCont.Text);
Auftrag.Typ = (AuftragTyp)comboBoxTyp.SelectedItem;
Auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID;
}
private void RegAuftragSpeichern()
{
//TODO: ArbeiterID muss gefunden werden. Eventuell suche Aufträge mit Kunden am selben Liefertag und Region.
AuftragUpdate();
Auftrag.ArbeiterID = Auftrag.FindeFahrerIDZuAuftrag(kunde, Auftrag.Liefertag);
Auftrag.Status = AuftragStatus.Herrichten;
Lieferrhythmen.Rhythmus = (RegRhythmen)this.comboBoxRhythmus.SelectedItem;
if (Auftrag.FindeAuftrag(false).Gefunden)
{
Auftrag auf = Auftrag.GetAuftrag(Auftrag.FindeAuftrag(false).auftragID);
List<AuftragArtikel> liste = AuftragArtikel.GetList(auf.AuftragID);
string output = string.Join(Environment.NewLine, liste.Select(a => $"{a.ArtikelName,-20} {a.Anzahl,4} Stk."));
if (MessageBox.Show($"Es wurde ein Auftrag von {kunde.Suchtext ?? kunde.KundeName} für {auf.Liefertag.ToShortDateString()}\nmit folgenden Artikeln gefunden:\n\n{output}\nGeplanter Rhythmus: {Lieferrhythmen.Rhythmus}\n\nMöchtest du den Auftrag als erledigt markieren?", "AUFTRAG GEFUNDEN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
auf.Status = AuftragStatus.Erledigt;
foreach (AuftragArtikel art in liste) { art.Erledigt = true; art.Save(); }
if (auf.Save()[0] != 1) meldung.Speicherfehler();
}
else return;
}
if (Auftrag.Save()[0] != 1) meldung.Speicherfehler();
else
{
foreach (UCArtikel uca in this.fLPArtikel.Controls)
{
AuftragArtikel aufart = new AuftragArtikel()
{
AuftragID = Auftrag.AuftragID,
ArtikelID = ((Artikel)uca.Tag).ArtikelID,
Anzahl = uca.Anzahl,
Erledigt = false,
};
aufart.Save();
}
}
this.Close();
}
private void AuftragSpeichern()
{
//AUFTRAG DATEN ÜBERGEBEN
@ -449,6 +532,16 @@ namespace Deckungsbeitrag
Auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID;
Auftrag.Status = AuftragStatus.Abgeholt;
Tour tour = null;
do
{
tour = Tour.FindeTour(null, Auftrag.ArbeiterID, Auftrag.Liefertag);
if (tour == null) Funktionen.UpdateOrSaveTour(Auftrag.TourID, Auftrag);
} while (tour == null);
Auftrag.TourID = tour.TourID;
if (Auftrag.FindeAuftrag(false).Gefunden)
{
if (meldung.GetFrage(this, $"Der Auftrag {Kunde.GetKunde(null, Auftrag.KundeID, null).Suchtext} Liefertag {Auftrag.Liefertag.ToShortDateString()} ist bereits vorhanden.\nMöchtest du diesen bearbeiten?\n\n[JA] => Auftrag bearbeiten\n[NEIN] => Neuen Auftrag erstellen", false) == DialogResult.Yes)
@ -576,7 +669,7 @@ namespace Deckungsbeitrag
{
if (radioButton.Name.Contains(tag.ToString())) this.dTPLiefertag.Value = Berechnungen.GetNextWeekday((int)tag);
}
this.dTPLiefertag.Enabled = false;
//this.dTPLiefertag.Enabled = false;
}
private void dTPLiefertag_ValueChanged(object sender, EventArgs e)
{
@ -631,6 +724,14 @@ namespace Deckungsbeitrag
private void comboBoxTyp_SelectedValueChanged(object sender, EventArgs e)
{
if (this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
if ((AuftragTyp)comboBoxTyp.SelectedValue != AuftragTyp.Standart & (AuftragTyp)comboBoxTyp.SelectedValue != AuftragTyp.AufAbruf)
{
meldung.GetFehler(this, "Unerlaubter AuftragTyp. Bitte wähle Standart oder AufAbruf.");
return;
}
}
switch ((AuftragTyp)comboBoxTyp.SelectedValue)
{
case AuftragTyp.Geschäft: // Wird derzeit wenig verwendet da die Auswahl in DatenLaden nach KundenService erfolgt.
@ -661,6 +762,18 @@ namespace Deckungsbeitrag
this.Width = this.dGArtikel.Right + 25;
this.Height = this.dGArtikel.Bottom + this.buttonSpeichern.Height + 60;
break;
case AuftragTyp.Regelmäßig:
this.dGArtikel.Enabled = this.dGArtikel.Visible = false;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.Width = this.panelRegAuftrag.Right + 25;
this.Height = 470;
break;
case AuftragTyp.AufAbruf:
this.dGArtikel.Enabled = this.dGArtikel.Visible = false;
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
break;
default:
break;
}
@ -678,13 +791,60 @@ namespace Deckungsbeitrag
}
}
private void buttonEinstellung_Click(object sender, EventArgs e)
{
FormKundeVW kundeVW = new FormKundeVW(this.kunde);
kundeVW.ShowDialog();
}
private void pictureBoxAddArtikel_Click(object sender, EventArgs e)
{
int index = 0;
int artAnzahl = 1;
string anzahl = string.Empty;
Artikel art = (Artikel)this.comboBoxArtikel.SelectedItem;
do
{
if (index > 0) MessageBox.Show("Bitte nur ganze Zahlen eingeben.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Warning);
anzahl = Interaction.InputBox($"Wieviel Stück {art.Bezeichnung} sollen geliefert werden?\n\nStück:", "Artikelanzahl", "");
index++;
} while (!int.TryParse(anzahl, out artAnzahl));
UCArtikel uca = new UCArtikel(art, artAnzahl);
uca.Width = fLPArtikel.Width - 25;
uca.DeleteClicked += Uca_DeleteClicked;
this.fLPArtikel.Controls.Add(uca);
}
private void Uca_DeleteClicked(object sender, EventArgs e)
{
this.fLPArtikel.Controls.Remove((UCArtikel)sender);
}
private void panelRegAuftrag_EnabledChanged(object sender, EventArgs e)
{
Panel panel = sender as Panel;
int dropdownWidth = comboBoxArtikel.DropDownWidth;
if (panel.Enabled)
{
List<Artikel> artikelListe = Artikel.GetRegArtikelList();
comboBoxArtikel.DataSource = artikelListe;
comboBoxArtikel.DisplayMember = "Bezeichnung";
foreach (Artikel art in artikelListe)
{
int bezWidth = TextRenderer.MeasureText(art.Bezeichnung, comboBoxArtikel.Font).Width;
if (dropdownWidth < bezWidth) dropdownWidth = bezWidth;
}
comboBoxArtikel.DropDownWidth = dropdownWidth;
comboBoxArtikel.SelectedIndex = -1;
comboBoxRhythmus.DataSource = Enum.GetValues(typeof(RegRhythmen));
comboBoxRhythmus.SelectedIndex = -1;
}
}
}
}
//CHANGES: Wenn BenutzerRolle ist Fahrer wird Fenster nicht geschlossen sondern mit Kundenauswahl weiter gemacht.
//CHANGES: CSV Datei wird erstellt oder bei jeder Inventur erweitert. (Einfach in Excel importieren und auswerten.)
//CHANGES: Liefertag errechnet sich jetzt aus dem Lieferrhythmus. Funktion wählt nächstmöglichen Liefertermin im Rhythmus. Bei Klick auf Tag bleibt alles gleich. (Auch mit Heute liefern?)
//CHANGES: Wenn Fahrer Auftrag erstellt wird beim Speichern standardmäßig seine ID als ArbeiterID gespeichert. Bedeutet ausführender = Fahrer selber.
//CHANGES: NeuerAuftrag wird jetzt mit Propertie AuftragTyp aufgerufen. Dadurch ist die Auswahl des AuftragTyp konstanter.
//DONE: Fehler wenn FormListe mit X geschlossen wird und Kunde null ist wurde behoben.
//DONE: Wenn Fahrer einen Auftrag an Kollege übergibt?
//TODO: Form AuftragDetail muss überarbeitet werden.
//TODO: TourenListe Entwurf muss überarbeitet werden.
//TODO: Grund immer abfragen oder nur wenn Fahrer die Zuteilung ändert?

View File

@ -117,21 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxMinus.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAADJJREFUOE9jYBgF1Affv393IITR9aCAb9++/SeE0fWgAJACJycnnJg+BhDC6HpG
wUADABXZimqO3LMmAAAAAElFTkSuQmCC
</value>
</data>
<data name="pictureBoxPlus.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAAFZJREFUOE+9kEEKACEMxHxb//+eXruwbGEwHhwKK+QSaqSuqloTIFwgXCBcKL6T
maW0xzyEBCLixQroqxpo9vljoC/u/BcYrTD+RA0o1wEXCBcIFwiXB07Nzd/k/DvRAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="KundeArtikelID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -162,6 +147,28 @@
<metadata name="KorrekturBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxAddArtikel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAAFZJREFUOE+9kEEKACEMxHxb//+eXruwbGEwHhwKK+QSaqSuqloTIFwgXCBcKL6T
maW0xzyEBCLixQroqxpo9vljoC/u/BcYrTD+RA0o1wEXCBcIFwiXB07Nzd/k/DvRAAAAAElFTkSuQmCC
</value>
</data>
<data name="pictureBoxMinus.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAADJJREFUOE9jYBgF1Affv393IITR9aCAb9++/SeE0fWgAJACJycnnJg+BhDC6HpG
wUADABXZimqO3LMmAAAAAElFTkSuQmCC
</value>
</data>
<data name="pictureBoxPlus.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAAFZJREFUOE+9kEEKACEMxHxb//+eXruwbGEwHhwKK+QSaqSuqloTIFwgXCBcKL6T
maW0xzyEBCLixQroqxpo9vljoC/u/BcYrTD+RA0o1wEXCBcIFwiXB07Nzd/k/DvRAAAAAElFTkSuQmCC
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAAAAAAAEAIAC5FQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAAAFv

View File

@ -100,7 +100,7 @@ namespace Deckungsbeitrag.AA_Forms
foreach (Kunde kunde in kundenliste)
{
// Wenn kein Suchtext vorhanden, dann KundeName verwenden.
KundenControl control = new KundenControl(kunde);
UCKunde control = new UCKunde(kunde);
control.Tag = kunde;
flowLayoutPanelKunden.Controls.Add(control);
}
@ -158,7 +158,7 @@ namespace Deckungsbeitrag.AA_Forms
}
private void SpeichereAlleTabs(RadioButton rb)
{
var alleTabs = new List<TourenDaten>();
var alleTabs = new List<TDaten>();
foreach (TabPage tab in tabControlLKW.TabPages)
{
@ -193,7 +193,7 @@ namespace Deckungsbeitrag.AA_Forms
try
{
var tabDaten = JsonSerializer.Deserialize<List<TourenDaten>>(json);
var tabDaten = JsonSerializer.Deserialize<List<TDaten>>(json);
// Bestehende Tabs löschen
tabControlLKW.TabPages.Clear();
@ -245,7 +245,7 @@ namespace Deckungsbeitrag.AA_Forms
/// <param name="form"></param>
/// <param name="kundectr"></param>
/// <returns>true wenn noch KundenControl-Clone verfügbar sind</returns>
public static bool KundenControlToClone(FormTourenplanung form, KundenControl kundectr)
public static bool KundenControlToClone(FormTourenplanung form, UCKunde kundectr)
{
Kunde _kunde = (Kunde)kundectr.Tag;
int maxAllowed = 0;
@ -273,7 +273,7 @@ namespace Deckungsbeitrag.AA_Forms
{
if (subsubCtrl is FlowLayoutPanel flowPanel)
{
count += flowPanel.Controls.OfType<KundenControl>()
count += flowPanel.Controls.OfType<UCKunde>()
.Count(c => ((Kunde)c.Tag).KundeID == _kunde.KundeID);
}
}
@ -296,7 +296,7 @@ namespace Deckungsbeitrag.AA_Forms
if (this.comboBoxFilter.SelectedIndex != -1) GetList((string)this.comboBoxFilter.SelectedItem);
}
public static void KundenControlToDelete(FormTourenplanung form, KundenControl kundectr)
public static void KundenControlToDelete(FormTourenplanung form, UCKunde kundectr)
{
Kunde _knd = (Kunde)kundectr.Tag;
int saisonrhythmus = 0;
@ -321,7 +321,7 @@ namespace Deckungsbeitrag.AA_Forms
if (subsubCtrl is FlowLayoutPanel flowPanel)
{
// Zu List konvertieren, damit während Iteration nicht modifiziert wird
foreach (KundenControl kc in flowPanel.Controls.OfType<KundenControl>().ToList())
foreach (UCKunde kc in flowPanel.Controls.OfType<UCKunde>().ToList())
{
if(_knd == (Kunde)kc.Tag)
{
@ -367,12 +367,6 @@ namespace Deckungsbeitrag.AA_Forms
}
//CHANGES: Es wir kontrolliert ob der gewählte Liefertag zum hinterlegten Lieferrhythmus passt.
//CHANGES: Es kann nach der Kontrolle der Lieferrhythmus geändert werden. Dazu muss auch die Anzahl der Liefertage gewählt werden.
//CHANGES: ComboBox kann zum Filtern der Kunden verwendet werden.
//CHANGES: Es können nur so viele Clone erstellt werden wie Liefertag im Lieferrhythmus hinterlegt sind.
//CHANGES: TabText wird mit Benutzerliste verglichen. Wenn ein passender gefunden wird Tag hinterlegt.
//DONE: Testen ob umbenennen funktioniert.
//DONE: Max Clones von PanelKunde zu PanelTourenplanung. (Lieferrythmus eingeben?)
//DONE: Speichern der Touren ermöglichen. Eventuell über .json oder .xml Datei?
//DONE: Filter für Regionen ermöglichen.
//TODO: Funktioniert mehrere KundenControls auf einmal DragDrop?
//DONE: Wenn der Lieferrhythmus geändert wurde müssen alle Clone von falschen Tagen gelöscht werden.

31
AA-Klassen/AppStarter.cs Normal file
View File

@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deckungsbeitrag
{
[RunInstaller(true)]
public class AppStarterInstaller : Installer
{
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
string appPath = Path.Combine(
@"C:\Program Files (x86)\Kilian Wirl GmbH\Verwaltung",
"Deckungsbeitrag.exe"); // Deine Haupt-App
if (File.Exists(appPath))
{
Process.Start(appPath);
}
}
}
}

View File

@ -23,26 +23,41 @@ namespace DatenDB
public class Artikel
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
public const string COLUMNS = "artikel_id, nummer, bezeichnung, short, nachwaesche, muellwaesche, last_reset, kategorie";
public const string COLUMNS = "artikel_id, nummer, bezeichnung, short, nachwaesche, muellwaesche, last_reset, kategorie"; // aktive hinzufügen
private const string TABLE = "kundenverwaltung.artikel";
public Artikel() { }
public Artikel(string row, int nr)
{
if (nr == 0) return; //ERSTE ZEILE IGNORIEREN.
//if (nr <= 1) return; //ERSTE ZEILE IGNORIEREN.
string[] zeileData = row.Split(';');
this.Nummer = Convert.ToInt32(zeileData[1]);
this.Bezeichnung = zeileData[3];
this.Short = zeileData[4];
if (zeileData[0] == "60" || zeileData[0] == "20")
{
this.Nummer = Convert.ToInt32(zeileData[1]);
this.Bezeichnung = zeileData[3];
//this.Short = zeileData[4];
}
}
internal static int? GetArtikelID(int artNr)
{
DatenbankConnection.GetConnection().Open();
int? result = 0;
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select artikel_id from {TABLE} where nummer = {artNr}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = reader.GetInt32(0);
reader.Close();
DatenbankConnection.GetConnection().Close();
return result;
}
public static Artikel GetArtikel(int? artikelNr)
{
DatenbankConnection.GetConnection().Open();
Artikel result = new Artikel();
Artikel result = null;
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where nummer = {artikelNr}";
@ -52,6 +67,22 @@ namespace DatenDB
DatenbankConnection.GetConnection().Close();
return result;
}
internal static List<Artikel> GetRegArtikelList()
{
DatenbankConnection.GetConnection().Open();
List<Artikel> resultList = new List<Artikel>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where SUBSTRING(nummer::text, 2, 1) = '9'";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new Artikel(reader));
reader.Close();
DatenbankConnection.GetConnection().Close();
return resultList;
}
public static List<Artikel> GetArtikelList()
{
DatenbankConnection.GetConnection().Open();
@ -134,6 +165,7 @@ namespace DatenDB
return result;
}
public Artikel(NpgsqlDataReader reader)
{
this.ArtikelID = reader.GetInt32(0);

View File

@ -1,4 +1,5 @@
using BrightIdeasSoftware;
using Deckungsbeitrag;
using Npgsql;
using System;
using System.Collections.Generic;
@ -103,7 +104,7 @@ namespace DatenDB
this.Bezeichnung = reader.IsDBNull(1) ? string.Empty : reader.GetString(1);
this.Beschreibung = reader.IsDBNull(2) ? string.Empty : reader.GetString(2);
this.Kategorie = reader.IsDBNull(3) ? Kategorie.Fahrer : (Kategorie)reader.GetInt16(3);
this.Farbe = reader.IsDBNull(4) ? Color.FromArgb(1, 53, 101) : (Color)HexConverter(Color.FromArgb(1, 53, 101), reader.GetString(4));
this.Farbe = reader.IsDBNull(4) ? Program.Wirlblau : (Color)HexConverter(Program.Wirlblau, reader.GetString(4));
this.Aktiv = reader.IsDBNull(5) ? true : reader.GetBoolean(5);
}

View File

@ -1,13 +1,17 @@
using BrightIdeasSoftware;
using Deckungsbeitrag;
using Deckungsbeitrag.AA_Klassen;
using HarfBuzzSharp;
using Npgsql;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace DatenDB
@ -26,7 +30,7 @@ namespace DatenDB
Fertig = 6,
Geladen = 7,
Ausgeliefert = 8,
AufAbruf = 9
Erledigt = 10
}
/// <summary>
@ -38,7 +42,9 @@ namespace DatenDB
Standart = 1,
Inventur = 2,
Standerhöhung = 3,
Standverminderung = 4
Standverminderung = 4,
Regelmäßig = 5,
AufAbruf = 6
}
[Flags]
@ -64,35 +70,38 @@ namespace DatenDB
public class Auftrag
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
public const string COLUMNS = "auftrag_id, benutzer_id, aufgabe_id, kunde_id, zusatz, liefertag, gedruckt, gedruckt_von, erledigt, erledigt_von, erstellt, erstellt_von, status, tour_id, container_dirt, maschine_id, container_clean, typ, aufgabe_erledigt, abteilungen_status";
public const string ACOLUMNS = "a.auftrag_id, a.benutzer_id, a.aufgabe_id, a.kunde_id, a.zusatz, a.liefertag, a.gedruckt, a.gedruckt_von, a.erledigt, a.erledigt_von, a.erstellt, a.erstellt_von, a.status, a.tour_id, a.container_dirt, a.maschine_id, a.container_clean, a.typ, a.aufgabe_erledigt, a.abteilungen_status";
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
public const string COLUMNS = "auftrag_id, benutzer_id, aufgabe_id, kunde_id, zusatz, liefertag, gedruckt, gedruckt_von, erledigt, erledigt_von, erstellt, erstellt_von, status, tour_id, container_dirt, maschine_id, container_clean, typ, aufgabe_erledigt, abteilungen_status, rhythmus";
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
public const string ACOLUMNS = "a.auftrag_id, a.benutzer_id, a.aufgabe_id, a.kunde_id, a.zusatz, a.liefertag, a.gedruckt, a.gedruckt_von, a.erledigt, a.erledigt_von, a.erstellt, a.erstellt_von, a.status, a.tour_id, a.container_dirt, a.maschine_id, a.container_clean, a.typ, a.aufgabe_erledigt, a.abteilungen_status, a.rhythmus";
private const string TABLE = "kundenverwaltung.auftrag";
public const string ASPECTS = "FahrerID,AufgabeID,KundeID,ZusatzInfo,Wann,Gedruckt,Erledigt,Erstellt von,Erstellt Am";
static bool isExpedit = false;
public Auftrag()
public event PropertyChangedEventHandler PropertyChanged;
public Auftrag()
{
}
#region async Tasks
public static async Task<List<Auftrag>> GetAuftragListTodayAsync(DateTime produktion, NpgsqlConnection conn, AuftragTyp typ, int? abtstatus)
{
List<Auftrag> resultList = new List<Auftrag>();
isExpedit = true;
bool 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 = {(int)typ} AND erstellt::date = @produktion AND (a.abteilungen_status & 2) = 0 OR typ = {(int)typ} AND status < {(int)AuftragStatus.Fertig} 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 erstellt::date = @produktion OR typ = {(int)typ} AND status < {(int)AuftragStatus.Fertig} ORDER BY liefertag ASC"; //Status kleiner FERTIG
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 = {(int)typ} AND status < {(int)AuftragStatus.Fertig} 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.Fertig} ORDER BY liefertag ASC"; //Aufträge Typ STANDART, Status kleiner FERTIG Erstellungsdatum EGAL.
// Sollten Aufträge nicht richtig angezeigt werden: 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 erstellt::date = @produktion OR typ = {(int)typ} AND status < {(int)AuftragStatus.Fertig} ORDER BY liefertag ASC"; //Status kleiner FERTIG
command.Parameters.AddWithValue("@produktion", produktion.Date);
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader));
resultList.Add(new Auftrag(reader, isExpedit));
}
}
isExpedit = false;
//isExpedit1 = false;
return resultList;
}
public static async Task<List<Auftrag>> GetExpeditListsAsync(int? typ, NpgsqlConnection conn, int? abtstatus)
@ -109,10 +118,10 @@ namespace DatenDB
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader));
resultList.Add(new Auftrag(reader, isExpedit));
}
}
isExpedit = false;
//isExpedit = false;
return resultList;
}
public static async Task<List<Auftrag>> GetStatusListAsync(int? status, NpgsqlConnection conn)
@ -128,13 +137,34 @@ namespace DatenDB
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader));
resultList.Add(new Auftrag(reader, isExpedit));
}
}
isExpedit = false;
//isExpedit = false;
return resultList;
}
public static async Task<List<Auftrag>> GetFahrerListAsync(int? fahrerID, NpgsqlConnection conn)
{
List<Auftrag> resultList = new List<Auftrag>();
isExpedit = true;
using (var command = new NpgsqlCommand())
{
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";
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
resultList.Add(new Auftrag(reader, isExpedit));
}
}
//isExpedit = false;
return resultList;
}
public static async Task<Dictionary<DateTime, List<Auftrag>>> GetAuftraegeProLiefertagAsync(NpgsqlConnection conn, AuftragTyp standart, AuftragStatus aufgelegt)
{
@ -147,7 +177,7 @@ namespace DatenDB
using (var command = new NpgsqlCommand())
{
command.Connection = conn;
command.CommandText = $"SELECT {COLUMNS} from {TABLE} where typ <= {(int)standart} and status <= {(int)aufgelegt} and liefertag >= CURRENT_DATE order by liefertag";
command.CommandText = $"SELECT {COLUMNS} from {TABLE} where status <= {(int)aufgelegt} and liefertag >= CURRENT_DATE order by liefertag";
using (var reader = await command.ExecuteReaderAsync())
{
@ -252,7 +282,7 @@ namespace DatenDB
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {ACOLUMNS} from {TABLE} a join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id where typ = 1 and a.liefertag = '{dateTime}' and a.benutzer_id = {fahrer.BenutzerID} and a.status >= {(int)AuftragStatus.Vorbereitet} and a.status <= {(int)AuftragStatus.Fertig} order by k.region, k.bezeichnung";
command.CommandText = $"select {ACOLUMNS} from {TABLE} a join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id where typ >= {(int)AuftragTyp.Standart} and a.liefertag = '{dateTime}' and a.benutzer_id = {fahrer.BenutzerID} and a.status <= {(int)AuftragStatus.Fertig} order by k.region, k.bezeichnung";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new Auftrag(reader));
@ -263,15 +293,27 @@ namespace DatenDB
public static Auftrag GetAuftrag(int? auftragID)
{
DatenbankConnection.GetConnection().Open();
Auftrag result = new Auftrag();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where auftrag_id = {auftragID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Auftrag(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
Auftrag result = new Auftrag();
try
{
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where auftrag_id = {auftragID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Auftrag(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
Program.AddFehler(null, ex.Message, ex.StackTrace, null);
throw;
}
return result;
}
public static Auftrag GetLastAuftrag(int? benutzerID)
@ -295,8 +337,11 @@ namespace DatenDB
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (string.IsNullOrWhiteSpace(zusatz)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kunde.KundeID} and status = {(int)AuftragStatus.Abgeholt}";
else command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kunde.KundeID} and status = {(int)AuftragStatus.Abgeholt} and zusatz ~* '{zusatz}'";
if (string.IsNullOrWhiteSpace(zusatz))
{
command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kunde.KundeID} and status = {(int)AuftragStatus.Abgeholt}";
}
else command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kunde.KundeID} and status = {(int)AuftragStatus.Abgeholt} and zusatz ~* '{zusatz}'";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result.Add(new Auftrag(reader));
reader.Close();
@ -304,20 +349,96 @@ namespace DatenDB
return result;
}
private bool FindAuftragStatus(int? auftragid, AuftragStatus status)
{
if (!auftragid.HasValue) return false;
NpgsqlConnection conn = null;
NpgsqlCommand cmd = null;
try
{
conn = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
conn.Open();
cmd = new NpgsqlCommand(@"
SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END
FROM kundenverwaltung.auftrag_status
WHERE auftrag_id = @AuftragId AND auftrag_status = @Status", conn);
cmd.Parameters.AddWithValue("AuftragId", auftragid.Value);
cmd.Parameters.AddWithValue("Status", (int)status);
int result = (int)cmd.ExecuteScalar();
return result > 0;
}
catch (Exception)
{
throw;
}
finally
{
if (cmd != null) cmd.Dispose();
if (conn != null && conn.State == ConnectionState.Open)
{
conn.Close();
conn.Dispose();
}
}
}
internal int? FindeFahrerIDZuAuftrag(Kunde kunde, DateTime liefertag)
{
int? result = null;
try
{
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select a.benutzer_id from {TABLE} a inner join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id where k.region = '{kunde.Region}' and a.liefertag = '{liefertag.Date}' order by a.benutzer_id limit 1";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = reader.GetInt32(0);
reader.Close();
DatenbankConnection.GetConnection().Close();
return result;
}
catch (Exception ex)
{
throw;
}
}
public (bool Gefunden, int auftragID) FindeAuftrag(bool exakt)
{
int result = 0;
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (exakt) command.CommandText = $"select auftrag_id from {TABLE} where kunde_id = {this.KundeID} and erstellt::date = '{this.Erstellt.Value.Date}' and liefertag = '{this.Liefertag}'";
else command.CommandText = $"select auftrag_id from {TABLE} where kunde_id = {this.KundeID} and liefertag = '{this.Liefertag}' and status = {(int)AuftragStatus.Abgeholt}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = reader.GetInt16(0);
reader.Close();
DatenbankConnection.GetConnection().Close();
try
{
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (this.Typ != AuftragTyp.Regelmäßig)
{
if (exakt) command.CommandText = $"select auftrag_id from {TABLE} where kunde_id = {this.KundeID} and erstellt::date = '{this.Erstellt.Value.Date}' and liefertag = '{this.Liefertag}'";
else command.CommandText = $"select auftrag_id from {TABLE} where kunde = {this.KundeID} and liefertag = '{this.Liefertag}' and status = {(int)this.Status}";
}
else command.CommandText = $"select auftrag_id from {TABLE} where kunde_id = {this.KundeID} and typ = {(int)this.Typ}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = reader.GetInt16(0);
reader.Close();
DatenbankConnection.GetConnection().Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
Program.AddFehler(null, ex.Message, ex.StackTrace, null);
throw;
}
if(result > 0) return (true, result);
@ -387,6 +508,39 @@ namespace DatenDB
return result;
}
public Auftrag(NpgsqlDataReader reader, bool isExpedit = true)
{
this.AuftragID = reader.GetInt32(0);
this.ArbeiterID = reader.IsDBNull(1) ? null : (int?)reader.GetInt32(1);
this.AufgabeID = reader.IsDBNull(2) ? null : (int?)reader.GetInt32(2);
this.KundeID = reader.GetInt32(3);
this.ZusatzInfo = reader.IsDBNull(4) ? string.Empty : reader.GetString(4);
this.Liefertag = reader.GetDateTime(5);
this.Gedruckt = reader.IsDBNull(6) ? null : (DateTime?)reader.GetDateTime(6);
this.GedrucktVon = reader.IsDBNull(7) ? null : (int?)reader.GetInt32(7);
this.Erledigt = reader.IsDBNull(8) ? null : (DateTime?)reader.GetDateTime(8);
this.ErledigtVon = reader.IsDBNull(9) ? null : (int?)reader.GetInt32(9);
this.Erstellt = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
this.ErstelltVon = reader.GetInt32(11);
this.Status = (AuftragStatus)reader.GetInt32(12);
this.TourID = reader.IsDBNull(13) ? null : (int?)reader.GetInt32(13);
this.Container = reader.IsDBNull(14) ? 0 : reader.GetInt32(14);
this.MaschineID = reader.IsDBNull(15) ? null : (int?)reader.GetInt32(15);
this.ContainerClean = reader.IsDBNull(16) ? 0 : reader.GetInt32(16);
this.Typ = reader.IsDBNull(17) ? AuftragTyp.Standart : (AuftragTyp)reader.GetInt32(17);
this.AufgabeErledigt = reader.IsDBNull(18) ? false : reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
if (isExpedit)
{
this.Kundename = reader.GetString(21);
this.Kundename = reader.IsDBNull(22) ? this.Kundename : reader.GetString(22);
if (this.Kundename == "BAR DIVERSE") this.Kundename = this.ZusatzInfo;
this.Fahrer = reader.IsDBNull(23) ? string.Empty : reader.GetString(23);
}
}
public Auftrag(NpgsqlDataReader reader)
{
@ -410,14 +564,7 @@ namespace DatenDB
this.Typ = reader.IsDBNull(17) ? AuftragTyp.Standart : (AuftragTyp)reader.GetInt32(17);
this.AufgabeErledigt = reader.IsDBNull(18) ? false : reader.GetBoolean(18);
this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19);
if (isExpedit)
{
this.Kundename = reader.GetString(20);
this.Kundename = reader.IsDBNull(21) ? this.Kundename : reader.GetString(21);
if (this.Kundename == "BAR DIVERSE") this.Kundename = this.ZusatzInfo;
this.Fahrer = reader.IsDBNull(22) ? string.Empty : reader.GetString(22);
}
this.Rhythmus = reader.IsDBNull(20) ? RegRhythmen.Unbekannt : (RegRhythmen)reader.GetInt32(20);
}
@ -452,15 +599,34 @@ namespace DatenDB
[OLVColumn("sauber", DisplayIndex = 4, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)]
public int ContainerClean { get; set; }
/// <summary>
/// SPALTE 6 - Der Status wird angezeigt.
/// </summary>
/// <summary>
/// SPALTE 6 - Der Status wird angezeigt.
/// </summary>
private AuftragStatus _status;
[OLVColumn("Status", DisplayIndex = 5)]
public AuftragStatus Status { get; set; }
public AuftragStatus Status
{
get => _status;
set
{
if (_status == value) return;
/// <summary>
/// SPALTE 7 - Der Auftragtyp wird angezeigt.
/// </summary>
_status = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Status)));
if (this.AuftragID != null)
{
if (!FindAuftragStatus(this.AuftragID, Status))
SpeichereStatus(); // Automatisches Speichern
}
}
}
/// <summary>
/// SPALTE 7 - Der Auftragtyp wird angezeigt.
/// </summary>
[OLVColumn("Typ", IsVisible = true, DisplayIndex = 6)]
public AuftragTyp Typ { get; set; }
@ -534,7 +700,7 @@ namespace DatenDB
{
get
{
if (Typ >= AuftragTyp.Inventur)
if (Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.Standverminderung)
{
if (Status >= AuftragStatus.Vorbereitet) return _fertig = string.Empty;
else return _fertig = "🖨";
@ -560,7 +726,7 @@ namespace DatenDB
{
get
{
if(Typ >= AuftragTyp.Inventur)
if(Typ >= AuftragTyp.Inventur & Typ <= AuftragTyp.Standverminderung)
{
if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty;
else return _fertig = "✅";
@ -620,8 +786,45 @@ namespace DatenDB
public bool AufgabeErledigt { get; set; } = false;
[OLVIgnore]
public AbteilungsStatus Abteilungen { get; set; }
[OLVIgnore]
public RegRhythmen Rhythmus { get; set; }
#endregion
private void SpeichereStatus()
{
var conn = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); // Pro Task!
try
{
conn.Open();
int auftragStatusID = 0;
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = conn;
command.CommandText = "select nextval('kundenverwaltung.auftrag_status_seq')";
auftragStatusID = (int)(long)command.ExecuteScalar();
command.CommandText = $"INSERT INTO kundenverwaltung.auftrag_status(auftrag_status_id, auftrag_id, benutzer_id, auftrag_status, status_changed) VALUES (:p0, :p1, :p2, :p3, :p4)";
command.Parameters.AddWithValue("p0", auftragStatusID);
command.Parameters.AddWithValue("p1", this.AuftragID);
command.Parameters.AddWithValue("p2", Program.benutzer == null ? (object)DBNull.Value : Program.benutzer.BenutzerID);
command.Parameters.AddWithValue("p3", (int)_status);
command.Parameters.AddWithValue("p4", DateTime.Now);
command.ExecuteNonQuery();
}
catch (Exception)
{
throw;
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
conn.Dispose();
}
}
public int[] Save()
{
@ -632,13 +835,13 @@ namespace DatenDB
if (this.AuftragID.HasValue & this.AuftragID != 0)
{
command.CommandText = $"update {TABLE} set benutzer_id = :p1, aufgabe_id = :p2, kunde_id = :p3, zusatz = :p4, liefertag = :p5, gedruckt = :p6, gedruckt_von = :p7, erledigt = :p8, erledigt_von = :p9, erstellt = :p10, erstellt_von = :p11, status = :p12, tour_id = :p13, container_dirt = :p14, maschine_id = :p15, container_clean = :p16, typ = :p17, aufgabe_erledigt = :p18, abteilungen_status = :p19 WHERE auftrag_id = :p0";
command.CommandText = $"update {TABLE} set benutzer_id = :p1, aufgabe_id = :p2, kunde_id = :p3, zusatz = :p4, liefertag = :p5, gedruckt = :p6, gedruckt_von = :p7, erledigt = :p8, erledigt_von = :p9, erstellt = :p10, erstellt_von = :p11, status = :p12, tour_id = :p13, container_dirt = :p14, maschine_id = :p15, container_clean = :p16, typ = :p17, aufgabe_erledigt = :p18, abteilungen_status = :p19, rhythmus = :p20 WHERE auftrag_id = :p0";
}
else
{
command.CommandText = "select nextval('kundenverwaltung.auftrag_seq')";
this.AuftragID = result[1] = (int)(long)command.ExecuteScalar();
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, :p12, :p13, :p14, :p15, :p16, :p17, :p18, :p19)";
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, :p12, :p13, :p14, :p15, :p16, :p17, :p18, :p19, :p20)";
}
command.Parameters.AddWithValue("p0", this.AuftragID);
@ -661,6 +864,7 @@ namespace DatenDB
command.Parameters.AddWithValue("p17", (int)this.Typ);
command.Parameters.AddWithValue("p18", this.AufgabeErledigt);
command.Parameters.AddWithValue("p19", (int)this.Abteilungen);
command.Parameters.AddWithValue("p20", (int)this.Rhythmus);
result[0] = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close();
@ -680,4 +884,9 @@ namespace DatenDB
}
}
//INSTALL-REMINDER: Change Status in DB-Auftrag von 7 auf 6
//INSTALL-REMINDER: Change Status in DB-Auftrag von 7 auf 6
//INSTALL-REMINDER: Tabelle Auftrag_Status muss in DB erstellt werden.
//CHANGES: Wenn AuftragStatus geändert wird, wird in der DB gesucht ob bereits ein Eintrag mit AuftragID und Status übereinstimmt. Wenn ja wird ignoriert, sonst wird ein Eintrag erstellt.
//CHANGES: Gespeichert wird AuftragID, Status, Zeitpunkt und User des Changes.
//CHANGES: Abfragen müssen versucht werden wenn Einträge existieren. (Wieviele Container wurden pro Tag gewaschen?, etc.)
//CAHNGES: Abfragen von Standartliste in Expedit wird ohne ERSTELLT AM abgefragt. Nur Aufträge nach TYP und STATUS.

View File

@ -12,20 +12,20 @@ namespace DatenDB
public class AuftragArtikel
{
private static string TABLE = "kundenverwaltung.auftrag_artikel";
private static string COLUMNS = "auftrag_artikel_id, auftrag_id, artikel_nr, artikel_name, anzahl, erledigt";
private static string COLUMNS = "auftrag_artikel_id, auftrag_id, artikel_id, artikel_name, anzahl, erledigt";
public Kunde kunde;
public AuftragArtikel()
{
}
public static List<AuftragArtikel> GetList(string auftragnr)
public static List<AuftragArtikel> GetList(int? auftragID)
{
DatenbankConnection.GetConnection().Open();
List<AuftragArtikel> resultList = new List<AuftragArtikel>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where auftrag_id = {auftragnr}";
command.CommandText = $"select {COLUMNS} from {TABLE} where auftrag_id = {auftragID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new AuftragArtikel(reader, 1));
reader.Close();
@ -55,7 +55,7 @@ namespace DatenDB
command.Connection = DatenbankConnection.GetConnection();
if(this.AuftragArtikelID.HasValue & this.AuftragArtikelID != 0)
{
command.CommandText = $"update {TABLE} set auftrag_id = :p1, artikel_nr = :p2, artikel_name = :p3, anzahl = :p4, erledigt = :p5 WHERE auftrag_artikel_id = :p0";
command.CommandText = $"update {TABLE} set auftrag_id = :p1, artikel_id = :p2, artikel_name = :p3, anzahl = :p4, erledigt = :p5 WHERE auftrag_artikel_id = :p0";
}
else
{
@ -66,7 +66,7 @@ namespace DatenDB
command.Parameters.AddWithValue("p0", this.AuftragArtikelID.Value);
command.Parameters.AddWithValue("p1", this.AuftragID);
command.Parameters.AddWithValue("p2", this.ArtikelNR);
command.Parameters.AddWithValue("p2", this.ArtikelID.Value);
command.Parameters.AddWithValue("p3", string.IsNullOrWhiteSpace(this.ArtikelName) ? (object)DBNull.Value : this.ArtikelName);
command.Parameters.AddWithValue("p4", this.Anzahl);
command.Parameters.AddWithValue("p5", this.Erledigt);
@ -83,8 +83,8 @@ namespace DatenDB
{
this.AuftragArtikelID = reader.GetInt32(0);
this.AuftragID = reader.GetInt32(1);
this.ArtikelNR = reader.GetInt32(2);
this.ArtikelName = reader.GetString(3);
this.ArtikelID = reader.GetInt32(2);
this.ArtikelName = reader.IsDBNull(3) ? string.Empty : reader.GetString(3);
this.Anzahl = reader.GetInt32(4);
this.Erledigt = reader.GetBoolean(5);
}
@ -101,7 +101,7 @@ namespace DatenDB
public int? AuftragArtikelID { get; set; }
public int? AuftragID { get; set; }
public int ArtikelNR { get; set; }
public int? ArtikelID { get; set; }
public string ArtikelName { get; set; }
public int Anzahl { get; set; }
public bool Erledigt { get; set; }

View File

@ -1,4 +1,5 @@
using BrightIdeasSoftware;
using Deckungsbeitrag;
using Npgsql;
using System;
using System.Collections.Generic;
@ -73,17 +74,26 @@ namespace DatenDB
public static Benutzer GetBenutzer(string benutzerName, int? benID)
{
DatenbankConnection.GetConnection().Open();
Benutzer benutzer = new Benutzer();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if(!string.IsNullOrEmpty(benutzerName)) command.CommandText = $"select {COLUMNS} from {TABLE} where benutzer_name = '{benutzerName}'";
if(benID != null) command.CommandText = $"select {COLUMNS} from {TABLE} where benutzer_id = {benID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) benutzer = new Benutzer(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
return benutzer;
Benutzer benutzer = new Benutzer();
try
{
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (!string.IsNullOrEmpty(benutzerName)) command.CommandText = $"select {COLUMNS} from {TABLE} where benutzer_name = '{benutzerName}'";
if (benID != null) command.CommandText = $"select {COLUMNS} from {TABLE} where benutzer_id = {benID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) benutzer = new Benutzer(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
return benutzer;
}
catch (Exception ex)
{
Program.AddFehler(null, ex.Message, ex.StackTrace, null);
throw;
}
}
#region Properties

View File

@ -1,25 +1,54 @@
using Npgsql;
using Deckungsbeitrag;
using Npgsql;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DatenDB
{
static class DatenbankConnection
{
private static NpgsqlConnection connection = null;
private static readonly int MaxRetries = 3;
private static readonly int RetryDelayMs = 1000; // 1 Sekunde
public static NpgsqlConnection GetConnection()
{
if (connection?.State == System.Data.ConnectionState.Open) return connection;
connection?.Dispose();
connection = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
return connection;
var cs = ConfigurationManager.AppSettings["ConnectionString"];
int attempt = 0;
while (true)
{
try
{
connection = new NpgsqlConnection(cs);
return connection;
}
catch (NpgsqlException ex)
{
attempt++;
Console.WriteLine($"DB-Connection-Versuch {attempt}");
if (attempt >= MaxRetries)
{
MessageBox.Show(ex.Message + $"\n\nBitte starte das Programm neu.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
Program.AddFehler(null, ex.Message, ex.StackTrace, null);
throw; // nach X Versuchen aufgeben
}
Thread.Sleep(RetryDelayMs);
}
}
}
}

View File

@ -11,15 +11,21 @@ using System.Drawing.Printing;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Printing;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using ZXing;
using ZXing.QrCode.Internal;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using Control = System.Windows.Forms.Control;
namespace Deckungsbeitrag
{
public class Funktionen
@ -31,6 +37,7 @@ namespace Deckungsbeitrag
public static Auftrag _auftrag;
public static Kunde _adresse;
private static int currentPage = 0;
private static int pagesToPrint = 1;
private int totalPages = 0;
int i = 0;
int j = 0;
@ -39,7 +46,10 @@ namespace Deckungsbeitrag
private static Meldungen meldung = new Meldungen();
private static List<Auftrag> _auftragliste;
private static Benutzer _fahrer;
private static Benutzer _benutzer;
private static PrintDocument printdoc;
public static bool IsPhysicalPrint = false; // Globaler Schalter
public Funktionen()
{
@ -57,14 +67,15 @@ namespace Deckungsbeitrag
return headerFormat;
}
public static Font Get_Font_Size(Font font, string text, float height)
public static Font GetFontSizeByWidth(Font font, string text, float width)
{
Font f = font;
if (!string.IsNullOrEmpty(text))
{
while (height > TextRenderer.MeasureText(text, f).Height)
float textwidth = TextRenderer.MeasureText(text, f).Width;
while (width < TextRenderer.MeasureText(text, f).Width)
{
f = new Font(font.FontFamily, f.Size + 1);
f = new Font(font.FontFamily, f.Size - 1);
}
}
return f;
@ -500,7 +511,7 @@ namespace Deckungsbeitrag
string row = string.Empty;
Artikel[] artikel = new Artikel[0];
List<Artikel> artikelListe = new List<Artikel>();
int idx = 0;
int idx = 1;
// Datei auswählen.
OpenFileDialog dialog = new OpenFileDialog();
@ -516,12 +527,16 @@ namespace Deckungsbeitrag
streamReader = new StreamReader(dialog.FileName, Encoding.GetEncoding("iso-8859-1"));
while (!streamReader.EndOfStream)
{
Array.Resize<Artikel>(ref artikel, ++idx);
Array.Resize<Artikel>(ref artikel, idx);
row = streamReader.ReadLine();
artikel[idx - 1] = new Artikel(row, idx - 1);
artikelListe.Add(new Artikel(row, idx - 1));
if (row.StartsWith("60") || row.StartsWith("20"))
{
artikel[idx - 1] = new Artikel(row, idx - 1);
idx++;
}
}
streamReader.Close();
artikelListe.AddRange(artikel);
return artikelListe;
}
catch (Exception)
@ -550,7 +565,7 @@ namespace Deckungsbeitrag
if (videoDevices == null)
{
kunde = Open_List();
kunde = Open_List(null);
}
else
{
@ -567,10 +582,11 @@ namespace Deckungsbeitrag
/// Öffnen der Kundenauswahlliste zur händischen Eingabe bzw. Scan des Kunden.
/// </summary>
/// <returns>Kunde</returns>
public static Kunde Open_List()
public static Kunde Open_List(string kndService)
{
int typ = 0;
Kunde knd = new Kunde();
FormListe liste = new FormListe(null, 0);
FormListe liste = new FormListe(null, 0, kndService);
if (liste.ShowDialog() == DialogResult.OK)
{
knd = liste.kunde;
@ -614,7 +630,7 @@ namespace Deckungsbeitrag
knd = kamera.kunde;
break;
case DialogResult.No:
knd = Open_List();
knd = Open_List(null);
break;
default:
break;
@ -631,13 +647,64 @@ namespace Deckungsbeitrag
Image img = null;
BarcodeWriter code = new BarcodeWriter();
code.Format = BarcodeFormat.QR_CODE;
if (kunde.KundeNummer == "2320000") img = code.Write(kunde.KundeNummer + "," + kunde.Suchtext);
else img = code.Write(kunde.KundeNummer.ToString());
//img = code.Write(auftrag.AuftragID + "," + kunde.KundeNummer + "," + auftrag.Liefertag.ToShortDateString());
if (kunde.KundeNummer == "2320000") img = code.Write(auftrag.ZusatzInfo);
else img = code.Write(kunde.KundeNummer);
return img;
}
private static Bitmap ErstelleQRMitRahmen(Kunde kunde, Auftrag auftrag, int groesse = 200)
{
string obererText = "Abholung notwendig?";
string untererText = "Scan Me!";
string text = $"https://www.wirl.tirol/kontakt?name={kunde.KundeNummer}%20{kunde.KundeName}";
if (kunde.KundeNummer == "2320000") text = $"https://www.wirl.tirol/kontakt?name={kunde.KundeNummer}%20{auftrag.ZusatzInfo}";
else text = $"https://www.wirl.tirol/kontakt?name={kunde.KundeNummer}%20{kunde.KundeName}&address={kunde.Strasse},%20{kunde.PLZ.ToString()}%20{kunde.Ort}";
// QR ohne Margin generieren
var hints = new Dictionary<ZXing.EncodeHintType, object>
{
{ ZXing.EncodeHintType.MARGIN, 0 }
};
var writer = new BarcodeWriter
{
Format = BarcodeFormat.QR_CODE,
Options = new ZXing.Common.EncodingOptions { Width = groesse, Height = groesse, Margin = 0 }
};
Bitmap qr = writer.Write(text);
// Größeres Bitmap für Rahmen (z.B. +100px Rand)
int rand = 20;
int textHoehe = 20;
Bitmap erweitert = new Bitmap(qr.Width + 2 * rand, qr.Height + 2 * rand + 2 * textHoehe);
using (Graphics g = Graphics.FromImage(erweitert))
{
g.Clear(Color.White);
// Oberen Text (zentriert)
Font font = new Font("Arial", 14, FontStyle.Bold);
SizeF obTextSize = g.MeasureString(obererText, font);
g.DrawString(obererText, font, Brushes.Black,
(erweitert.Width - obTextSize.Width) / 2,
rand - 10);
// QR zentriert unter oberem Text
int qrY = rand + textHoehe;
g.DrawImage(qr, rand, qrY);
// Rahmen um QR (ohne Textbereiche)
using (Pen pen = new Pen(Color.White, 6))
g.DrawRectangle(pen, rand - 3, qrY - 3, qr.Width + 6, qr.Height + 6);
// Unteren Text (zentriert)
SizeF unTextSize = g.MeasureString(untererText, font);
g.DrawString(untererText, font, Brushes.Black,
(erweitert.Width - unTextSize.Width) / 2,
qrY + qr.Height);
}
return erweitert;
}
/// <summary>
/// DRUCKEN VON SCHMUTZWÄSCHESCHEINEN & ETIKETTEN & TOURENLISTEN
/// </summary>
@ -760,10 +827,10 @@ namespace Deckungsbeitrag
Kunde kunde = Kunde.GetKunde(string.Empty, auftrag.KundeID, string.Empty);
if (kunde.Suchtext.StartsWith("?") | kunde.KundeNummer == "2320000") kunde.Suchtext = auftrag.ZusatzInfo;
Image qr = Get_QR_Code(kunde, auftrag);
Image qr = ErstelleQRMitRahmen(kunde, auftrag);
Image qrweb = Image.FromFile(ConfigurationManager.AppSettings["QrPfad"]);
qrweb.RotateFlip(RotateFlipType.Rotate270FlipNone);
qr.RotateFlip(RotateFlipType.Rotate270FlipNone);
Bitmap bitmap = new Bitmap(1200, 300);
//bitmap.SetResolution(100, 100);
Graphics g = Graphics.FromImage(bitmap);
@ -780,7 +847,7 @@ namespace Deckungsbeitrag
g.FillRectangle(Brushes.White, 0, 0, bitmap.Width, bitmap.Height);
//QR-Code
g.DrawImage(qrweb, 10, 15, 350, 280);
g.DrawImage(qr, 10, 15, 350, 280);
//Etikett-Text
g.DrawString($"{kunde.Suchtext}", font1, Brushes.Black, startpoint);
@ -811,6 +878,7 @@ namespace Deckungsbeitrag
{
printDocument.PrinterSettings = dialog.PrinterSettings;
printDocument.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
printDocument.DefaultPageSettings.PaperSize = new PaperSize("Etikett-Custom", 29, 90);
preview.StartPosition = FormStartPosition.CenterScreen;
preview.WindowState = FormWindowState.Normal;
preview.Document = printDocument;
@ -828,32 +896,40 @@ namespace Deckungsbeitrag
public static Image TourenListe_Entwurf(List<Auftrag> auftragliste, Benutzer fahrer, int bottom)
{
DateTime liefertag = auftragliste[0].Liefertag;
int ezl = 50; int handzeile = 33; float textsize = 15; float textsize2 = 30; int idx = 0; int idx1 = 0; int length = 0; float textsize3 = 10;
int ezl = 50; int lastline = 0; int length = 0;
float fontsize = 15; float fontsize2 = 30; float fontsize3 = 10;
int bitmapHeight = CalculateBitmapHeight(auftragliste);
Bitmap bitmap = new Bitmap(790, bitmapHeight);
Graphics g = Graphics.FromImage(bitmap);
Point adressblock = new Point(ezl, 50);
Point tabelle = new Point(ezl, 330);
SizeF textSize2 = g.MeasureString("Salzburg, am 26.08.1984", new Font("Arial", textsize, FontStyle.Regular));
SizeF textSize3 = g.MeasureString("MO", new Font("Arial", textsize2, FontStyle.Regular));
SizeF textSize4 = g.MeasureString("MO", new Font("Arial", textsize3, FontStyle.Regular));
SizeF textSizePos = g.MeasureString("Container Gesamt: ", new Font("Arial", textsize, FontStyle.Regular));
SizeF textSizePos2 = g.MeasureString("Container: ", new Font("Arial", textsize, FontStyle.Regular));
int zeile = (int)textSize2.Height + 20; //PIXEL
int posTag = 145;
string sortNr = string.Empty;
SizeF textSize2 = g.MeasureString("Salzburg, am 26.08.1984", new Font("Arial", fontsize, FontStyle.Regular));
SizeF textSize3 = g.MeasureString("MO", new Font("Arial", fontsize2, FontStyle.Regular));
SizeF textSizePos = g.MeasureString("Container Gesamt: ", new Font("Arial", fontsize, FontStyle.Regular));
SizeF textSizePos2 = g.MeasureString("Container: ", new Font("Arial", fontsize, FontStyle.Regular));
SizeF datumSize = g.MeasureString("00.00.0000 - 00:00", new Font("Arial", 10, FontStyle.Regular));
g.FillRectangle(Brushes.White, 0, 0, bitmap.Width, bitmap.Height);
//Adressblock
g.DrawString($"{fahrer.Vorname} {fahrer.Nachname}", new Font("Arial", textsize2, FontStyle.Regular), Brushes.Black, adressblock);
g.DrawString($"{GetWochentagDeutsch(liefertag.DayOfWeek)} {liefertag.ToShortDateString()}", new Font("Arial", textsize2, FontStyle.Regular), Brushes.Black, adressblock.X, adressblock.Y + (int)textSize3.Height);
//FAHRER UND LIEFERTAG ZEILE 1 & 2
g.DrawString($"{DateTime.Now.ToString("dd.MM.yyyy - HH:mm")}", new Font("Arial", 10, FontStyle.Regular), Brushes.Black, bitmap.Width - 50 - datumSize.Width, adressblock.Y);
g.DrawString($"{fahrer.Vorname} {fahrer.Nachname}", new Font("Arial", fontsize2, FontStyle.Regular), Brushes.Black, adressblock);
g.DrawString($"{GetWochentagDeutsch(liefertag.DayOfWeek)} {liefertag.ToShortDateString()}", new Font("Arial", fontsize2, FontStyle.Regular), Brushes.Black, adressblock.X, lastline = adressblock.Y + (int)textSize3.Height);
//TOUR START UND ENDE ZEILE 3
g.DrawString($"Tour Start um:", new Font("Arial", fontsize, FontStyle.Regular), Brushes.Black, tabelle.X, lastline = lastline + (int)textSize3.Height + 40);
g.DrawString($"Tour Ende um:", new Font("Arial", fontsize, FontStyle.Regular), Brushes.Black, (bitmap.Width / 2), lastline);
//TOURKOPF ENDLINIE ALLE ÄNDERUNGEN AM TOURKOPF ^^ DARÜBER EINFÜGEN
g.DrawLine(new Pen(Brushes.Black), new Point(tabelle.X, tabelle.Y + 20), new Point(bitmap.Width - 50, lastline = tabelle.Y + 20));
int lastline = 0;
int idx1 = 0;
int gesCont = 0;
int kndanzahl = 0;
int kndnichtfertig = 0;
foreach (Auftrag auftrag in auftragliste)
{
Kunde knd = Kunde.GetKunde(string.Empty, auftrag.KundeID, string.Empty);
@ -866,79 +942,178 @@ namespace Deckungsbeitrag
if (knd.KundeNummer == "2320000") kndName = auftrag.ZusatzInfo;
else kndName = string.IsNullOrWhiteSpace(knd.Suchtext) ? knd.KundeName : knd.Suchtext;
SizeF kundenname = g.MeasureString(kndName, new Font("Arial", textsize, FontStyle.Regular));
SizeF ortwidth = g.MeasureString(knd.Ort, new Font("Arial", textsize, FontStyle.Regular));
SizeF adressewidth = g.MeasureString($"{knd.PLZ.ToString()} {knd.Ort}, {knd.Strasse}", new Font("Arial", textsize3, FontStyle.Regular));
SizeF kundenname = g.MeasureString(kndName, new Font("Arial", fontsize, FontStyle.Regular));
SizeF ortwidth = g.MeasureString(knd.Ort, new Font("Arial", fontsize, FontStyle.Regular));
SizeF adressewidth = g.MeasureString($"{knd.PLZ.ToString()} {knd.Ort}, {knd.Strasse}", new Font("Arial", fontsize3, FontStyle.Regular));
FontStyle style;
if (auftrag.Status < AuftragStatus.Vorbereitet) { style = FontStyle.Bold; kndnichtfertig++; }
else style = FontStyle.Regular;
++idx1;
if (kndanzahl >= 15)
{
if (kndanzahl >= 35)
if (kndanzahl >= 34)
{
if (kndanzahl >= 55) length = (int)textSize3.Height * idx1 + 420;
if (kndanzahl >= 54) length = (int)textSize3.Height * idx1 + 420;
else length = (int)textSize3.Height * idx1 + 280;
}
else length = (int)textSize3.Height * idx1 + 140;
}
else length = (int)textSize3.Height * idx1;
//ZEILE 1
g.DrawString($"{kndName}", new Font("Arial", textsize, FontStyle.Regular), Brushes.Black, tabelle.X, tabelle.Y + length - 20);
g.DrawString($"Container: {auftrag.ContainerClean}", new Font("Arial", textsize, FontStyle.Regular), Brushes.Black, tabelle.X + 450 - textSizePos2.Width, tabelle.Y + length - 20);
//ZEILE 2
g.DrawString($"{knd.PLZ.ToString()} {knd.Ort}, {knd.Strasse}", new Font("Arial", textsize3, FontStyle.Regular), Brushes.Black, tabelle.X, tabelle.Y + textSize2.Height + length - 20);
g.DrawString($"{auftrag.Status.ToString()}", new Font("Arial", fontsize, style), Brushes.Black, tabelle.X, lastline + 5);
g.DrawString($"{knd.KundeNummer} {kndName}", new Font("Arial", fontsize, style), Brushes.Black, tabelle.X + 130, lastline = lastline + 5);
//CHECKBOX ÜBER 2 ZEILEN
g.DrawRectangle(new Pen(Brushes.Black), ezl + 550, tabelle.Y + length - 18, textsize + textsize3 + 10, textsize3 + textsize + 10);
g.DrawRectangle(new Pen(Brushes.Black), ezl + 650, lastline, fontsize + fontsize3 + 10, fontsize3 + fontsize + 10);
if (auftrag.Typ != AuftragTyp.Regelmäßig) g.DrawString($"Container: {auftrag.ContainerClean}", new Font("Arial", fontsize, style), Brushes.Black, tabelle.X + 550 - textSizePos2.Width, lastline);
else
{
int i = 0;
string[] art;
List<AuftragArtikel> liste = AuftragArtikel.GetList(auftrag.AuftragID);
art = new string[liste.Count];
foreach (AuftragArtikel artikel in liste)
{
g.DrawString($"{artikel.Anzahl.ToString()} Stk. {artikel.ArtikelName}", new Font("Arial", fontsize3, style), Brushes.Black, tabelle.X + 550 - textSizePos2.Width, lastline + ((int)datumSize.Height * i));
i++;
}
}
//ZEILE 2
g.DrawString($"{knd.PLZ.ToString()} {knd.Ort}, {knd.Strasse}", new Font("Arial", fontsize3, style), Brushes.Black, tabelle.X, lastline = lastline + (int)textSize2.Height);
//LINIE UNTER ZEILE
g.DrawLine(new Pen(Brushes.Black), new Point(tabelle.X, lastline = tabelle.Y + (int)textSize2.Height + length), new Point(bitmap.Width - 50, tabelle.Y + (int)textSize2.Height + length));
g.DrawLine(new Pen(Brushes.Black), new Point(tabelle.X, lastline = lastline + (int)datumSize.Height + 2), new Point(bitmap.Width - 50, lastline));
kndanzahl++;
}
g.DrawString($"Anzahl Kunden: {kndanzahl.ToString()}", new Font("Arial", textsize, FontStyle.Regular), Brushes.Black, tabelle.X, lastline + 10);
g.DrawString($"Container Gesamt: {gesCont.ToString()}", new Font("Arial", textsize, FontStyle.Regular), Brushes.Black, tabelle.X + 450 - textSizePos.Width, lastline = lastline + 10);
//ANZAHL KUNDEN UND CONTAINER
g.DrawString($"Kunden Gesamt: {kndanzahl.ToString()}", new Font("Arial", fontsize, FontStyle.Bold), Brushes.Black, tabelle.X, lastline + 10);
g.DrawString($"Container Gesamt: {gesCont.ToString()}", new Font("Arial", fontsize , FontStyle.Bold), Brushes.Black, tabelle.X + 550 - textSizePos.Width, lastline = lastline + 10);
if (kndnichtfertig > 0) g.DrawString($"Kunden nicht fertig: {kndnichtfertig.ToString()}", new Font("Arial", fontsize, FontStyle.Bold), Brushes.Black, tabelle.X, lastline = lastline + (int)textSize2.Height + 5);
Image img = bitmap;
return img;
//TODO: Reg.Aufträge einbauen. Besonderheit: Die Artikel sollen ebenfalls erscheinen.
//TODO: Zuweisung zu Fahrer muss geklärt werden.
}
public static void TourenListe_Drucken(List<Auftrag> auftragliste, Benutzer benutzer, object sender)
public static void TourenListe_Drucken(List<Auftrag> auftragliste, Benutzer fahrer, object sender, Benutzer benutzer)
{
if (auftragliste != null) _auftragliste = auftragliste;
if (benutzer != null) _fahrer = benutzer;
if (fahrer != null) _fahrer = fahrer;
if (benutzer != null) _benutzer = benutzer;
currentPage = 0; // WICHTIG: reset vor jedem Druck
string tmpPdf = @"C:\tmp\output2.pdf";
PrintDialog dialog = new PrintDialog();
foreach (string printer in PrinterSettings.InstalledPrinters) if (printer.Contains(Properties.Settings.Default.SWS_Drucker)) dialog.PrinterSettings.PrinterName = printer;
dialog.PrinterSettings.Copies = 1;
PrintPreviewDialog preview = new PrintPreviewDialog();
if (dialog.ShowDialog() == DialogResult.OK)
try
{
PrintDocument printDocument = new PrintDocument();
printDocument.OriginAtMargins = true;
foreach (string printer in PrinterSettings.InstalledPrinters) if (printer.Contains(Properties.Settings.Default.SWS_Drucker)) dialog.PrinterSettings.PrinterName = printer;
dialog.PrinterSettings.Copies = 1;
printDocument.PrinterSettings = dialog.PrinterSettings;
printDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 50);
printDocument.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
if (!sender.ToString().Contains("KundeDaten"))
if (dialog.ShowDialog() == DialogResult.OK)
{
PrintPreviewDialog preview = new PrintPreviewDialog();
preview.StartPosition = FormStartPosition.CenterScreen;
preview.WindowState = FormWindowState.Maximized;
preview.Document = printDocument;
preview.Document.DocumentName = "TourenListe";
preview.ShowDialog();
}
else { dialog.Document = printDocument; dialog.Document.DocumentName = "TourenListe"; printDocument.Print(); }
}
PrintDocument printDocument = new PrintDocument();
printdoc = new PrintDocument();
printDocument.OriginAtMargins = true;
printDocument.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
printDocument.PrinterSettings = dialog.PrinterSettings;
printDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 50);
//printDocument.BeginPrint += PrintDocument_BeginPrint;
//printDocument.EndPrint += PrintDocument_EndPrint;
if (!sender.ToString().Contains("KundeDaten"))
{
preview.StartPosition = FormStartPosition.CenterScreen;
preview.WindowState = FormWindowState.Maximized;
preview.Document = printdoc = printDocument;
preview.Document.DocumentName = "TourenListe";
// WAITCURSOR + DISABLE Events
printDocument.BeginPrint += (s, args) =>
{
preview.Enabled = false; // Form sperren
preview.UseWaitCursor = true; // Form + Controls
Application.UseWaitCursor = true; // App-weit
Application.DoEvents(); // Cursor sofort updaten
};
printDocument.EndPrint += (s, args) =>
{
IsPhysicalPrint = printDocument.PrintController.IsPreview ? false : true;
preview.Enabled = true; // Form wieder aktiv
preview.UseWaitCursor = false;
Application.UseWaitCursor = false;
System.Windows.Forms.Cursor.Current = Cursors.Default; // Sicherheitsnetz
};
preview.ShowDialog();
}
else { dialog.Document = printDocument; dialog.Document.DocumentName = "TourenListe"; printDocument.Print(); }
}
}
catch (Exception ex)
{
meldung.GetFehler(ex, $"PDF konnte nicht erstellt oder gespeicehrt werden.\nRufe einen Vorgesetzten.\n\nFehler: {ex.Message}");
throw;
}
finally
{
if (IsPhysicalPrint)
{
GeneratePdfFromPrintDocument(tmpPdf);
if (WaitForFileReady(tmpPdf))
{
Tour tour = null;
if (_auftragliste[0].TourID != null) tour = Tour.GetTour(_auftragliste[0].TourID);
else tour = Tour.FindeTour(_auftragliste[0].TourID, _fahrer.BenutzerID, _auftragliste[0].Liefertag);
if (tour == null)
{
UpdateOrSaveTour(_auftragliste[0].TourID, _auftragliste[0]);
tour = Tour.FindeTour(_auftragliste[0].TourID, _fahrer.BenutzerID, _auftragliste[0].Liefertag);
}
int kndanzahl = 0;
int contanzahl = 0;
int dirtanzahl = 0;
foreach (Auftrag _auftrag in _auftragliste)
{
contanzahl += _auftrag.ContainerClean;
dirtanzahl += _auftrag.Container;
_auftrag.TourID = tour.TourID;
_auftrag.Save();
kndanzahl++;
}
tour.ContainerClean = contanzahl;
tour.ContainerDirt = dirtanzahl;
tour.Tourenliste = File.ReadAllBytes(tmpPdf);
tour.Kundenanzahl = kndanzahl;
tour.ListeGedruckt = DateTime.Now;
tour.GedrucktVon = _benutzer.BenutzerID;
if (tour.Save() == 0) meldung.GetFehler(null, "PDF konnte nicht gespeichert werden. Bitte melde dich bei einem Vorgesetzten.");
}
File.Delete(tmpPdf);
}
}
}
private static void PrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
if (sender.ToString().Contains("SWS-Schein"))
{
Image img = Funktionen.SWS_Entwurf(_auftrag, _adresse);
Image img = SWS_Entwurf(_auftrag, _adresse);
// Verfügbare Druckfläche innerhalb der Seitenränder
Rectangle printArea = e.MarginBounds;
@ -964,10 +1139,13 @@ namespace Deckungsbeitrag
if (sender.ToString().Contains("Etikett")) e.Graphics.DrawImage(Funktionen.Etikett_Entwurf(null, _auftrag, _nocont), e.PageBounds);
if (sender.ToString().Contains("TourenListe"))
{
if (pagesToPrint == currentPage) currentPage = 0;
int bottom = e.MarginBounds.Bottom - e.MarginBounds.Size.Height;
Image img = TourenListe_Entwurf(_auftragliste, _fahrer, bottom);
if (img == null) return;
pagesToPrint = img.Height / 1119;
Rectangle printArea = e.MarginBounds;
// Feste Höhe pro Seite (Pixel der Bitmap)
@ -999,7 +1177,7 @@ namespace Deckungsbeitrag
private static int CalculateBitmapHeight(List<Auftrag> auftragliste)
{
int firstPageItems = 15; // Erste Seite: 15 Aufträge
int otherPagesItems = 20; // Weitere Seiten: 20 Aufträge
int otherPagesItems = 19; // Weitere Seiten: 20 Aufträge
if (auftragliste.Count <= firstPageItems)
return 1119; // Nur 1 Seite
@ -1009,7 +1187,42 @@ namespace Deckungsbeitrag
return 1119 * (1 + additionalPages); // 1. Seite + weitere Seiten
}
private static void GeneratePdfFromPrintDocument(string pdfPath)
{
printdoc.PrinterSettings.PrinterName = "Microsoft Print to PDF";
printdoc.PrinterSettings.PrintToFile = true;
printdoc.PrinterSettings.PrintFileName = pdfPath;
//printDoc.PrintController = new StandardPrintController(); // Unterdrückt Vorschau-Dialog
printdoc.Print();
printdoc.Dispose();
}
private static bool WaitForFileReady(string filePath, int maxWaitMs = 5000)
{
int timeout = 0;
while (timeout < maxWaitMs)
{
if (File.Exists(filePath))
{
try
{
// Prüfe ob Datei lesbar (nicht gelockt)
using (var fs = File.OpenRead(filePath))
{
fs.ReadByte(); // Test-Lesezugriff
return true;
}
}
catch
{
// Noch gelockt → weiter warten
}
}
Thread.Sleep(100);
timeout += 100;
}
return false;
}
/// <summary>
/// HIDE AND SHOW CONTROLS WÄHREND LADEVORGANG
/// </summary>
@ -1231,7 +1444,7 @@ namespace Deckungsbeitrag
string text = gb.Text;
Font font = gb.Font;
Size textSize = TextRenderer.MeasureText(text, font);
Pen pen = new Pen(Color.FromArgb(1, 53, 101), 3);
Pen pen = new Pen(Program.Wirlblau, 3);
int textWidth = textSize.Width;
int textHeight = textSize.Height;
@ -1347,20 +1560,24 @@ namespace Deckungsbeitrag
chart1.ChartAreas[0].Position = new ElementPosition(0, 8, 100, 92);
// Gesamtmenge als einzelne Säule (links oder transparent)
var serieGesamt = new Series("Gesamtmenge") { ChartType = SeriesChartType.Bar };
serieGesamt.CustomProperties = "DrawSideBySide=False, PointWidth=0.8";
//chart1.Series.Add(serieGesamt);
//TODO: Gesamt soll immer 100% sein.
var serieGesamt = new Series("Gesamtmenge")
{
ChartType = SeriesChartType.StackedBar100,
Color = Color.Transparent,
CustomProperties = "DrawSideBySide=False, PointWidth=0.8"
};
// Gestapelte Fehler-Serie (rechts darüber)
var serieFehler = new Series("Fehlmenge")
{
ChartType = SeriesChartType.StackedBar,
ChartType = SeriesChartType.StackedBar100,
Color = Color.Orange
};
var serieReklamation = new Series("Reklamation")
{
ChartType = SeriesChartType.StackedBar,
Color = Color.Red
ChartType = SeriesChartType.StackedBar100,
Color = Color.OrangeRed
};
for (int i = 0; i < artikelDaten.Count; i++)
@ -1368,9 +1585,33 @@ namespace Deckungsbeitrag
var daten = artikelDaten[i];
double index = i; // Gleicher X-Wert für alle Serien
serieGesamt.Points.AddXY(index, daten.Stand);
serieFehler.Points.AddXY(index, daten.Fehlmenge);
serieReklamation.Points.AddXY(index, daten.Reklamation);
if (daten.Stand > 0)
{
serieGesamt.Points.AddXY(index, daten.Stand);
serieGesamt.Label = " ";
serieFehler.Points.AddXY(index, ((double)daten.Fehlmenge / (double)daten.Stand) * 100);
if (daten.Fehlmenge > 0) serieFehler.Points[i].Label = daten.Fehlmenge.ToString();
else serieFehler.Points[i].Label = " ";
serieReklamation.Points.AddXY(index, ((double)daten.Reklamation / (double)daten.Stand) * 100);
if (daten.Reklamation > 0) serieReklamation.Points[i].Label = daten.Reklamation.ToString();
else serieReklamation.Points[i].Label = " ";
}
else
{
serieGesamt.Points.AddXY(index, daten.Stand);
serieGesamt.Label = " ";
serieFehler.Points.AddXY(index, daten.Fehlmenge);
if (daten.Fehlmenge > 0) serieFehler.Points[i].Label = daten.Fehlmenge.ToString();
else serieFehler.Points[i].Label = " ";
serieReklamation.Points.AddXY(index, daten.Reklamation);
if (daten.Reklamation > 0) serieReklamation.Points[i].Label = daten.Reklamation.ToString();
else serieReklamation.Points[i].Label = " ";
}
// Label setzen (X-Achse zeigt Artikelnamen)
string label = daten.ArtikelName;
@ -1380,9 +1621,20 @@ namespace Deckungsbeitrag
serieGesamt.Points[i].AxisLabel = label;
}
chart1.Series.Add(serieGesamt);
chart1.Series.Add(serieFehler);
chart1.Series.Add(serieReklamation);
chart1.Series.Add(serieGesamt);
foreach(Series serie in chart1.Series)
{
if (serie.Name != "Gesamtmenge")
{
serie.IsValueShownAsLabel = true;
serie.LabelForeColor = Color.Black;
serie.LabelFormat = "{0:N0}"; // 123 Stück
}
}
// Legende wird ausgeblendet
chart1.Legends.Clear();
@ -1427,5 +1679,34 @@ namespace Deckungsbeitrag
}
}
public static void UpdateOrSaveTour(int? tourid, Auftrag auftrag)
{
int? arbeiterID = null;
DateTime? liefertag = null;
int? tourID = tourid;
Tour tour = null;
if (auftrag != null)
{
arbeiterID = auftrag.ArbeiterID;
liefertag = auftrag.Liefertag;
tourID = auftrag.TourID;
}
if (tourID != null) tour = Tour.GetTour(tourID);
if (tour == null)
{
tour = new Tour();
tour.TourID = null;
tour.BenutzerID = auftrag.ArbeiterID;
tour.Liefertag = auftrag.Liefertag;
tour.SaisonID = Saison.GetAktivSaison().SaisonId;
}
tour.Kundenanzahl++;
tour.ContainerDirt += auftrag.Container;
tour.ContainerClean += auftrag.ContainerClean;
if (tour.Save() == 0) meldung.GetFehler(null, "Speichern oder Updaten der Tour war nicht möglich.\nBitte informiere deinen Vorgesetzten.");
}
}
}

View File

@ -3,6 +3,7 @@ using Deckungsbeitrag.AA_Klassen;
using Npgsql;
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
@ -25,26 +26,38 @@ namespace DatenDB
public Kunde()
{
} // LEER
public static List<Kunde> GetTmpList(string text)
public static List<Kunde> GetTmpList(string text, string kndService)
{
//bool endsWithSpecial = false;
//if(!string.IsNullOrWhiteSpace(text)) endsWithSpecial = !char.IsLetterOrDigit(text[text.Length-1]);
DatenbankConnection.GetConnection().Open();
List<Kunde> resultList = new List<Kunde>();
using (NpgsqlCommand command = new NpgsqlCommand())
{
command.Connection = DatenbankConnection.GetConnection();
if (string.IsNullOrEmpty(text)) command.CommandText = $"select {COLUMNS} from {TABLE} where aktiv = {true}";
else
if (kndService != null)
{
string cleanedText = new string(text.Where(char.IsLetterOrDigit).ToArray());
if (string.IsNullOrEmpty(text)) command.CommandText = $"select {COLUMNS} from {TABLE} where aktiv = {true} and service <> '{kndService}'";
else
{
string cleanedText = new string(text.Where(c => char.IsLetterOrDigit(c) || c == ' ').ToArray());
if (int.TryParse(cleanedText, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{cleanedText}' and service <> '{kndService}'";
else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{cleanedText}' or name1 ~* '{cleanedText}' and service <> '{kndService}'";
}
if (int.TryParse(cleanedText, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{cleanedText}'";
else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{cleanedText}' or name1 ~* '{cleanedText}'";
//TODO: Testen ob SWS-QRCodes gelesen werden können. Nur notwendig bis alle SWS-QRCodes richtig gedruckt und gelesen werden.
}
else
{
if (string.IsNullOrEmpty(text)) command.CommandText = $"select {COLUMNS} from {TABLE} where aktiv = {true}";
else
{
string cleanedText = new string(text.Where(c => char.IsLetterOrDigit(c) || c == ' ').ToArray());
if (int.TryParse(cleanedText, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{cleanedText}'";
else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{cleanedText}' or name1 ~* '{cleanedText}'";
}
}
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new Kunde(reader));
@ -418,4 +431,13 @@ namespace DatenDB
public int WinterLieferRhythmus { get; set; }
#endregion
}
public class KData
{
public string Name { get; set; }
public string Region { get; set; }
public string Tag { get; set; } // ← MO, DI, MI, DO, FR
public int KundeID { get; set; }
public int[] ContAnzahl { get; set; } = new int[3];
}
}

View File

@ -11,8 +11,8 @@ namespace DatenDB
{
public class KundeArtikel
{
// 0 1 2 3 4 5 6 7 8 9
private static string COLUMNS = "kunde_artikel_id, kunde_id, artikel_nr, artikel_name, stand, fehlmenge, stand_bearbeitet, fehlmenge_bearbeitet, korrektur, korrektur_bearbeitet, reklamation";
// 0 1 2 3 4 5 6 7 8 9 10 11 12
private static string COLUMNS = "kunde_artikel_id, kunde_id, artikel_nr, artikel_name, stand, fehlmenge, stand_bearbeitet, fehlmenge_bearbeitet, korrektur, korrektur_bearbeitet, reklamation, artikel_id, reihung";
private static string TABLE = "kundenverwaltung.kunde_artikel";
public KundeArtikel() { }
@ -23,7 +23,7 @@ namespace DatenDB
List<KundeArtikel> resultList = new List<KundeArtikel>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kundeid} order by kunde_artikel_id asc";
command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kundeid} order by reihung asc";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new KundeArtikel(reader));
reader.Close();
@ -69,13 +69,13 @@ namespace DatenDB
command.Connection = DatenbankConnection.GetConnection();
if (this.KundeArtikelID.HasValue & this.KundeArtikelID != 0)
{
command.CommandText = $"update {TABLE} set kunde_id = :p1, artikel_nr = :p2, artikel_name = :p3, stand = :p4, fehlmenge = :p5, stand_bearbeitet = :p6, fehlmenge_bearbeitet = :p7, korrektur = :p8, korrektur_bearbeitet = :p9, reklamation = :p10 WHERE kunde_artikel_id = :p0";
command.CommandText = $"update {TABLE} set kunde_id = :p1, artikel_nr = :p2, artikel_name = :p3, stand = :p4, fehlmenge = :p5, stand_bearbeitet = :p6, fehlmenge_bearbeitet = :p7, korrektur = :p8, korrektur_bearbeitet = :p9, reklamation = :p10, artikel_id = :p11, reihung = :p12 WHERE kunde_artikel_id = :p0";
}
else
{
command.CommandText = "select nextval('kundenverwaltung.kunde_artikel_seq')";
this.KundeArtikelID = (int)(long)command.ExecuteScalar();
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10)";
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, :p12)";
}
command.Parameters.AddWithValue("p0", this.KundeArtikelID.Value);
@ -89,6 +89,8 @@ namespace DatenDB
command.Parameters.AddWithValue("p8", this.Korrektur);
command.Parameters.AddWithValue("p9", string.IsNullOrWhiteSpace(this.KorrekturBearbeitet) ? (object)DBNull.Value : this.KorrekturBearbeitet);
command.Parameters.AddWithValue("p10", this.Reklamation);
command.Parameters.AddWithValue("p11", this.ArtikelID.HasValue ?this.ArtikelID.Value : (object)DBNull.Value);
command.Parameters.AddWithValue("p12", this.Reihung);
int result = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close();
@ -136,7 +138,7 @@ namespace DatenDB
using (var conn = new NpgsqlConnection(connectionString))
{
conn.Open();
using (var cmd = new NpgsqlCommand($"SELECT artikel_name, stand, fehlmenge, kunde_id, reklamation FROM {TABLE} WHERE kunde_id = {kunde.KundeID}", conn))
using (var cmd = new NpgsqlCommand($"SELECT artikel_name, stand, fehlmenge, kunde_id, reklamation, artikel_id, reihung FROM {TABLE} WHERE kunde_id = {kunde.KundeID}", conn))
{
using (var reader = cmd.ExecuteReader())
{
@ -148,7 +150,9 @@ namespace DatenDB
Stand = reader.GetInt32(1),
Fehlmenge = reader.GetInt32(2),
KundeID = reader.GetInt32(3),
Reklamation = reader.IsDBNull(4) ? 0 : reader.GetInt32(4)
Reklamation = reader.IsDBNull(4) ? 0 : reader.GetInt32(4),
ArtikelID = reader.IsDBNull(5) ? (int?)null : reader.GetInt32(5),
Reihung = reader.IsDBNull(6) ? 0 : reader.GetInt32(6)
});
}
}
@ -172,6 +176,8 @@ namespace DatenDB
this.Korrektur = reader.IsDBNull(8) ? 0 : reader.GetInt32(8);
this.KorrekturBearbeitet = reader.IsDBNull(9) ? string.Empty : reader.GetString(9);
this.Reklamation = reader.IsDBNull(10) ? 0 : reader.GetInt32(10);
this.ArtikelID = reader.IsDBNull(11) ? (int?)null : reader.GetInt32(11);
this.Reihung = reader.IsDBNull(12) ? 0 : reader.GetInt32(12);
}
public int? KundeArtikelID { get; set; }
@ -185,7 +191,8 @@ namespace DatenDB
public int Korrektur { get; set; }
public string KorrekturBearbeitet { get; set; }
public int Reklamation { get; set; }
public int? ArtikelID { get; set; }
public int Reihung { get; set; }
}
}
//INSTALL-REMINDER: Spalte Reklamation in Wirl_DB_17012023 einfügen

View File

@ -7,6 +7,15 @@ using System.Threading.Tasks;
namespace Deckungsbeitrag.AA_Klassen
{
public enum RegRhythmen
{
Unbekannt = 0,
Wöchentlich = 7,
ZweiWöchentlich = 14,
Monatlich = 28,
Halbjährlich = 182
}
[Flags]
public enum Liefertage
{
@ -18,9 +27,14 @@ namespace Deckungsbeitrag.AA_Klassen
Friday = 1 << 5 // 32
}
// Vordefinierte Rhythmen als Kombinationen
public static class Lieferrhythmen
{
public static RegRhythmen Rhythmus { get; set; }
public static Liefertage Unbekannt => Liefertage.None;
public static Liefertage WoechentlichMo => Liefertage.Monday;
public static Liefertage WoechentlichDi => Liefertage.Tuesday;
@ -34,7 +48,6 @@ namespace Deckungsbeitrag.AA_Klassen
public static Liefertage TaeglichMoFr => Liefertage.Monday | Liefertage.Tuesday | Liefertage.Wednesday | Liefertage.Thursday | Liefertage.Friday;
// Dictionary als statische Eigenschaft
public static readonly Dictionary<string, Liefertage> AnzeigeNamen = new Dictionary<string, Liefertage>()
{
@ -48,10 +61,11 @@ namespace Deckungsbeitrag.AA_Klassen
{ "2x Di/Fr", ZweimalDiFr },
{ "3x Mo/Mi/Fr", DreimalMoMiFr },
{ "4x Mo/Di/Do/Fr", ViermalMoDiDoFr },
{ "Täglich Mo-Fr", TaeglichMoFr }
{ "Täglich Mo-Fr", TaeglichMoFr },
};
private static readonly Dictionary<Liefertage, string> RhythmusAnzeige = AnzeigeNamen
.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
public static int GetMaxClonesNet48(this Liefertage liefertage)
{

View File

@ -1,4 +1,5 @@
using System;
using Deckungsbeitrag;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -66,7 +67,7 @@ namespace DatenDB
{
DialogResult result = DialogResult.Cancel;
string s = $"Wurde der Auftrag erfolgreich ausgeliefert?";
string s = $"Wurden die Aufträge erfolgreich ausgeliefert?";
string caption = "FRAGE";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
MessageBoxIcon icon = MessageBoxIcon.Question;
@ -350,6 +351,7 @@ namespace DatenDB
buttons = MessageBoxButtons.OK;
if (s == null) s = $"Da ist ein Fehler aufgetreten. Frag Kilian welcher Fehler hier ({sender.ToString()}) passiert ist.";
//AutomatischAddFehlerToObsidian(sender);
MessageBox.Show(s, caption, buttons, icon);
}
internal DialogResult GetAchtung(object sender, string s, bool cancel)
@ -369,7 +371,14 @@ namespace DatenDB
}
#endregion
private void AutomatischAddFehlerToObsidian(object sender)
{
string timestamp = DateTime.Now.ToString("dd.MM.yyyy-HH-mm");
string fehlerText = string.Empty;
Program.AddFehler(null, fehlerText, null, timestamp);
}
}
}

162
AA-Klassen/Tour.cs Normal file
View File

@ -0,0 +1,162 @@
using DatenDB;
using Npgsql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZXing;
namespace Deckungsbeitrag.AA_Klassen
{
public class Tour
{
// 0 1 2 3 4 5 6 7 8 9 10 11
public const string COLUMNS = "tour_id, benutzer_id, kundenanzahl, liefertag, start, ende, container_dirt, container_clean, saison_id, tourenliste, listegedruckt, gedruckt_von";
public const string TABLE = "kundenverwaltung.tour";
#region Class-Standarts (Properties, Save, reader)
public Tour() { }
public int? TourID { get; set; }
public int? BenutzerID { get; set; }
public int? SaisonID { get; set; }
public int? Kundenanzahl { get; set; }
public DateTime Liefertag { get; set; }
public DateTime? Start { get; set; }
public DateTime? Ende { get; set; }
public int ContainerDirt { get; set; }
public int ContainerClean { get; set; }
public byte[] Tourenliste { get; set; }
public DateTime? ListeGedruckt { get; set; }
public int? GedrucktVon { get; set; }
public int? Save()
{
int? result = 0;
DatenbankConnection.GetConnection().Open();
using (NpgsqlCommand command = new NpgsqlCommand())
{
command.Connection = DatenbankConnection.GetConnection();
if (this.TourID.HasValue & this.TourID != 0)
{
result = this.TourID;
command.CommandText = $"update {TABLE} set benutzer_id = :p1, kundenanzahl = :p2, liefertag = :p3, start = :p4, ende = :p5, container_dirt = :p6, container_clean = :p7, saison_id = :p8, tourenliste = :p9, listegedruckt = :p10, gedruckt_von = :p11 WHERE tour_id = :p0";
}
else
{
command.CommandText = "select nextval('kundenverwaltung.tour_seq')";
this.TourID = (int)(long)command.ExecuteScalar();
command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11)";
}
command.Parameters.AddWithValue("p0", this.TourID);
command.Parameters.AddWithValue("p1", this.BenutzerID);
command.Parameters.AddWithValue("p2", this.Kundenanzahl ?? 0);
command.Parameters.AddWithValue("p3", this.Liefertag);
command.Parameters.AddWithValue("p4", this.Start ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p5", this.Ende ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p6", this.ContainerDirt);
command.Parameters.AddWithValue("p7", this.ContainerClean);
command.Parameters.AddWithValue("p8", this.SaisonID ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p9", this.Tourenliste ?? (object)DBNull.Value);
command.Parameters.AddWithValue("p10", this.ListeGedruckt.HasValue ? (DateTime?)this.ListeGedruckt.Value : (DateTime?)DateTime.Now);
command.Parameters.AddWithValue("p11", this.GedrucktVon ?? (object)DBNull.Value);
result = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close();
return result;
}
}
public Tour(NpgsqlDataReader reader)
{
this.TourID = reader.GetInt32(0);
this.BenutzerID = reader.GetInt32(1);
this.Kundenanzahl = reader.GetInt32(2);
this.Liefertag = reader.GetDateTime(3);
this.Start = reader.IsDBNull(4) ? (DateTime?)null : reader.GetDateTime(4);
this.Ende = reader.IsDBNull(5) ? (DateTime?)null : reader.GetDateTime(5);
this.ContainerDirt = reader.IsDBNull(6) ? 0 : reader.GetInt32(6);
this.ContainerClean = reader.IsDBNull(7) ? 0 : reader.GetInt32(7);
this.SaisonID = reader.GetInt32(8);
this.Tourenliste = reader.IsDBNull(9) ? null : (byte[])reader[9];
this.ListeGedruckt = reader.IsDBNull(10) ? (DateTime?)null : reader.GetDateTime(10);
this.GedrucktVon = reader.IsDBNull(11) ? (int?)null : reader.GetInt32(11);
}
#endregion
#region Konstruktors
/// <summary>
/// Sucht und Findet Tour wenn tTourID is null, werden BenutzerID und Liefertag benötigt
/// </summary>
/// <param name="tourID"></param>
/// <param name="arbeiterID"></param>
/// <param name="liefertag"></param>
/// <returns>Tour</returns>
internal static Tour FindeTour(int? tourID, int? arbeiterID, DateTime? liefertag)
{
Tour result = null;
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (tourID == null) command.CommandText = $"select {COLUMNS} from {TABLE} where benutzer_id = {arbeiterID} and liefertag = '{liefertag}'";
else
{
if (arbeiterID == null) command.CommandText = $"select {COLUMNS} from {TABLE} where liefertag = {liefertag}";
else command.CommandText = $"select {COLUMNS} from {TABLE} where tour_id = {tourID}";
}
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Tour(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
return result;
}
internal static Tour GetTour(int? tourID)
{
Tour result = null;
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where tour_id = {tourID}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) result = new Tour(reader);
reader.Close();
DatenbankConnection.GetConnection().Close();
return result;
}
#endregion
}
public class TDaten
{
public string TourName { get; set; }
public int FahrerId { get; set; }
// pro Tag = string → eigene Kundenliste
public Dictionary<string, List<KData>> KundenProTag { get; set; }
= new Dictionary<string, List<KData>>();
public Dictionary<string, int[]> Counter { get; set; }
= new Dictionary<string, int[]>();
}
}
//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: Eingabemöglichkeit von Tour Start und Ende muss erledigt werden.
//TODO: !!ÜBERLEGE!! Tour Start und Ende automatisch erfassen.
//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

@ -7,17 +7,6 @@ using System.Threading.Tasks;
namespace Deckungsbeitrag.AA_Klassen
{
public class TourenDaten
{
public string TourName { get; set; }
public int FahrerId { get; set; }
// pro Tag = string → eigene Kundenliste
public Dictionary<string, List<KundeData>> KundenProTag { get; set; }
= new Dictionary<string, List<KundeData>>();
public Dictionary<string, int[]> Counter { get; set; }
= new Dictionary<string, int[]>();
}
public class KundeData
{

View File

@ -6,11 +6,12 @@
</sectionGroup>
</configSections>
<appSettings>
<add key="ConnectionString" value="user id=postgres;password=Ki985941Wi;host=10.10.10.1;port=5432;database=Test_Wirl;Timeout=30" />
<add key="SortimentPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\Kundensortiment.txt" />
<add key="ConnectionString" value="user id=postgres;password=Ki985941Wi;host=10.10.10.1;port=5432;database=Test_Wirl;Timeout=15" />
<add key="SortimentPfad" value="N:\\TECHNIK\\Software\\Wirl-Verwaltung\\Listen\\Kundensortiment.txt" />
<add key="InventurPfad" value="N:\BÜRO\KUNDEN\INVENTUREN\Verwaltung" />
<add key="BildPfad" value="C:\\Users\\KilianWirl\\OneDrive - gehgassi GmbH\\Wäscherei Wirl\\Programme\\Deckungsbeitrag\\Deckungsbeitrag\\Star.png" />
<add key="QrPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\qrweb.png" />
<add key="DateiSavePfad" value="N:\TECHNIK\Software\Wirl-Verwaltung" />
<add key="QrPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\qrweb.png" />
<add key="Variabel" value="5000,5020,5300,5450,5701,5702,5800,5805,5812,6000,6010,6040,6090,6402,6600,6620,6630,6640,6660,7171,7220,7230,7235" />
<add key="FixLohn" value="6120,6200,6210,6240,6790,6791,7021,7022,7150,7180,7181,7200,7201,7202,7203,7204,7207,7215,7225" />
<add key="FixMiete" value="7023" />
@ -86,9 +87,6 @@
<setting name="OLVState" serializeAs="String">
<value />
</setting>
<setting name="Wirlblau" serializeAs="String">
<value>1, 53, 101</value>
</setting>
<setting name="ColPos" serializeAs="String">
<value />
</setting>
@ -131,20 +129,14 @@
<setting name="Entladeband" serializeAs="String">
<value>Violet</value>
</setting>
<setting name="AuftAbgel" serializeAs="String">
<setting name="LastKundeUpdate" serializeAs="String">
<value />
</setting>
<setting name="AuftBald" serializeAs="String">
<setting name="LastArtikelUpdate" serializeAs="String">
<value />
</setting>
<setting name="Location_GroupBoxStatistik_Main" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="Location_ButtonNeuerUser_Main" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="Location_ButtonNeuerAuftrag_Main" serializeAs="String">
<value>0, 0</value>
<setting name="LastSoftwareUpdate" serializeAs="String">
<value />
</setting>
<setting name="Etikett_Drucker" serializeAs="String">
<value>QL-500</value>
@ -155,6 +147,9 @@
<setting name="SWS_Copies" serializeAs="String">
<value>10</value>
</setting>
<setting name="Wirlblau" serializeAs="String">
<value>1, 53, 101</value>
</setting>
</Deckungsbeitrag.Properties.Settings>
</userSettings>
<system.web>

28
AppStarter/AppStarter.cs Normal file
View File

@ -0,0 +1,28 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.IO;
using System.Runtime.Remoting.Contexts;
namespace AppStarter
{
[RunInstaller(true)]
public class AppStarterInstaller : Installer
{
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
string appPath = Path.Combine(
@"C:\Program Files (x86)\Kilian Wirl GmbH\Verwaltung",
"Deckungsbeitrag.exe"); // Deine Haupt-App
if (File.Exists(appPath))
{
Process.Start(appPath);
}
}
}
}

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{30FAD621-D1A4-45A4-B5BC-52B9B5D8A540}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AppStarter</RootNamespace>
<AssemblyName>AppStarter</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppStarter.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("AppStarter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AppStarter")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("30fad621-d1a4-45a4-b5bc-52b9b5d8a540")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -6,24 +6,41 @@ using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Management;
using System.Net;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
namespace Deckungsbeitrag
{
static class Program
{
public static Color Wirlblau = Settings.Default.Wirlblau;
public static ImageList imagelist = new ImageList();
public static string userid;
public static Benutzer benutzer = new Benutzer();
public static bool Artikelliste_Importiert = false;
public static bool Kundenliste_Importiert = false;
public static bool Software_Updated = false;
private static DateTime zielZeit = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 22, 0, 0);
private static System.Timers.Timer timer;
//public static string vaultPath = @"N:\TECHNIK\Software\Wirl-Verwaltung\Feedback";
private static string savePath = ConfigurationManager.AppSettings["DateiSavePfad"];
private static bool istest = false;
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
@ -32,19 +49,119 @@ namespace Deckungsbeitrag
{
userid = ConfigurationManager.AppSettings["ConnectionString"].Split(';')[0];
userid = userid.Split('=')[1];
timer = new System.Timers.Timer();
timer.Interval = 1000;
timer.Elapsed += Timer_Elapsed;
timer.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Screen[] screens = Screen.AllScreens;
Cursor.Current = Cursors.WaitCursor;
// Check, Install und Update wenn Update vorhanden.
if (CheckAndInstallUpdate())
{
MessageBox.Show("Update wurde erfolgreich durchgeführt.\nStarte das Programm über den Desktop neu.", "UPDATE INFO", MessageBoxButtons.OK, MessageBoxIcon.Information);
Software_Updated = true;
Settings.Default.LastSoftwareUpdate = DateTime.Now;
return;
}
// Laden der Image-Liste mit Icons für ObjectListView in Export etc.
ImageList_Laden();
string readmePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Verwaltung_ReadMe.txt");
// Importieren und Updaten der Kundenliste wenn Datei vorhanden.
KundenList_Laden();
// Importieren und Updaten der Artikelliste wenn Datei vorhanden.
ArtikelList_Laden();
Settings.Default.Save();
Cursor.Current = Cursors.Default;
if (istest) { Application.Run(new FormAufleger()); return; }
if (userid.StartsWith("ms") | userid.StartsWith("ps"))
{
switch (userid)
{
case var s when s.Contains("wstrasse"):
benutzer = Benutzer.GetBenutzer(null, 4);
Application.Run(new FormAufleger(userid));
break;
case var s when s.Contains("frottee"):
if (userid.Contains("01")) benutzer = Benutzer.GetBenutzer(null, 10);
if (userid.Contains("02")) benutzer = Benutzer.GetBenutzer(null, 17);
Application.Run(new FormFehlmengeCount(userid));
break;
case var s when s.Contains("kleinteile"):
if (userid.Contains("01")) benutzer = Benutzer.GetBenutzer(null, 11);
if (userid.Contains("02")) benutzer = Benutzer.GetBenutzer(null, 11);
Application.Run(new FormFehlmengeCount(userid));
break;
case var s when s.Contains("grossteile"):
if (userid.Contains("01")) benutzer = Benutzer.GetBenutzer(null, 9);
if (userid.Contains("02")) benutzer = Benutzer.GetBenutzer(null, 9);
Application.Run(new FormFehlmengeCount(userid));
break;
case var s when s.Contains("spannleintuch"):
benutzer = Benutzer.GetBenutzer(null, 22);
Application.Run(new FormFehlmengeCount(userid));
break;
default:
break;
}
}
else
{
// Öffnen der ReadMe wenn noch nicht geöffnet wurde.
Open_ReadMe();
FormLogin loginForm = new FormLogin();
if (loginForm.ShowDialog() == DialogResult.OK)
{
benutzer = loginForm.Person;
// Switch on BenutzerRolle für Weiterleitung zum richtigen Screen
switch (loginForm.Person.Rolle)
{
case BenutzerRolle.Verwaltung: //Büropersonal ohne aktive Hallenbeschäftigung
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Fahrer: //Zustellfahrer
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Admin: //Höheres Büropersonal oder Claudia und Kevin
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Waschstrasse: //Bediener einer Waschstraße
Application.Run(new FormNeuerAuftrag(loginForm.Person, AuftragTyp.Standart));
break;
case BenutzerRolle.Master: //Entwickler oder Claudia und Kevin
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Expedit: //Endkontrolle Lieferungen und Lieferscheine (Mirka)
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
case BenutzerRolle.Frottee: //Containerbestückung Frotteewäsche
//BenutzerRolle Frottee = Expedit Frottee da die Maschine keine Anmeldung erfordert.
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
case BenutzerRolle.Flach: //Containerbestückung Flachwäsche
//BenutzerRolle Flach = Expedit Frottee da die Maschine keine Anmeldung erfordert.
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
default:
break;
}
}
}
}
private static void Open_ReadMe()
{
string readmePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Verwaltung_ReadMe.txt");
// Prüfe, ob ReadMe schon einmal geöffnet wurde
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\KilianWirlGmbH\Verwaltung"))
{
@ -87,88 +204,297 @@ namespace Deckungsbeitrag
}
}
}
if (istest) { Application.Run(new FormAufleger()); return; }
if (userid.StartsWith("ms") | userid.StartsWith("ps"))
{
if (userid.Contains("wstrasse")) Application.Run(new FormWSVerfolgung(userid));
else Application.Run(new FormFehlmengeCount(userid));
}
else
{
FormLogin loginForm = new FormLogin();
if (loginForm.ShowDialog() == DialogResult.OK)
{
// Switch on BenutzerRolle für Weiterleitung zum richtigen Screen
switch (loginForm.Person.Rolle)
{
case BenutzerRolle.Verwaltung: //Büropersonal ohne aktive Hallenbeschäftigung
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Fahrer: //Zustellfahrer
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Admin: //Höheres Büropersonal oder Claudia und Kevin
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Waschstrasse: //Bediener einer Waschstraße
Application.Run(new FormNeuerAuftrag(loginForm.Person, AuftragTyp.Standart));
break;
case BenutzerRolle.Master: //Entwickler oder Claudia und Kevin
Application.Run(new FormMain(loginForm.Person));
break;
case BenutzerRolle.Expedit: //Endkontrolle Lieferungen und Lieferscheine (Mirka)
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
case BenutzerRolle.Frottee: //Containerbestückung Frotteewäsche
//BenutzerRolle Frottee = Expedit Frottee da die Maschine keine Anmeldung erfordert.
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
case BenutzerRolle.Flach: //Containerbestückung Flachwäsche
//BenutzerRolle Flach = Expedit Frottee da die Maschine keine Anmeldung erfordert.
Application.Run(new FormExpedit(loginForm.Person, screens));
break;
default:
break;
}
}
}
private static void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
if (DateTime.Now >= zielZeit)
{
timer.Stop();
timer.Dispose();
Application.Exit(); // Schließt alle Forms und beendet die App
}
}
private static void ArtikelList_Laden()
{
string updatePath = Path.Combine(savePath, "Listen");
updatePath = @"N:\TECHNIK\Software\Wirl-Verwaltung\Listen"; //Pfad zu Listen
string dateiName = "Artikelkurzliste.csv";
string row;
string[] rows;
try
{
// Prüfen ob File Artikelkurzliste existiert.
if (File.Exists(Path.Combine(updatePath, dateiName)))
{
string filename = Path.Combine(updatePath, dateiName);
StreamReader streamReader = new StreamReader(filename, Encoding.GetEncoding("iso-8859-1"));
row = string.Empty;
rows = new string[0];
int saved = 0;
int tosave = 0;
int idx = 1;
while (!streamReader.EndOfStream)
{
Array.Resize<string>(ref rows, idx);
row = streamReader.ReadLine();
if (row.StartsWith("60") || row.StartsWith("20"))
{
rows[idx - 1] = row;
idx++;
}
}
streamReader.Close();
// Zeilen der Datei durchiterieren.
foreach (string line in rows)
{
string[] linedata = line.Split(';');
// ArtikelGruppen 60 und 20 werden weiterverarbeitet.
if (linedata[0] == "60" || linedata[0] == "20")
{
tosave++;
// Artikel wird in DB gesucht und geholt.
Artikel art = Artikel.GetArtikel(Convert.ToInt32(linedata[1]));
if (art == null) art = new Artikel();
art.Nummer = Convert.ToInt32(linedata[1]);
art.Bezeichnung = linedata[3];
// Kategorie wird nach Artikelnummer zugeordnet.
switch (art.Nummer)
{
case var nr when nr.ToString()[1] == '3': // 2.Stelle wird auf 3 überprüft
art.Kategorie = ArtikelKategorie.Frottee;
break;
case var nr when nr.ToString()[1] == '1' & nr.ToString()[2] == '1': // 2. und 3. Stelle wird auf 1 überprüft
if (nr.ToString()[4] == '5' || nr.ToString()[4] == '6')
art.Kategorie = ArtikelKategorie.Spannleintuch;
else art.Kategorie = ArtikelKategorie.Grossteile;
break;
case var nr when nr.ToString()[1] == '1' & nr.ToString()[2] == '2': // 2. und 3. Stelle wird auf 2 überprüft
art.Kategorie = ArtikelKategorie.Kleinteile;
break;
default:
break;
}
// Wenn Artikel Shortbezeichnung ist vorhanden dann leeren damit neue Bezeichnung erstellt werden kann.
if (!string.IsNullOrWhiteSpace(art.Short)) art.Short = string.Empty;
// Erstellen der Shortbezeichnung für Buttons etc.
if (art.Bezeichnung.Contains("DOPPEL") | art.Bezeichnung.Contains("D-")) art.Short = art.Short + "D-";
if (art.Bezeichnung.Contains("SPANN")) art.Short = art.Short + "SP";
if (art.Bezeichnung.Contains("LEINTUCH")) art.Short = art.Short + "LT";
if (art.Bezeichnung.Contains("SPANN"))
{
string[] s = art.Bezeichnung.Split(' ');
if (s.Length == 3) art.Short = art.Short + " " + s[2];
} //Farben zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("HANDTUCH")) art.Short = art.Short + "HT";
if (art.Bezeichnung.Contains("DUSCHTUCH")) art.Short = art.Short + "DT";
if (art.Bezeichnung.Contains("BADETUCH")) art.Short = art.Short + "BT";
if (art.Bezeichnung.Contains("BADEVORLEGER")) art.Short = art.Short + "BV";
if (art.Bezeichnung.Contains("BADEMANTEL")) art.Short = art.Short + "BM";
if (art.Bezeichnung.Contains("SAUNATUCH")) art.Short = art.Short + "ST";
if (art.Bezeichnung.Contains("GESICHTSTUCH")) art.Short = art.Short + "GT";
if (art.Bezeichnung.Contains("POLSTERBEZUG"))
{
string extra;
int index = art.Bezeichnung.IndexOf(" ") + 1;
int length = art.Bezeichnung.IndexOf(" ", index + 1) - index;
art.Short = art.Short + "PB";
if (index > 0 & length > 0)
{
extra = art.Bezeichnung.Substring(index, length);
art.Short += " " + extra;
}
switch (art.Bezeichnung)
{
case var bez when bez.Contains("60x80"):
art.Short = art.Short + " 60x80";
break;
case var bez when bez.Contains("40x60"):
art.Short = art.Short + " 40x60";
break;
case var bez when bez.Contains("40x40"):
art.Short = art.Short + " 40x40";
break;
case var bez when bez.Contains("40x50"):
art.Short = art.Short + " 40x50";
break;
case var bez when bez.Contains("40x70"):
art.Short = art.Short + " 40x70";
break;
default:
break;
}
} //Größen zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("DECKENBEZUG"))
{
string extra;
int index = art.Bezeichnung.IndexOf(" ") + 1;
int length = art.Bezeichnung.IndexOf(" ", index + 1) - index;
art.Short = art.Short + "DB";
if (index > 0 & length > 0)
{
extra = art.Bezeichnung.Substring(index, length);
art.Short += " " + extra;
}
}
if (art.Bezeichnung.Contains("TISCHTUCH"))
{
art.Short = art.Short + "TT";
int index = art.Bezeichnung.IndexOf("x");
if (index > 0) art.Short = art.Short + art.Bezeichnung.Substring(index - 4, 8);
} //Tischtücher und Größen zuordnen und zu Short hinzufügen
if (art.Bezeichnung.Contains("MUNDSERVIETTE")) art.Short = art.Short + "MS";
if (art.Bezeichnung.Contains("DECKSERVIETTE")) art.Short = art.Short + "DS";
if (art.Save() == 1) saved++;
}
}
if (saved == tosave) { Artikelliste_Importiert = true; Settings.Default.LastArtikelUpdate = DateTime.Now; }
}
}
catch (Exception ex)
{
MessageBox.Show($"Import fehlgeschlagen: {ex.Message}\nPfad: {updatePath}\nDatei: {dateiName}", "IMPORT FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
finally
{
// Wenn alles funktioniert hat wird die Datei gelöscht.
if (Artikelliste_Importiert) File.Delete(Path.Combine(updatePath, dateiName));
}
}
private static void KundenList_Laden()
{
string updatePath = Path.Combine(savePath, "Listen");
updatePath = @"N:\TECHNIK\Software\Wirl-Verwaltung\Listen"; //Pfad zu Listen
string dateiName = "Kundenstammblatt.csv";
string row;
string[] rows;
try
{
// Prüfen ob File Kundenstammblatt existiert.
if (File.Exists(Path.Combine(updatePath, dateiName)))
{
string filename = Path.Combine(updatePath, dateiName);
StreamReader sr = new StreamReader(filename, Encoding.GetEncoding("iso-8859-1"));
row = string.Empty;
rows = new string[0];
int saved = 0;
int tosave = 0;
int idx = 0;
while (!sr.EndOfStream)
{
Array.Resize<string>(ref rows, ++idx);
row = sr.ReadLine();
rows[idx - 1] = row;
}
sr.Close();
// Jede Zeile der Datei wird durchiteriert.
foreach (string line in rows)
{
string[] linedata = line.Split(';');
// Wenn 1. Datensatz von linedata keine Zahlen sind oder 5. Datensatz Preisgruppe enthält wird Zeile ignoriert.
if (!int.TryParse(linedata[0], out _)) continue;
if (linedata[4].Contains("Preisgruppe")) continue;
tosave++;
// Kunde wird gesucht und aus DB geholt.
Kunde kunde = Kunde.GetKunde(linedata[0], null, null);
if (kunde == null) kunde = new Kunde();
kunde.KundeNummer = linedata[0];
kunde.KundeGruppe = linedata[3];
kunde.PLZ = int.TryParse(linedata[4], out int tmp2) ? tmp2 : 00;
kunde.KundeName = linedata[5];
kunde.KundeName2 = linedata[6];
kunde.Strasse = linedata[8];
kunde.Land = linedata[9];
kunde.Ort = linedata[10];
kunde.Bettenanzahl = int.TryParse(linedata[45], out int bett) ? bett : 0;
kunde.Waescheart = linedata[46];
kunde.Service = linedata[47];
kunde.Region = linedata[48];
kunde.Suchtext = linedata[55];
kunde.Aktiv = linedata[56] == "1" ? true : false;
if (kunde.Save() == 1) saved++;
}
if (saved == tosave) { Kundenliste_Importiert = true; Settings.Default.LastKundeUpdate = DateTime.Now; }
}
}
catch (Exception ex)
{
MessageBox.Show($"Import fehlgeschlagen: {ex.Message}\nPfad: {updatePath}\nDatei: {dateiName}", "IMPORT FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
finally
{
// Wenn alles funktioniert hat wird die Datei gelöscht.
if (Kundenliste_Importiert) File.Delete(Path.Combine(updatePath, dateiName));
}
}
private static bool CheckAndInstallUpdate()
{
string updatePath = Path.Combine(savePath, "Setup");
string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
string updatePath = @"N:\TECHNIK\Software\Wirl-Verwaltung\Setup"; // Ihr interner UNC-Pfad
updatePath = @"N:\TECHNIK\Software\Wirl-Verwaltung\Setup"; // Ihr interner UNC-Pfad
try
{
string newVersion = File.ReadAllText(Path.Combine(updatePath, "Version.txt")).Trim();
if (string.IsNullOrWhiteSpace(newVersion))
{
// Alle msi Files auflisten.
string[] msiFiles = Directory.GetFiles(updatePath, "SetupVerwaltung*.msi");
if (msiFiles.Length == 0) return false;
// Neueste Version aus Dateiname finden
string validMsis = msiFiles
.Select(f => new { Path = f, Version = GetVersionFromMsiFilename(f) })
.Where(x => IsValidVersion(x.Version))
.OrderByDescending(x => new Version(x.Version))
.FirstOrDefault()?.Version;
// Wenn Version ist valide wird sie als neue Version gführt.
if (validMsis != null) newVersion = validMsis;
}
// Prüfen ob neue Version ist größer als aktuelle Version.
if (new Version(newVersion).CompareTo(new Version(currentVersion)) > 0)
{
DialogResult result = MessageBox.Show(
$"Update verfügbar: {newVersion}\nInstallieren?",
"Update verfügbar",
"UPDATE VERFÜGBAR",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
string msiPath = Path.Combine(updatePath, "SetupVerwaltung.msi");
string msiPath = Path.Combine(updatePath, $"SetupVerwaltung{newVersion}.msi");
if (result == DialogResult.Yes)
{
try
{
// 1. Laufende Prozesse killen
//foreach (var proc in Process.GetProcessesByName("Deckungsbeitrag"))
// try { proc.Kill(); } catch { }
// 2. MSI lokal kopieren (umgeht UNC-Fehler 2203)
string localMsi = Path.Combine(Path.GetTempPath(), "SetupVerwaltung.msi");
// 1. MSI lokal kopieren (umgeht UNC-Fehler 2203)
string localMsi = Path.Combine(@"C:\tmp", $"SetupVerwaltung{newVersion}.msi");
File.Copy(msiPath, localMsi, true);
// 3. MSI starten
// 2. MSI starten
var psi = new ProcessStartInfo
{
FileName = "msiexec.exe",
@ -177,12 +503,30 @@ namespace Deckungsbeitrag
UseShellExecute = true
};
// Prozexxe und Programm schließen.
// 1. SELBST schließen (wichtig!)
Application.Exit();
// 2. ALLE Prozesse killen
foreach (Process p in Process.GetProcessesByName("Deckungsbeitrag"))
if (p.Id != Process.GetCurrentProcess().Id)
p.Kill();
foreach (Process p in Process.GetProcessesByName("Wirl-Verwaltung"))
p.Kill();
foreach (Process p in Process.GetProcessesByName("SetupVerwaltung"))
p.Kill();
// 3. 2 Sekunden warten (Restart Manager)
Thread.Sleep(2000);
Process.Start(psi)?.Dispose();
return true;
}
catch (Exception ex)
{
MessageBox.Show($"Start fehlgeschlagen: {ex.Message}");
MessageBox.Show($"Start fehlgeschlagen: {ex.Message}", "UPDATE FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
@ -190,10 +534,29 @@ namespace Deckungsbeitrag
catch (Exception ex)
{
MessageBox.Show($"Update-Prüfung fehlgeschlagen: {ex.Message}\nPfad: {updatePath}",
"Fehler", MessageBoxButtons.OK, MessageBoxIcon.Warning);
"UPDATE FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Warning);
AddFehler(null, ex.Message, ex.StackTrace, null);
}
return false;
}
private static string GetVersionFromMsiFilename(string msiFilePath)
{
string filename = Path.GetFileNameWithoutExtension(msiFilePath);
// Pattern: SetupVerwaltung1.0.44.msi → 1.0.44
// Oder: SetupVerwaltung_v1_0_44.msi → 1.0.44
Match match = Regex.Match(filename, @"(\d+(?:\.\d+){2,3})");
if (match.Success)
return match.Groups[1].Value;
return "0.0.0"; // Fallback
}
private static bool IsValidVersion(string version)
{
return Version.TryParse(version, out _);
}
private static void ImageList_Laden()
{
imagelist.Images.Add(Resources.Exclamation_Red);
@ -202,8 +565,67 @@ namespace Deckungsbeitrag
imagelist.Images.Add("abschließen", Resources.checkmark);
imagelist.Images.Add("dirt", Resources.dirt);
imagelist.Images.Add("clean", Resources.clean);
imagelist.Images.Add("close", Resources.Close_red_16x);
}
public static void AddFeedback(Benutzer user, string feedbackText, string bildDateiname, string timeStamp)
{
string vaultPath = Path.Combine(savePath, "Feedback\\VerwaltungFeedback.md");
string bildPath = Path.Combine(savePath, bildDateiname);
string feedback = string.Empty;
Benutzer ben = benutzer;
// Wenn User existiert wird dieser Verwendet. Sonst der bei Anmeldung registrierte Benutzer.
if (user != null) ben = user;
// Wenn der Bilddateiname leer ist wird feedback ohne Bilddateiname erstellt.
if (string.IsNullOrWhiteSpace(bildDateiname))
{
feedback = $@"- [ ] **Zeitpunkt:** {timeStamp} **| User:** {ben.Vorname} {ben.Nachname} **| Text:** {feedbackText}{Environment.NewLine}";
}
else feedback = $@" - [ ] **Zeitpunkt:** {timeStamp} **| User:** {ben.Vorname} {ben.Nachname} **| Text:** {feedbackText} **| Bild:** ![[{bildDateiname}.png]]{Environment.NewLine}";
// Test wenn Image mitgegeben wird wird es hier gespeichert. (Pfadprobleme)
File.AppendAllText(vaultPath, feedback);
}
/// <summary>
/// Fehler werden in Obsidian Fehlerliste Importiert.
/// </summary>
/// <param name="user"> wenn null dann in Program registrierter User</param>
/// <param name="fehlerText"> Fehlertext aus Exception oder individuell erstellen</param>
/// <param name="fehlerStackTrace"> wenn null wird StackTrace nicht eingefügt. Kann auch individuell verwendet werden (Ort des Fehlers)</param>
/// <param name="timeStamp"> wenn null wird TimeStamp hier erstellt</param>
public static void AddFehler(Benutzer user, string fehlerText, string fehlerStackTrace, string timeStamp)
{
string vaultPath = Path.Combine(savePath, "Feedback\\VerwaltungFehler.md");
//string bildPath = Path.Combine(savePath, bildDateiname);
string fehler = string.Empty;
string benutzerKennung = string.Empty;
Benutzer ben = benutzer;
// Wenn User existiert wird dieser Verwendet. Sonst der bei Anmeldung registrierte Benutzer.
if (user != null) ben = user;
if (ben.BenutzerID == null) benutzerKennung = userid; else benutzerKennung = ben.Vorname + " " + ben.Nachname;
if (timeStamp == null) timeStamp = DateTime.Now.ToString("dd.MM.yyyy-HH:mm");
// Wenn der Bilddateiname leer ist wird feedback ohne Bilddateiname erstellt.
if (string.IsNullOrWhiteSpace(fehlerStackTrace))
{
fehler = $@"- [ ] **Zeitpunkt:** {timeStamp} **| User:** {benutzerKennung} **| Fehler:** {fehlerText}{Environment.NewLine}";
}
else
{
fehler = $@" - [ ] **Zeitpunkt:** {timeStamp} **| User:** {benutzerKennung} **| Fehler:** {fehlerText} **| StackTrace:** {fehlerStackTrace}{Environment.NewLine}";
}
// Test wenn Image mitgegeben wird wird es hier gespeichert. (Pfadprobleme)
File.AppendAllText(vaultPath, fehler);
}
}
}
}
//TODO: Mit AddFehler in Obsidian eine Fehlerliste betreiben. (Wichtige Infos feststellen und bereitstellen)
//DONE: Mit AddFehler können Fehler aus try/chatch in Obsidian eingefügt werden. (Timestamp, PC-Name, Ex-Message)

View File

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

View File

@ -35,18 +35,6 @@ namespace Deckungsbeitrag.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1, 53, 101")]
public global::System.Drawing.Color Wirlblau {
get {
return ((global::System.Drawing.Color)(this["Wirlblau"]));
}
set {
this["Wirlblau"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Drawing.Color ColPos {
@ -214,59 +202,34 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Drawing.Color AuftAbgel {
public global::System.DateTime LastKundeUpdate {
get {
return ((global::System.Drawing.Color)(this["AuftAbgel"]));
return ((global::System.DateTime)(this["LastKundeUpdate"]));
}
set {
this["AuftAbgel"] = value;
this["LastKundeUpdate"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Drawing.Color AuftBald {
public global::System.DateTime LastArtikelUpdate {
get {
return ((global::System.Drawing.Color)(this["AuftBald"]));
return ((global::System.DateTime)(this["LastArtikelUpdate"]));
}
set {
this["AuftBald"] = value;
this["LastArtikelUpdate"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
public global::System.Drawing.Point Location_GroupBoxStatistik_Main {
public global::System.DateTime LastSoftwareUpdate {
get {
return ((global::System.Drawing.Point)(this["Location_GroupBoxStatistik_Main"]));
return ((global::System.DateTime)(this["LastSoftwareUpdate"]));
}
set {
this["Location_GroupBoxStatistik_Main"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
public global::System.Drawing.Point Location_ButtonNeuerUser_Main {
get {
return ((global::System.Drawing.Point)(this["Location_ButtonNeuerUser_Main"]));
}
set {
this["Location_ButtonNeuerUser_Main"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
public global::System.Drawing.Point Location_ButtonNeuerAuftrag_Main {
get {
return ((global::System.Drawing.Point)(this["Location_ButtonNeuerAuftrag_Main"]));
}
set {
this["Location_ButtonNeuerAuftrag_Main"] = value;
this["LastSoftwareUpdate"] = value;
}
}
@ -305,5 +268,17 @@ namespace Deckungsbeitrag.Properties {
this["SWS_Copies"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1, 53, 101")]
public global::System.Drawing.Color Wirlblau {
get {
return ((global::System.Drawing.Color)(this["Wirlblau"]));
}
set {
this["Wirlblau"] = value;
}
}
}
}

View File

@ -5,9 +5,6 @@
<Setting Name="OLVState" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Wirlblau" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">1, 53, 101</Value>
</Setting>
<Setting Name="ColPos" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" />
</Setting>
@ -50,20 +47,14 @@
<Setting Name="Entladeband" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">Violet</Value>
</Setting>
<Setting Name="AuftAbgel" Type="System.Drawing.Color" Scope="User">
<Setting Name="LastKundeUpdate" Type="System.DateTime" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AuftBald" Type="System.Drawing.Color" Scope="User">
<Setting Name="LastArtikelUpdate" Type="System.DateTime" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Location_GroupBoxStatistik_Main" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
<Setting Name="Location_ButtonNeuerUser_Main" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
<Setting Name="Location_ButtonNeuerAuftrag_Main" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
<Setting Name="LastSoftwareUpdate" Type="System.DateTime" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Etikett_Drucker" Type="System.String" Scope="User">
<Value Profile="(Default)">QL-500</Value>
@ -74,5 +65,8 @@
<Setting Name="SWS_Copies" Type="System.Int32" Scope="User">
<Value Profile="(Default)">10</Value>
</Setting>
<Setting Name="Wirlblau" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">1, 53, 101</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -136,6 +136,12 @@
"Entry"
{
"MsmKey" = "8:_3518CDF283287B9BB382E0C864B0B344"
"OwnerKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_3518CDF283287B9BB382E0C864B0B344"
"OwnerKey" = "8:_14F178F5FD5EFA4C1973A6B30514E332"
"MsmSig" = "8:_UNDEFINED"
}
@ -147,6 +153,12 @@
}
"Entry"
{
"MsmKey" = "8:_3518CDF283287B9BB382E0C864B0B344"
"OwnerKey" = "8:_C718F2556CAE414E1E99F6C2E428F264"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_361CD6DDAD5DAD87766154F455EA61CE"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
@ -184,6 +196,12 @@
"Entry"
{
"MsmKey" = "8:_404BC92A271981651469C5BBB22AFBC1"
"OwnerKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_404BC92A271981651469C5BBB22AFBC1"
"OwnerKey" = "8:_CC6E1B525578AF50C3DD3123399882F3"
"MsmSig" = "8:_UNDEFINED"
}
@ -207,6 +225,18 @@
}
"Entry"
{
"MsmKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"OwnerKey" = "8:_AF0561A39DB2C2DCAF31DD5BAA282B37"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_4FCAEBB85B559E3350E3A4912FADA0F0"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
@ -256,6 +286,18 @@
"Entry"
{
"MsmKey" = "8:_5DDEB1FF3DD78281FF3203E5E9933C19"
"OwnerKey" = "8:_AF0561A39DB2C2DCAF31DD5BAA282B37"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5DDEB1FF3DD78281FF3203E5E9933C19"
"OwnerKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5DDEB1FF3DD78281FF3203E5E9933C19"
"OwnerKey" = "8:_5E4D6952244F4AAC64F327394623EE57"
"MsmSig" = "8:_UNDEFINED"
}
@ -273,6 +315,12 @@
}
"Entry"
{
"MsmKey" = "8:_5DDEB1FF3DD78281FF3203E5E9933C19"
"OwnerKey" = "8:_C718F2556CAE414E1E99F6C2E428F264"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5E4D6952244F4AAC64F327394623EE57"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
@ -285,6 +333,12 @@
}
"Entry"
{
"MsmKey" = "8:_66BBFB81F226D85D4DFF46362404CBA9"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_6A4E9AB7C92A8099AD635862468BFCBE"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
@ -363,6 +417,12 @@
}
"Entry"
{
"MsmKey" = "8:_AF0561A39DB2C2DCAF31DD5BAA282B37"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_BA8B9295763872FA6F6B706A524178AD"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
@ -375,6 +435,18 @@
}
"Entry"
{
"MsmKey" = "8:_C718F2556CAE414E1E99F6C2E428F264"
"OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_C718F2556CAE414E1E99F6C2E428F264"
"OwnerKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_CC6E1B525578AF50C3DD3123399882F3"
"OwnerKey" = "8:_14F178F5FD5EFA4C1973A6B30514E332"
"MsmSig" = "8:_UNDEFINED"
@ -484,6 +556,12 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_66BBFB81F226D85D4DFF46362404CBA9"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_FD8164C4BBFD975FAFD2A4D86340E915"
"MsmSig" = "8:_UNDEFINED"
}
@ -496,6 +574,18 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_AF0561A39DB2C2DCAF31DD5BAA282B37"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_415A4FE801E6F28929188A3C06EEAEBB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_719473B495FBAC457431A4E48A1F4B17"
"MsmSig" = "8:_UNDEFINED"
}
@ -538,6 +628,12 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_C718F2556CAE414E1E99F6C2E428F264"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_BA8B9295763872FA6F6B706A524178AD"
"MsmSig" = "8:_UNDEFINED"
}
@ -691,20 +787,6 @@
{
"CustomAction"
{
"{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_361CBAC1329945C3B59EDDE91B890C89"
{
"Name" = "8:Primäre Ausgabe from Verwaltung (Active)"
"Condition" = "8:"
"Object" = "8:_AD2C2F4AADC342899908C708EB4F4A72"
"FileType" = "3:2"
"InstallAction" = "3:1"
"Arguments" = "8:"
"EntryPoint" = "8:"
"Sequence" = "3:1"
"Identifier" = "8:_21EB0CCF_0F46_48D6_888C_4906CAEEBE87"
"InstallerClass" = "11:TRUE"
"CustomActionData" = "8:/showreadme=\"1\""
}
}
"DefaultFeature"
{
@ -996,6 +1078,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_415A4FE801E6F28929188A3C06EEAEBB"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Polly.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_415A4FE801E6F28929188A3C06EEAEBB"
{
"Name" = "8:Polly.Core.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Polly.Core.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4FCAEBB85B559E3350E3A4912FADA0F0"
{
"AssemblyRegister" = "3:1"
@ -1171,6 +1284,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_66BBFB81F226D85D4DFF46362404CBA9"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_66BBFB81F226D85D4DFF46362404CBA9"
{
"Name" = "8:System.ComponentModel.Annotations.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.ComponentModel.Annotations.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_6A4E9AB7C92A8099AD635862468BFCBE"
{
"AssemblyRegister" = "3:1"
@ -1419,6 +1563,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AF0561A39DB2C2DCAF31DD5BAA282B37"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Polly, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_AF0561A39DB2C2DCAF31DD5BAA282B37"
{
"Name" = "8:Polly.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Polly.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BA8B9295763872FA6F6B706A524178AD"
{
"AssemblyRegister" = "3:1"
@ -1481,6 +1656,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C718F2556CAE414E1E99F6C2E428F264"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Microsoft.Bcl.TimeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_C718F2556CAE414E1E99F6C2E428F264"
{
"Name" = "8:Microsoft.Bcl.TimeProvider.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Microsoft.Bcl.TimeProvider.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CC6E1B525578AF50C3DD3123399882F3"
{
"AssemblyRegister" = "3:1"
@ -1661,15 +1867,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SetupVerwaltung"
"ProductCode" = "8:{4FD79103-576E-403C-9E02-10D5B764821C}"
"PackageCode" = "8:{BA6A18B4-83A2-4F0C-A72C-B5A0AF2D5643}"
"ProductCode" = "8:{64342440-05F3-46F2-A8F6-20A35192849F}"
"PackageCode" = "8:{094EB76B-7223-482A-8DCA-57B28545D843}"
"UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.43"
"ProductVersion" = "8:1.0.80"
"Manufacturer" = "8:Kilian Wirl GmbH"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
@ -1685,7 +1891,7 @@
"UseSystemSearchPath" = "11:TRUE"
"TargetPlatform" = "3:0"
"PreBuildEvent" = "8:"
"PostBuildEvent" = "8:"
"PostBuildEvent" = "8:powershell -NoProfile -ExecutionPolicy Bypass -Command \"$asm = gci 'C:\\\\Users\\\\KilianWirl\\\\source\\\\repos\\\\Programm_Wirl\\\\bin\\\\Debug\\\\*.exe' | select -first 1; $v = [System.Reflection.Assembly]::LoadFile($asm.FullName).GetName().Version; $oldMsi = 'C:\\\\Users\\\\KilianWirl\\\\Source\\\\Repos\\\\Programm_Wirl\\\\SetupVerwaltung\\\\Debug\\\\SetupVerwaltung.msi'; $newMsi = 'C:\\\\Users\\\\KilianWirl\\\\Source\\\\Repos\\\\Programm_Wirl\\\\SetupVerwaltung\\\\Debug\\\\SetupVerwaltung' + $v.ToString() + '.msi'; Move-Item $oldMsi $newMsi; Write-Host 'FERTIG: SetupVerwaltung.msi'\"\r\n"
"RunPostBuildEvent" = "3:0"
}
"Registry"

83
UserControls/UCArtikel.Designer.cs generated Normal file
View File

@ -0,0 +1,83 @@
namespace Deckungsbeitrag.UserControls
{
partial class UCArtikel
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCArtikel));
this.labelArtikel = new System.Windows.Forms.Label();
this.pictureBoxMinus = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).BeginInit();
this.SuspendLayout();
//
// labelArtikel
//
this.labelArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.labelArtikel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelArtikel.Location = new System.Drawing.Point(0, 0);
this.labelArtikel.Name = "labelArtikel";
this.labelArtikel.Size = new System.Drawing.Size(160, 41);
this.labelArtikel.TabIndex = 0;
this.labelArtikel.Text = "label1";
//
// pictureBoxMinus
//
this.pictureBoxMinus.BackColor = System.Drawing.Color.Red;
this.pictureBoxMinus.Dock = System.Windows.Forms.DockStyle.Right;
this.pictureBoxMinus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxMinus.Image")));
this.pictureBoxMinus.Location = new System.Drawing.Point(165, 0);
this.pictureBoxMinus.Margin = new System.Windows.Forms.Padding(2);
this.pictureBoxMinus.Name = "pictureBoxMinus";
this.pictureBoxMinus.Size = new System.Drawing.Size(41, 41);
this.pictureBoxMinus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxMinus.TabIndex = 28;
this.pictureBoxMinus.TabStop = false;
this.pictureBoxMinus.Click += new System.EventHandler(this.pictureBoxMinus_Click);
//
// UCArtikel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlDark;
this.Controls.Add(this.pictureBoxMinus);
this.Controls.Add(this.labelArtikel);
this.Name = "UCArtikel";
this.Size = new System.Drawing.Size(206, 41);
this.Load += new System.EventHandler(this.UCArtikel_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label labelArtikel;
private System.Windows.Forms.PictureBox pictureBoxMinus;
}
}

56
UserControls/UCArtikel.cs Normal file
View File

@ -0,0 +1,56 @@
using DatenDB;
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.UserControls
{
public partial class UCArtikel : UserControl
{
public event EventHandler DeleteClicked;
public string ArtikelName
{
get => labelArtikel.Text;
set => labelArtikel.Text = value;
}
public int Anzahl;
public UCArtikel()
{
InitializeComponent();
}
public UCArtikel(Artikel artikel, int anzahl) : this()
{
this.labelArtikel.Text = $"{artikel.Nummer.ToString()}\n{artikel.Bezeichnung}";
this.Anzahl = anzahl;
this.Tag = artikel;
}
public UCArtikel(string s) : this()
{
this.labelArtikel.Text = s;
}
private void pictureBoxMinus_Click(object sender, EventArgs e)
{
if (this.DeleteClicked != null)
{
if (MessageBox.Show("Möchtest du den Artikel wirklich löschen?", "Frage", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
this.DeleteClicked(this, EventArgs.Empty);
}
}
}
private void UCArtikel_Load(object sender, EventArgs e)
{
this.labelArtikel.ForeColor = Color.Black;
}
}
}

128
UserControls/UCArtikel.resx Normal file
View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxMinus.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAADJJREFUOE9jYBgF1Affv393IITR9aCAb9++/SeE0fWgAJACJycnnJg+BhDC6HpG
wUADABXZimqO3LMmAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@ -34,16 +34,17 @@ namespace Deckungsbeitrag
this.labelFahrer = new System.Windows.Forms.Label();
this.labelCont = new System.Windows.Forms.Label();
this.labelContAnz = new System.Windows.Forms.Label();
this.labelTyp = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// labelKunde
//
this.labelKunde.AutoSize = true;
this.labelKunde.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelKunde.Location = new System.Drawing.Point(2, 0);
this.labelKunde.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelKunde.Location = new System.Drawing.Point(2, 2);
this.labelKunde.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelKunde.Name = "labelKunde";
this.labelKunde.Size = new System.Drawing.Size(126, 24);
this.labelKunde.Size = new System.Drawing.Size(97, 20);
this.labelKunde.TabIndex = 0;
this.labelKunde.Text = "KundeName";
//
@ -51,7 +52,7 @@ namespace Deckungsbeitrag
//
this.labelRegion.AutoSize = true;
this.labelRegion.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelRegion.Location = new System.Drawing.Point(3, 31);
this.labelRegion.Location = new System.Drawing.Point(3, 22);
this.labelRegion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelRegion.Name = "labelRegion";
this.labelRegion.Size = new System.Drawing.Size(53, 17);
@ -60,10 +61,9 @@ namespace Deckungsbeitrag
//
// labelFahrer
//
this.labelFahrer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelFahrer.AutoSize = true;
this.labelFahrer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelFahrer.Location = new System.Drawing.Point(151, 32);
this.labelFahrer.Location = new System.Drawing.Point(3, 39);
this.labelFahrer.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelFahrer.Name = "labelFahrer";
this.labelFahrer.Size = new System.Drawing.Size(46, 16);
@ -72,27 +72,39 @@ namespace Deckungsbeitrag
//
// labelCont
//
this.labelCont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelCont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.labelCont.AutoSize = true;
this.labelCont.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelCont.Location = new System.Drawing.Point(150, 2);
this.labelCont.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelCont.Location = new System.Drawing.Point(203, 39);
this.labelCont.Name = "labelCont";
this.labelCont.Size = new System.Drawing.Size(82, 20);
this.labelCont.Size = new System.Drawing.Size(37, 16);
this.labelCont.TabIndex = 3;
this.labelCont.Text = "Container:";
this.labelCont.Text = "Cont:";
//
// labelContAnz
//
this.labelContAnz.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelContAnz.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.labelContAnz.AutoSize = true;
this.labelContAnz.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelContAnz.Location = new System.Drawing.Point(238, 2);
this.labelContAnz.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelContAnz.Location = new System.Drawing.Point(246, 39);
this.labelContAnz.Name = "labelContAnz";
this.labelContAnz.Size = new System.Drawing.Size(39, 20);
this.labelContAnz.Size = new System.Drawing.Size(31, 16);
this.labelContAnz.TabIndex = 4;
this.labelContAnz.Text = "000";
this.labelContAnz.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// labelTyp
//
this.labelTyp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelTyp.AutoSize = true;
this.labelTyp.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTyp.Location = new System.Drawing.Point(203, 22);
this.labelTyp.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelTyp.Name = "labelTyp";
this.labelTyp.Size = new System.Drawing.Size(32, 17);
this.labelTyp.TabIndex = 5;
this.labelTyp.Text = "Typ";
//
// UCAuftrag
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -100,6 +112,7 @@ namespace Deckungsbeitrag
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.Silver;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.labelTyp);
this.Controls.Add(this.labelContAnz);
this.Controls.Add(this.labelCont);
this.Controls.Add(this.labelFahrer);
@ -107,7 +120,7 @@ namespace Deckungsbeitrag
this.Controls.Add(this.labelKunde);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "UCAuftrag";
this.Size = new System.Drawing.Size(280, 61);
this.Size = new System.Drawing.Size(280, 59);
this.ResumeLayout(false);
this.PerformLayout();
@ -120,5 +133,6 @@ namespace Deckungsbeitrag
private System.Windows.Forms.Label labelFahrer;
private System.Windows.Forms.Label labelCont;
private System.Windows.Forms.Label labelContAnz;
private System.Windows.Forms.Label labelTyp;
}
}

View File

@ -36,6 +36,11 @@ namespace Deckungsbeitrag
get => labelFahrer.Text;
set => labelFahrer.Text = value;
}
public string Typ
{
get => labelTyp.Text;
set => labelTyp.Text = value;
}
public UCAuftrag()
{
@ -43,6 +48,8 @@ namespace Deckungsbeitrag
}
public UCAuftrag(Auftrag auftrag) : this()
{
this.auftrag = auftrag;
this.kunde = Kunde.GetKunde(null, auftrag.KundeID, null);
Benutzer fahrer = Benutzer.GetBenutzer(null, auftrag.ArbeiterID);
@ -54,9 +61,10 @@ namespace Deckungsbeitrag
KundenRegion = this.kunde.Region;
ContainerAnzahl = auftrag.Container.ToString();
Fahrer = fahrer.Vorname + " " + fahrer.Nachname;
Typ = auftrag.Typ.ToString();
if (this.auftrag.Status == AuftragStatus.Aufgelegt)
this.BackColor = Color.YellowGreen;
if (this.auftrag.Status == AuftragStatus.Aufgelegt) this.BackColor = Color.YellowGreen;
else if (this.auftrag.Typ == AuftragTyp.AufAbruf) this.BackColor = Color.Gray;
}
}

View File

@ -42,7 +42,7 @@ namespace Deckungsbeitrag
{
foreach(Label lbl in this.tableLayoutPanelUCFach.Controls)
{
lbl.Font = Funktionen.Get_Font_Size(lbl.Font, lbl.Text, GetCellSizeInPixels(tableLayoutPanelUCFach, 4, 1).Height);
lbl.Font = Funktionen.Get_Label_Font(lbl.Font, lbl.Text, GetCellSizeInPixels(tableLayoutPanelUCFach, 4, 1));
}
}
/// <summary>

67
UserControls/UCFeedback.Designer.cs generated Normal file
View File

@ -0,0 +1,67 @@
namespace Deckungsbeitrag.UserControls
{
partial class UCFeedback
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.buttonFeedback = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// buttonFeedback
//
this.buttonFeedback.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFeedback.AutoSize = true;
this.buttonFeedback.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.buttonFeedback.FlatAppearance.BorderSize = 3;
this.buttonFeedback.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFeedback.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFeedback.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.buttonFeedback.Location = new System.Drawing.Point(3, 4);
this.buttonFeedback.Name = "buttonFeedback";
this.buttonFeedback.Size = new System.Drawing.Size(124, 41);
this.buttonFeedback.TabIndex = 68;
this.buttonFeedback.Text = "Feedback?";
this.buttonFeedback.UseVisualStyleBackColor = true;
this.buttonFeedback.Click += new System.EventHandler(this.buttonFeedback_Click);
//
// Feedback
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonFeedback);
this.Name = "Feedback";
this.Size = new System.Drawing.Size(130, 48);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonFeedback;
}
}

View File

@ -0,0 +1,88 @@
using DatenDB;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Deckungsbeitrag.UserControls
{
public partial class UCFeedback : UserControl
{
private string eingabe;
private Benutzer user;
private string bildDateiname;
private bool bildDone = false;
//private string vaultPath = Program.vaultPath;
public UCFeedback(Benutzer benutzer)
{
InitializeComponent();
this.user = benutzer;
}
private void buttonFeedback_Click(object sender, EventArgs e)
{
DialogResult result = DialogResult.Cancel;
string timestamp = string.Empty;
string bildDateiname = string.Empty;
Image clone = null;
// Fragen ob Bild erstellt werden soll. Inkl. Anleitung wie Screenshot funktioniert.
// Wenn bildDone ist true wird die Frage nichtmehr gestellt.
if (!bildDone) result = MessageBox.Show("Benötigst du für das Feedback einen Screenshot?\n\nDann bestätige mit [JA] und erstelle einen Screenshot mit den Tasten [Win]+[Shift]+[S].\n\nDanach click nochmals auf den Button [Feedback].", "Screenshot", MessageBoxButtons.YesNo);
// Wenn Bild benötigt, wird bildDone auf true gesetzt.
if (result == DialogResult.Yes) { bildDone = true; return; }
// Wenn kein Bild benötigt oder bildDone true ist wird Feedback abgefragt.
if (result == DialogResult.No || bildDone)
{
eingabe = Interaction.InputBox("Welches Feedback möchtest du senden?\n\nFeedback:", "Feedback erstellen", "");
timestamp = DateTime.Now.ToString("dd.MM.yyyy-HH-mm");
// Wenn bildDone wird Bild erstellt und gespeichert.
if (bildDone)
{
if (Clipboard.ContainsImage())
{
using (Image img = Clipboard.GetImage())
{
clone = new Bitmap(img);
bildDateiname = $"feedback-{timestamp}.png";
string bildPath = Path.Combine("N:\\TECHNIK\\Software\\Wirl-Verwaltung\\Feedback", bildDateiname);
//TODO: Warum der falsche Path? Immer mit \\
string tempPath = Path.Combine(Path.GetTempPath(), Path.GetFileName(bildPath));
try
{
clone.Save(tempPath, System.Drawing.Imaging.ImageFormat.Png);
clone.Dispose();
File.Copy(tempPath, bildPath, true);
File.Delete(tempPath);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
else throw new InvalidOperationException("Zwischenablage enthält kein Bild.");
}
}
// Rückgabe an Program.
Program.AddFeedback(user, eingabe, bildDateiname, timestamp);
}
}
}

View File

@ -2,7 +2,7 @@
namespace Deckungsbeitrag.UserControls
{
partial class KundenControl
partial class UCKunde
{
/// <summary>
/// Erforderliche Designervariable.

View File

@ -11,7 +11,7 @@ using System.Windows.Forms;
namespace Deckungsbeitrag.UserControls
{
public partial class KundenControl : UserControl
public partial class UCKunde : UserControl
{
//private Label lblKunde;
//private Label lblRegion;
@ -35,13 +35,13 @@ namespace Deckungsbeitrag.UserControls
}
public int[] ContAnzahl = new int[3];
public KundenControl()
public UCKunde()
{
InitializeComponent();
SetupControl();
}
public KundenControl(Kunde kunde) : this()
public UCKunde(Kunde kunde) : this()
{
KundenName = kunde.Suchtext == string.Empty ? kunde.KundeName : kunde.Suchtext;
KundenRegion = kunde.Region;
@ -62,9 +62,9 @@ namespace Deckungsbeitrag.UserControls
private void KundenControl_MouseDown(object sender, MouseEventArgs e)
{
Control ctr = sender as Control;
KundenControl kundectr;
if (ctr.GetType() == typeof(KundenControl)) kundectr = (KundenControl)ctr;
else kundectr = (KundenControl)ctr.Parent;
UCKunde kundectr;
if (ctr.GetType() == typeof(UCKunde)) kundectr = (UCKunde)ctr;
else kundectr = (UCKunde)ctr.Parent;
this.kunde = (Kunde)kundectr.Tag;
@ -79,7 +79,7 @@ namespace Deckungsbeitrag.UserControls
}
public object Clone()
{
return new KundenControl(this.kunde);
return new UCKunde(this.kunde);
}
private void KundenControl_MouseClick(object sender, MouseEventArgs e)

120
UserControls/UCKunde.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -29,7 +29,7 @@ namespace Deckungsbeitrag.UserControls
// sonst ist Clone.
if (e.Data.GetDataPresent("KundeData")) // Custom Format
e.Effect = DragDropEffects.Copy;
if (e.Data.GetDataPresent(typeof(KundenControl)))
if (e.Data.GetDataPresent(typeof(UCKunde)))
e.Effect = DragDropEffects.Move;
}
@ -40,7 +40,7 @@ namespace Deckungsbeitrag.UserControls
// sonst ist Clone.
if (e.Data.GetDataPresent("KundeData")) // Custom Format
e.Effect = DragDropEffects.Copy;
if (e.Data.GetDataPresent(typeof(KundenControl)))
if (e.Data.GetDataPresent(typeof(UCKunde)))
e.Effect = DragDropEffects.Move;
}
@ -73,7 +73,7 @@ namespace Deckungsbeitrag.UserControls
if (e.Data.GetDataPresent("KundeData"))
{
KundenControl kundectr = e.Data.GetData("KundeData") as KundenControl;
UCKunde kundectr = e.Data.GetData("KundeData") as UCKunde;
Kunde kunde = (Kunde)kundectr.Tag;
if (saison == "Sommer") saisonrhythmus = kunde.SommerLieferRhythmus;
else saisonrhythmus = kunde.WinterLieferRhythmus;
@ -101,7 +101,7 @@ namespace Deckungsbeitrag.UserControls
if (toClone)
{
// Kunde klonen (nicht original bewegen)
KundenControl kundeKopie = (KundenControl)kundectr.Clone();
UCKunde kundeKopie = (UCKunde)kundectr.Clone();
kundeKopie.Tag = kundectr.Tag;
kundeKopie.Parent = dropTarget;
dropTarget.Controls.Add(kundeKopie);
@ -111,9 +111,9 @@ namespace Deckungsbeitrag.UserControls
}
// Move statt Clone KundenControl
if (e.Data.GetDataPresent(typeof(KundenControl)))
if (e.Data.GetDataPresent(typeof(UCKunde)))
{
KundenControl draggedControl = e.Data.GetData(typeof(KundenControl)) as KundenControl;
UCKunde draggedControl = e.Data.GetData(typeof(UCKunde)) as UCKunde;
if (draggedControl == null || dropTarget == null || draggedControl.Parent.Tag != dropTarget.Tag) return;
@ -151,7 +151,7 @@ namespace Deckungsbeitrag.UserControls
{
int[] gesamt = { 0, 0, 0 };
foreach (KundenControl kndctrl in dropTarget.Controls.OfType<KundenControl>())
foreach (UCKunde kndctrl in dropTarget.Controls.OfType<UCKunde>())
{
for (int i = 0; i < Math.Min(kndctrl.ContAnzahl.Length, gesamt.Length); i++)
{
@ -286,9 +286,9 @@ namespace Deckungsbeitrag.UserControls
}
// ★ SPEICHERN nutzt TAG der FlowLayoutPanels ★
public TourenDaten SpeichereDaten()
public TDaten SpeichereDaten()
{
var data = new TourenDaten
var data = new TDaten
{
TourName = this.Parent?.Text ?? "Unbekannt",
FahrerId = ((Benutzer)this.Parent?.Tag).BenutzerID ?? 0
@ -302,16 +302,16 @@ namespace Deckungsbeitrag.UserControls
// Falls für diesen Tag noch keine Liste existiert, anlegen
if (!data.KundenProTag.TryGetValue(tag, out var kundenListe))
{
kundenListe = new List<KundeData>();
kundenListe = new List<KData>();
data.KundenProTag[tag] = kundenListe;
}
// Kunden sammeln
foreach (Control kundeCtrl in flp.Controls)
{
if (kundeCtrl is KundenControl kc)
if (kundeCtrl is UCKunde kc)
{
kundenListe.Add(new KundeData
kundenListe.Add(new KData
{
Name = kc.KundenName,
Region = kc.KundenRegion,
@ -347,7 +347,7 @@ namespace Deckungsbeitrag.UserControls
}
// ★ LADEN TAG der FlowLayoutPanels nutzen ★
public void LadeDaten(TourenDaten data)
public void LadeDaten(TDaten data)
{
// Zuerst alle FlowLayoutPanels leeren
foreach (Control ctrl in tableLayoutPanelTage.Controls)
@ -371,7 +371,7 @@ namespace Deckungsbeitrag.UserControls
foreach (var kundeData in kundenListe) // nur die Kunden dieses Tags
{
Kunde kunde = Kunde.GetKunde(null, kundeData.KundeID, null);
KundenControl kundectrl = new KundenControl(kunde);
UCKunde kundectrl = new UCKunde(kunde);
kundectrl.Tag = kunde;
zielFlp.Controls.Add(kundectrl);
}

View File

@ -8,6 +8,7 @@ public class UserSettingsManager
#region Speicher-Properties
public string DruckerSWS { get; set; } = "";
public string DruckerEtikett { get; set; } = "";
public string DruckerTourenListe { get; set; } = "";
public decimal CopiesSWS { get; set; } = 0;
public Color Hintergrund { get; set; } = Color.Black;
public Color Beladeband { get; set; } = Color.Yellow;
@ -50,6 +51,7 @@ public class UserSettingsManager
{
DruckerSWS = loadedSettings.DruckerSWS;
DruckerEtikett = loadedSettings.DruckerEtikett;
DruckerTourenListe = loadedSettings.DruckerTourenListe;
CopiesSWS = loadedSettings.CopiesSWS;
Hintergrund = loadedSettings.Hintergrund;
Beladeband = loadedSettings.Beladeband;

View File

@ -79,6 +79,9 @@
<Reference Include="Microsoft.Bcl.HashCode, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.HashCode.6.0.0\lib\net462\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.TimeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.TimeProvider.8.0.0\lib\net462\Microsoft.Bcl.TimeProvider.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
@ -89,6 +92,12 @@
<Reference Include="ObjectListView, Version=2.9.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ObjectListView.Updated.2.9.3\lib\net40\ObjectListView.dll</HintPath>
</Reference>
<Reference Include="Polly, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc, processorArchitecture=MSIL">
<HintPath>packages\Polly.8.6.5\lib\net472\Polly.dll</HintPath>
</Reference>
<Reference Include="Polly.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc, processorArchitecture=MSIL">
<HintPath>packages\Polly.Core.8.6.5\lib\net472\Polly.Core.dll</HintPath>
</Reference>
<Reference Include="Spire.Barcode, Version=7.4.1.0, Culture=neutral, PublicKeyToken=663f351905198cb3, processorArchitecture=MSIL">
<HintPath>packages\Spire.Barcode.7.4.1\lib\net48\Spire.Barcode.dll</HintPath>
</Reference>
@ -99,7 +108,12 @@
<Reference Include="System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Collections.Immutable.9.0.0\lib\net462\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
@ -115,6 +129,7 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Printing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
@ -355,7 +370,7 @@
<Compile Include="AA-Klassen\OLVBewertung.cs" />
<Compile Include="AA-Klassen\OLVKundenumsatz.cs" />
<Compile Include="AA-Klassen\Saison.cs" />
<Compile Include="AA-Klassen\TourenDaten.cs" />
<Compile Include="AA-Klassen\Tour.cs" />
<Compile Include="AA-Klassen\WSFach.cs" />
<Compile Include="Config.cs" />
<Compile Include="Program.cs" />
@ -374,11 +389,23 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="UserControls\KundenControl.cs">
<Compile Include="UserControls\UCArtikel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\KundenControl.Designer.cs">
<DependentUpon>KundenControl.cs</DependentUpon>
<Compile Include="UserControls\UCArtikel.Designer.cs">
<DependentUpon>UCArtikel.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\UCFeedback.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\UCFeedback.Designer.cs">
<DependentUpon>UCFeedback.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\UCKunde.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\UCKunde.Designer.cs">
<DependentUpon>UCKunde.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\UCAuftrag.cs">
<SubType>UserControl</SubType>
@ -497,8 +524,14 @@
<EmbeddedResource Include="AA-Forms\FormKundeVW.resx">
<DependentUpon>FormKundeVW.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\KundenControl.resx">
<DependentUpon>KundenControl.cs</DependentUpon>
<EmbeddedResource Include="UserControls\UCArtikel.resx">
<DependentUpon>UCArtikel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\UCFeedback.resx">
<DependentUpon>UCFeedback.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\UCKunde.resx">
<DependentUpon>UCKunde.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\UCAuftrag.resx">
<DependentUpon>UCAuftrag.cs</DependentUpon>

View File

@ -1,124 +1,98 @@
=====================================
NEUIGKEITEN - Version 1.0.5.6
NEUIGKEITEN - Version 1.0.8.0
=====================================
Build-Info:
- Build-Typ: Release Build
- Erledigte TODOs: 18
- Offene TODOs: 32
- Install-Reminders: 3
- Changes: 47
- Erledigte TODOs: 10
- Offene TODOs: 41
- Install-Reminders: 4
- Changes: 19
=== ⚙️ INSTALL-REMINDER (3) ===
=== ⚙️ INSTALL-REMINDER (4) ===
- ⚙️ Change Status in DB-Auftrag von 7 auf 6 [Auftrag.cs]
- ⚙️ Spalte Abteilungen in Auftrag muss in Wirl_DB_17012023 eingefügt werden. [FormExpedit.cs]
- ⚙️ Spalte Reklamation in Wirl_DB_17012023 einfügen [KundeArtikel.cs]
- ⚙️ Tabelle Auftrag_Status muss in DB erstellt werden. [Auftrag.cs]
- ⚙️ Tabelle KundeArtikel Spalten ArtikelID und Reihung hinzufügen. [FormKundeVW.cs]
- ⚙️ Tabelle Tour in Datenbank einfügen [Tour.cs]
=== ✨ CHANGES (47) ===
- ✨ AbteilungsStatus ist implementiert. [FormExpedit.cs]
- ✨ Als zweite Sortierung wird immer der Liefertag gewählt. [FormExpedit.cs]
- ✨ Auftragverwaltung Spalten wurden aktualisiert. Mit Icons, Buttons und Sortierung auf Liefertag. [FormMain.cs]
- ✨ Aus und Einblenden der Nachwäsche möglich. [FormExpedit.cs]
- ✨ Bearbeiten in ObjectListView möglich. (Kundename wird aber zurückgesetzt) [FormExpedit.cs]
- ✨ Bei DoppelClick auf Kundename wird KundenVW geöffnet. [FormExpedit.cs]
- ✨ Chart statt GridView für Fehlmengen. [FormExpedit.cs]
- ✨ ComboBox kann zum Filtern der Kunden verwendet werden. [FormTourenplanung.cs]
- ✨ CSV Datei wird erstellt oder bei jeder Inventur erweitert. (Einfach in Excel importieren und auswerten.) [FormNeuerAuftrag.cs]
- ✨ Datumfilter funktioniert. [FormExpedit.cs]
=== ✨ CHANGES (19) ===
- ✨ Abfragen müssen versucht werden wenn Einträge existieren. (Wieviele Container wurden pro Tag gewaschen?, etc.) [Auftrag.cs]
- ✨ 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]
- ✨ Datum von letztem Import verfügbar. [FormMain.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]
- ✨ Es wird der zuständige Fahrer angezeigt. ToolTip zeigt den Grund falls vorhanden(Bei Sonderzuteilung). [FormExpedit.cs]
- ✨ Expedit hat Button für Reklamation statt Nachwäsche. Dadurch kann Mirka die Reklamation bearbeiten und eingeben. (AKTUELL NUR MIRKA) [FormExpedit.cs]
- ✨ Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren. [FormMain.cs]
- ✨ Form für Aufleger soweit fertig. [FormAufleger.cs]
- ✨ Frottee Expedit alle Buttons werden ausgeblendet. [FormExpedit.cs]
- ✨ Frottee Expedit zeigt Aufträge die bei Frottee nicht Beendet wurden. [FormExpedit.cs]
- ✨ Geschäftaufträge werden in neuem Tab angezeigt. [FormExpedit.cs]
- ✨ GroupBox nicht mehr notwendig. Etikette Druck über ObjectListView. [FormExpedit.cs]
- ✨ Highlightfarbe bleibt auch wenn unfocused. (Farbe ändern?) [FormExpedit.cs]
- ✨ Hintergrundfarbe wird jetzt immer richtig zugewiesen. [FormAufleger.cs]
- ✨ Gespeichert wird AuftragID, Status, Zeitpunkt und User des Changes. [Auftrag.cs]
- ✨ Innerhalb eines Tages kann die Reihenfolge angepasst werden. [UCTabPageLKW.cs]
- ✨ Keine Timer da Probleme mit DB-Connection. DataGridView wird neu geladen wenn Auftrag neu gewählt wird. [FormExpedit.cs]
- ✨ Kontrolle ob mehrere Aufträge vorhanden fertig. [FormAufleger.cs]
- ✨ Kundeneingabe mit ? fügt einmaligen Kundenname als ZusatzInfo hinzu und wählt Kunde BAR DIVERSE 2320000 [FormExpedit.cs]
- ✨ KundeArtikel wird mit Reihung gespeichert und angezeigt. [FormKundeVW.cs]
- ✨ Lieferrhythmen können angepasst und übernommen werden. [UCTabPageLKW.cs]
- ✨ Liefertag errechnet sich jetzt aus dem Lieferrhythmus. Funktion wählt nächstmöglichen Liefertermin im Rhythmus. Bei Klick auf Tag bleibt alles gleich. (Auch mit Heute liefern?) [FormNeuerAuftrag.cs]
- ✨ NeuerAuftrag wird jetzt mit Propertie AuftragTyp aufgerufen. Dadurch ist die Auswahl des AuftragTyp konstanter. [FormNeuerAuftrag.cs]
- ✨ ObjectListView speichert Status automatisch beim schließen des Fensters und läd wieder wenn neu gestartet wird. [FormExpedit.cs]
- ✨ Programm wird mit Button geschlossen. (Sicherheitsabfrage ob wirklich gewollt wird gemacht.) [FormAufleger.cs]
- ✨ Rechtsklick auf Spaltenheader ermöglicht Filtern. [FormExpedit.cs]
- ✨ Saisonauswahl DropDown eingefügt. Wenn Zwischensaison gewählt wir Warnung wegen falschen Liefertagen gezeigt. Sonst wird Saisonrhythmus als Liefertag beachtet. [FormMain.cs]
- ✨ Sortierte Spalte hat leicht andere Farbe. (Besser zu erkennen wonach sortiert wird) [FormExpedit.cs]
- ✨ Speichern und Laden wurde angepasst, JSON enthält jetzt pro Tag eine Kundenliste. [UCTabPageLKW.cs]
- ✨ Status anpassen fertig. [FormAufleger.cs]
- ✨ Suchen eines Auftrags mit Scan möglich. [FormExpedit.cs]
- ✨ TabText wird mit Benutzerliste verglichen. Wenn ein passender gefunden wird Tag hinterlegt. [FormTourenplanung.cs]
- ✨ Wenn BenutzerRolle ist Expedit wird abgefragt ob weitere Reklamation eingegeben wird. [FormFehlmengeCount.cs]
- ✨ Wenn BenutzerRolle ist Expedit wird statt Fehlmenge Reklamation erhöht. [FormFehlmengeCount.cs]
- ✨ Wenn BenutzerRolle ist Fahrer wird Fenster nicht geschlossen sondern mit Kundenauswahl weiter gemacht. [FormNeuerAuftrag.cs]
- ✨ Wenn AuftragStatus geändert wird, wird in der DB gesucht ob bereits ein Eintrag mit AuftragID und Status übereinstimmt. Wenn ja wird ignoriert, sonst wird ein Eintrag erstellt. [Auftrag.cs]
- ✨ Wenn der Lieferrhythmus geändert wird, werden KundenControls an falschen Tagen gelöscht. [UCTabPageLKW.cs]
- ✨ Wenn Doppelklick auf Zelle, wird gefragt ob bearbeiten wirklich gewollt. Sonst wird blockiert. [FormExpedit.cs]
- ✨ Wenn Fahrer Auftrag erstellt wird beim Speichern standardmäßig seine ID als ArbeiterID gespeichert. Bedeutet ausführender = Fahrer selber. [FormNeuerAuftrag.cs]
- ✨ Wenn HEUTE als Liefertag gewählt, kommt Frage ob heute oder in einer Woche. Wenn JA dann HEUTE. [FormExpedit.cs]
- ✨ Winter und Sommer wird getrennt geändert und gespeichert. [UCTabPageLKW.cs]
=== ✅ ERLEDIGTE TODOs (18) ===
=== ✅ ERLEDIGTE TODOs (10) ===
- ✅ : Auftrag über FormListe holen und daraus den Kunden für Fehlmenge holen. [FormFehlmengeCount.cs]
- ✅ : Bei Transport wir ein Fach mit Aktuellem Auftrag erstellt. Das Alte wird bei Transport gespeichert. [FormAusschlager.cs]
- ✅ : Einmalige Kunden für Geschäft ermöglichen [FormExpedit.cs]
- ✅ : Etikett Drucken als Button in Row. Dann Vorschau anzeigen und Drucken. [FormExpedit.cs]
- ✅ : Etikett GroupBox entfernen. Änderungen direkt in ObjectListView vornehmen PrintPreview für Etikett. [FormExpedit.cs]
- ✅ : Fehler wenn FormListe mit X geschlossen wird und Kunde null ist wurde behoben. [FormNeuerAuftrag.cs]
- ✅ : Filter für Regionen ermöglichen. [FormTourenplanung.cs]
- ✅ : Logik überlegen wie ein bearbeiteter Auftrag nicht doppelt gewählt werden kann. (Abteilungen zu Auftrag hinzufügen und bei Ausschlager Druck definieren?) [FormFehlmengeCount.cs]
- ✅ : Max Clones von PanelKunde zu PanelTourenplanung. (Lieferrythmus eingeben?) [FormTourenplanung.cs]
- ✅ : Mit AddFehler können Fehler aus try/chatch in Obsidian eingefügt werden. (Timestamp, PC-Name, Ex-Message) [Program.cs]
- ✅ : Neue Aufgabe Screen erstellen. [FormNeueAufgabe.cs]
- ✅ : Nur die Kunden der Aufträge als Liste anzeigen wäre möglich. Macht die Auswahl für das Personal einfacher weil 90% bereits weg fallen. [FormFehlmengeCount.cs]
- ✅ : Speichern der Touren ermöglichen. Eventuell über .json oder .xml Datei? [FormTourenplanung.cs]
- ✅ : StartUp von Expedit verfeinern. [FormExpedit.cs]
- ✅ : Testen ob umbenennen funktioniert. [FormTourenplanung.cs]
- ✅ : Wenn der Lieferrhythmus geändert wurde müssen alle Clone von falschen Tagen gelöscht werden. [FormTourenplanung.cs]
- ✅ : Wenn Fahrer einen Auftrag an Kollege übergibt? [FormNeuerAuftrag.cs]
- ✅ : Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten) [FormExpedit.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 NeuerAuftrag gewählt Fach ändern nicht vergessen. [FormAusschlager.cs]
- ✅ : Wenn NeuerAuftrag gewählt wie gehts weiter? [FormAusschlager.cs]
=== 🔄 OFFENE TODOs (32) ===
=== 🔄 OFFENE TODOs (41) ===
- 🔄 !!Ü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. [Tour.cs]
- 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [FormExpedit.cs]
- 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [FormMain.cs]
- 🔄 Artikel Update weiter testen und programmieren. Für ArtikelKurzliste ausprogrammieren. [FormMain.cs]
- 🔄 ArbeiterID muss gefunden werden. Eventuell suche Aufträge mit Kunden am selben Liefertag und Region. [FormNeuerAuftrag.cs]
- 🔄 Auftrag Schnellerfassung erstellen. Kundenliste aus JSON in OLV einfügen wenn schmutzig > 0 dann Auftrag erstellen. Spalten: "Kunde, schmutzig, liefertag, zustellfahrer" evnetuell in AuftragVW? [FormMain.cs]
- 🔄 Auftragauswahl aufrufen statt NeuerAuftrag. (Wenn Fahrer Aufträge erstellen) [FormWSVerfolgung.cs]
- 🔄 Aufträge zusammenführen wenn gleicher Kunde und Liefertag. [FormNeuerAuftrag.cs]
- 🔄 Auftragliste bei Fahrer anzeigen wenn Login. [FormMain.cs]
- 🔄 Ausprobieren ob die Ausrichtung jetzt richtig ist. Sowohl beim ersten wie auch zweiten Mal. [Funktionen.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. [KundenControl.cs]
- 🔄 Einkommentieren wenn ArtikelUpdate auf ArtikelKurzliste umgestellt werden kann. [FormMain.cs]
- 🔄 Design des Controls anpassen. Eventuell im Designer erstellen. [UCKunde.cs]
- 🔄 Eingabemöglichkeit von Tour Start und Ende muss erledigt werden. [Tour.cs]
- 🔄 Eventuell auch andere ListViews einbinden? [Funktionen.cs]
- 🔄 Form AuftragDetail muss überarbeitet werden. [FormNeuerAuftrag.cs]
- 🔄 Funktioniert mehrere KundenControls auf einmal DragDrop? [FormTourenplanung.cs]
- 🔄 für Ladescreen den Progressbar programieren. (perplexity fragen wie der Status an einen anderen Screen übergeben werden kann) [FormMain.cs]
- 🔄 Gesamt soll immer 100% sein. [Funktionen.cs]
- 🔄 Grund immer abfragen oder nur wenn Fahrer die Zuteilung ändert? [FormNeuerAuftrag.cs]
- 🔄 Hier Settings speichern mit UserSettingsManager Klasse. [FormEinstellung.cs]
- 🔄 JSON nach angemeldeten Fahrer durchsuchen und Kundenliste des aktuellen Wochentag anzeigen. [FormMain.cs]
- 🔄 LadenScreen anzeigen etc. [FormMain.cs]
- 🔄 Kundenanzahl bei Tourenliste erstellen vergleichen und anpassen. [Tour.cs]
- 🔄 Mit AddFehler in Obsidian eine Fehlerliste betreiben. (Wichtige Infos feststellen und bereitstellen) [Program.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]
- 🔄 OLV State speichern. [FormExpedit.cs]
- 🔄 Reg.Aufträge einbauen. Besonderheit: Die Artikel sollen ebenfalls erscheinen. [Funktionen.cs]
- 🔄 Reihenfolge Spalten richtig stellen. [FormExpedit.cs]
- 🔄 Settings hier ändern auf UserSettingsManager Klasse. [FormEinstellung.cs]
- 🔄 Soll hier ebenfalls der nächste Liefertag laut Rhythmus vorgeschlagen werden? [FormExpedit.cs]
- 🔄 Testen ob Get_ArtikelKurzliste funktioniert. [FormMain.cs]
- 🔄 Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten) [FormExpedit.cs]
- 🔄 Testen ob SWS-QRCodes gelesen werden können. Nur notwendig bis alle SWS-QRCodes richtig gedruckt und gelesen werden. [Kunde.cs]
- 🔄 TourenListe Entwurf muss überarbeitet werden. [FormNeuerAuftrag.cs]
- 🔄 Umbau in Switch. [FormAufleger.cs]
- 🔄 Umbau in Switch. [FormWSVerfolgung.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]
- 🔄 Wenn Frottee-Expedit auch Relamation bearbeitet, muss BenutzerRolle abgefragt werden. siehe CHANGES. [FormFehlmengeCount.cs]
- 🔄 Wenn kunde null dann return. [FormNeuerAuftrag.cs]
- 🔄 Wenn Nachwäsche oder Müllwäsche alle Artikel anzeigen. [FormFehlmengeCount.cs]
- 🔄 Wenn RegAuftrag wird als augeliefert markiert, wird dieser automatisch neu erstellt laut hinterlegtem Rhythmus. [FormMain.cs]
- 🔄 Zuweisung zu Fahrer muss geklärt werden. [Funktionen.cs]
Installation: 17.02.2026 18:05
Installation: 06.03.2026 16:39
=====================================