Neue Inventur implementiert und Berechnung der Zahlen für ALLE Sonderaufträge kontrolliert. ALTE Inventur entfernt. FormExpedit Zugang zu Kundendetails mittels Button implementiert. Bearbeiten der Datensätze implementiert, Div.andere Änderungen

This commit is contained in:
Kilian Wirl 2026-05-28 12:47:53 +02:00
parent 58f97db2ad
commit 7e25ee150a
25 changed files with 1372 additions and 726 deletions

View File

@ -31,6 +31,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormArtikelVW));
this.objectListViewArtikel = new BrightIdeasSoftware.ObjectListView();
this.fLPSuche = new System.Windows.Forms.FlowLayoutPanel();
this.textBoxSuchen = new System.Windows.Forms.TextBox();
this.comboBoxArtikel = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.objectListViewArtikel)).BeginInit();
this.fLPSuche.SuspendLayout();
@ -64,10 +65,12 @@
this.objectListViewArtikel.ButtonClick += new System.EventHandler<BrightIdeasSoftware.CellClickEventArgs>(this.ObjectListViewArtikel_ButtonClick);
this.objectListViewArtikel.CellEditFinished += new BrightIdeasSoftware.CellEditEventHandler(this.ObjectListViewArtikel_CellEditFinished);
this.objectListViewArtikel.CellEditStarting += new BrightIdeasSoftware.CellEditEventHandler(this.ObjectListViewArtikel_CellEditStarting);
this.objectListViewArtikel.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ObjectListViewArtikel_MouseDoubleClick);
this.objectListViewArtikel.Resize += new System.EventHandler(this.ObjectListViewArtikel_Resize);
//
// fLPSuche
//
this.fLPSuche.Controls.Add(this.textBoxSuchen);
this.fLPSuche.Controls.Add(this.comboBoxArtikel);
this.fLPSuche.Dock = System.Windows.Forms.DockStyle.Left;
this.fLPSuche.Location = new System.Drawing.Point(0, 0);
@ -75,13 +78,26 @@
this.fLPSuche.Size = new System.Drawing.Size(264, 610);
this.fLPSuche.TabIndex = 1;
//
// textBoxSuchen
//
this.textBoxSuchen.Dock = System.Windows.Forms.DockStyle.Top;
this.textBoxSuchen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxSuchen.ForeColor = System.Drawing.SystemColors.AppWorkspace;
this.textBoxSuchen.Location = new System.Drawing.Point(3, 3);
this.textBoxSuchen.Name = "textBoxSuchen";
this.textBoxSuchen.Size = new System.Drawing.Size(261, 30);
this.textBoxSuchen.TabIndex = 1;
this.textBoxSuchen.Text = "Suchtext eingeben";
this.textBoxSuchen.Click += new System.EventHandler(this.TextBoxSuchen_Click);
this.textBoxSuchen.TextChanged += new System.EventHandler(this.TextBoxSuchen_TextChanged);
this.textBoxSuchen.Enter += new System.EventHandler(this.TextBoxSuchen_Enter);
//
// comboBoxArtikel
//
this.comboBoxArtikel.Dock = System.Windows.Forms.DockStyle.Top;
this.comboBoxArtikel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxArtikel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxArtikel.FormattingEnabled = true;
this.comboBoxArtikel.Location = new System.Drawing.Point(3, 3);
this.comboBoxArtikel.Location = new System.Drawing.Point(3, 39);
this.comboBoxArtikel.Name = "comboBoxArtikel";
this.comboBoxArtikel.Size = new System.Drawing.Size(261, 33);
this.comboBoxArtikel.TabIndex = 0;
@ -103,6 +119,7 @@
this.Load += new System.EventHandler(this.FormArtikelVW_Load);
((System.ComponentModel.ISupportInitialize)(this.objectListViewArtikel)).EndInit();
this.fLPSuche.ResumeLayout(false);
this.fLPSuche.PerformLayout();
this.ResumeLayout(false);
}
@ -112,5 +129,6 @@
private BrightIdeasSoftware.ObjectListView objectListViewArtikel;
private System.Windows.Forms.FlowLayoutPanel fLPSuche;
private System.Windows.Forms.ComboBox comboBoxArtikel;
private System.Windows.Forms.TextBox textBoxSuchen;
}
}

View File

@ -20,7 +20,11 @@ namespace Deckungsbeitrag
{
private readonly Benutzer user;
private List<Artikel> artikelList;
private AuftragTyp auftragTyp;
private int dropdownWidth;
public Timer timer;
public Artikel artikel;
public FormArtikelVW()
{
InitializeComponent();
@ -29,9 +33,16 @@ namespace Deckungsbeitrag
{
this.user = benutzer;
}
public FormArtikelVW(Benutzer benutzer, AuftragTyp typ) : this(benutzer)
{
this.auftragTyp = typ;
this.comboBoxArtikel.Enabled = false;
}
private void FormArtikelVW_Load(object sender, EventArgs e)
{
timer = new Timer();
timer.Interval = 700; // 0,7 Sekunden
timer.Tick += Lade_TmpList;
List<Artikel> artlist = Artikel.GetArtikelList("Nachwaesche");
this.comboBoxArtikel.SelectedIndexChanged -= ComboBoxArtikel_SelectedIndexChanged;
@ -47,10 +58,22 @@ namespace Deckungsbeitrag
this.comboBoxArtikel.SelectedIndexChanged += ComboBoxArtikel_SelectedIndexChanged;
OLV_Load_with_Artikel();
}
#region ObjectListView
private void ObjectListViewArtikel_MouseDoubleClick(object sender, MouseEventArgs e)
{
ObjectListView olv = (ObjectListView)sender;
if (olv.SelectedObjects.Count == 0 || olv.SelectedObjects.Count > 1) return;
if (olv.SelectedObject is NachwaescheArtikelData nwArtikel)
{
artikel = Artikel.GetArtikel(null, nwArtikel.ArtikelID);
this.DialogResult = DialogResult.OK;
this.Close();
}
}
private void OLV_GroupCount()
{
@ -73,7 +96,7 @@ namespace Deckungsbeitrag
/// </summary>
private void OLV_Load_with_Artikel()
{
if (this.user.Rolle == BenutzerRolle.Expedit || this.user.Rolle == BenutzerRolle.Frottee || this.user.Rolle == BenutzerRolle.Master)
if (this.user.Rolle == BenutzerRolle.Expedit || this.user.Rolle == BenutzerRolle.Frottee || this.user.Rolle == BenutzerRolle.Master || this.auftragTyp == AuftragTyp.SOLL_Erhoehung)
{
//TODO: Einbinden der NachwaescheArtikelData...
Generator.GenerateColumns(this.objectListViewArtikel, typeof(NachwaescheArtikelData));
@ -92,6 +115,7 @@ namespace Deckungsbeitrag
Kategorie = art.Kategorie
});
}
this.objectListViewArtikel.Tag = NWArtikelList;
this.objectListViewArtikel.Font = new Font(this.objectListViewArtikel.Font.FontFamily, 16, FontStyle.Regular);
this.objectListViewArtikel.SetObjects(NWArtikelList);
this.objectListViewArtikel.PrimarySortColumn = (OLVColumn)this.objectListViewArtikel.AllColumns[6];
@ -266,6 +290,48 @@ namespace Deckungsbeitrag
{
this.ClientSize = new Size(this.objectListViewArtikel.Width + this.objectListViewArtikel.Left, this.ClientSize.Height);
}
private void TextBoxSuchen_TextChanged(object sender, EventArgs e)
{
// TextChanged tritt nur ein wenn x Sekunden keine Eingabe erfolgt. Logik befindet sich in Timer_Tick
timer.Stop(); // Alten Timer beenden
timer.Start(); // Neuen Timer starten
}
private void Lade_TmpList(object sender, EventArgs e)
{
timer.Stop(); // Timer stoppen
if (string.IsNullOrWhiteSpace(this.textBoxSuchen.Text)) return;
if (!this.textBoxSuchen.Text.StartsWith("?"))
{
string term = this.textBoxSuchen.Text.Trim().ToLower();
if (this.objectListViewArtikel.Tag == null) return;
if (this.objectListViewArtikel.Tag is List<NachwaescheArtikelData> _allItems)
{
var filtered = string.IsNullOrWhiteSpace(term)
? _allItems : _allItems.Where(x =>
(x.ArtName != null && x.ArtName.ToLower().Contains(term)) ||
(x.Short != null && x.Short.ToLower().Contains(term)) ||
x.ArtNummer.ToString().Contains(term)).ToList();
this.objectListViewArtikel.SetObjects(filtered);
}
}
}
private void TextBoxSuchen_Enter(object sender, EventArgs e)
{
this.textBoxSuchen.ForeColor = Color.Black;
this.textBoxSuchen.Select(0, this.textBoxSuchen.Text.Length);
//this.textBoxSuchen.Clear();
}
private void TextBoxSuchen_Click(object sender, EventArgs e)
{
this.textBoxSuchen.SelectAll();
}
}
}
//CHANGES: Reklamation als Spalte hinzugefügt und Anzeigen implementiert. Sowohl bei KundeArtikel als auch bei NW_Artikel.

View File

@ -25,11 +25,14 @@ namespace Deckungsbeitrag
}
private void FormAufgabeVW_Load(object sender, EventArgs e)
{
Load_OLV();
}
private void Load_OLV()
{
try
{
list = new List<object>(Aufgabe.GetList(null));
Load_OLV(list);
}
catch (Exception ex)
{
@ -37,9 +40,6 @@ namespace Deckungsbeitrag
this.Close();
}
}
private void Load_OLV(List<object> list)
{
Generator.GenerateColumns(this.objectListViewAufgabe, typeof(Aufgabe), true);
this.objectListViewAufgabe.SetObjects(list);
OLVColumn sortcolumn = (OLVColumn)this.objectListViewAufgabe.Columns[1];
@ -69,6 +69,7 @@ namespace Deckungsbeitrag
{
FormNeueAufgabe neueAufgabe = new FormNeueAufgabe();
neueAufgabe.ShowDialog();
Load_OLV();
}
private void objectListViewAufgabe_SubItemChecking(object sender, SubItemCheckingEventArgs e)
{

View File

@ -1,5 +1,6 @@
using BrightIdeasSoftware;
using DatenDB;
using Deckungsbeitrag.AA_Klassen;
using Deckungsbeitrag.UserControls;
using System;
using System.Collections.Generic;
@ -27,7 +28,6 @@ namespace Deckungsbeitrag
public Benutzer benutzer;
public List<AuftragArtikel> artikelList;
public Meldungen meldung = new Meldungen();
private UCInventur uci;
private UCFeedback fb;
public Kunde kunde;
private int diff = 0;
@ -55,6 +55,8 @@ namespace Deckungsbeitrag
//WENN AUFTRAG ABZUSCHLIESSEN
private bool _toclose = false;
private List<KundeArtikel> kndartListe;
public bool Toclose
{
get { return _toclose; }
@ -82,6 +84,10 @@ namespace Deckungsbeitrag
this.benutzer = benutzer;
}
public FormAuftragDetail(Auftrag auftrag, Benutzer benutzer, List<KundeArtikel> kndartListe) : this(auftrag, benutzer)
{
this.kndartListe = kndartListe;
}
private void FormAuftragDetail_Load(object sender, EventArgs e)
{
@ -89,7 +95,7 @@ namespace Deckungsbeitrag
this.Text = this.auftrag.Typ.ToString() + "-Auftrag";
this.kunde = Kunde.GetKunde(string.Empty, auftrag.KundeID, string.Empty);
this.dTPLiefertag.Value = auftrag.Liefertag;
this.dTPLiefertag.Value = auftrag.Liefertag < DateTime.Today ? DateTime.Today.Date.AddDays(1) : auftrag.Liefertag;
this.labelKundeName.Text = string.IsNullOrWhiteSpace(this.kunde.Suchtext) ? this.kunde.KundeName : this.kunde.Suchtext;
this.labelRegion.Text = this.kunde.Region;
this.labelContainer.Text = auftrag.ContainerClean.ToString();
@ -120,7 +126,11 @@ namespace Deckungsbeitrag
break;
case AuftragTyp.SOLL_Erhoehung: Load_OLV();
break;
case AuftragTyp.IST_Erhoehung: Load_OLV();
case AuftragTyp.IST_Erhoehung:
{
if (this.kndartListe == null) Load_OLV();
else Load_NWAusgleich();
}
break;
case AuftragTyp.SOLL_Verminderung: Load_OLV();
break;
@ -138,6 +148,30 @@ namespace Deckungsbeitrag
if (this.oLVArtikel.Items.Count == this.oLVArtikel.CheckedItems.Count) Toclose = true;
}
private void Load_NWAusgleich()
{
Generator.GenerateColumns(this.oLVArtikel, typeof(KundeArtikel), true);
this.oLVArtikel.SetObjects(kndartListe);
foreach (OLVColumn column in this.oLVArtikel.AllColumns)
{
switch (column.AspectName)
{
case var t when t == "Korrektur":
column.IsEditable = true;
break;
case var t when t == "Reihung":
this.oLVArtikel.Sort(column);
break;
default:
column.IsEditable = false;
break;
}
}
this.oLVArtikel.ShowGroups = false;
this.oLVArtikel = Funktionen.Columns_Resize(null, this.oLVArtikel).olv;
}
private void Load_UCInventur(Auftrag _auftrag)
{
Point loc = this.oLVArtikel.Location;
@ -151,12 +185,6 @@ namespace Deckungsbeitrag
if (invFiles.Length == 0) return;
if (invFiles.Length > 1) { MessageBox.Show("Es wurden mehr Inventuren gefunden. Besprich das mit deinem Vorgesetzten.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
string[] lines = File.ReadAllLines(Path.Combine(loadPath, invFiles[0]), Encoding.UTF8);
uci = new UCInventur(lines, this.benutzer, this);
uci.Visible = false;
uci.SizeChangedForParent += () => { DoResize(); };
this.Controls.Add(uci);
}
private void Load_OLV()
{
@ -177,21 +205,6 @@ namespace Deckungsbeitrag
this.textBoxZusatz.Location = new Point(this.label1.Left, this.label1.Bottom);
this.textBoxZusatz.Size = new Size(this.oLVArtikel.Width, this.oLVArtikel.Height - 20);
}
private void DoResize()
{
if (uci != null)
{
uci.Location = this.oLVArtikel.Location = new Point(this.oLVArtikel.Location.X, fb.Bottom + 2);
uci.Visible = true;
this.ClientSize = new Size(uci.Right, uci.Bottom + buttonAbbrechen.Height + 25);
}
else
{
this.oLVArtikel.Height = this.textBoxZusatz.Bottom - this.oLVArtikel.Top;
this.ClientSize = new Size(oLVArtikel.Right + 10, oLVArtikel.Bottom + buttonAbbrechen.Height + 25);
}
if (fb != null) fb.Location = new Point(this.ClientSize.Width - fb.Width - 7, 0);
}
private void LadeComboBoxen()
{
this.comboBoxFahrer.SelectedValueChanged -= ComboBox_SelectedValueChanged;
@ -224,49 +237,102 @@ namespace Deckungsbeitrag
auftrag.ZusatzInfo = this.textBoxZusatz.Text;
auftrag.Save();
if (auftrag.Typ <= AuftragTyp.Regelmäßig && (auftrag.Typ >= AuftragTyp.Inventur) && auftrag.Status == AuftragStatus.Herrichten)
if (auftrag.Status == AuftragStatus.Herrichten)
{
foreach (var kvp in auftragDictionary)
switch (auftrag.Typ)
{
AuftragArtikel aufart = AuftragArtikel.GetArtikel(kvp.Key);
aufart.Anzahl = (int)kvp.Value;
if (aufart.Anzahl == 0) aufart.Erledigt = true;
else { aufart.Erledigt = false; Toclose = false; }
aufart.Save();
}
case AuftragTyp.Geschäft:
break;
case AuftragTyp.Standart:
break;
case AuftragTyp.Inventur:
{
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
if (auftrag.Typ == AuftragTyp.Inventur)
{
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
if (kndart.Korrektur > 0 & kvp.Value[3] > 0)
{
kndart.Korrektur -= kvp.Value[3];
kndart.KorrekturBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
kndart.Save();
}
}
break;
case AuftragTyp.SOLL_Verminderung:
{
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
if (kndart.Reklamation != kvp.Value[0])
{
kndart.Reklamation = kvp.Value[0];
kndart.ReklamationBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
if (kndart.Stand > 0 & kvp.Value[2] < 0)
{
kndart.Stand += kvp.Value[2];
kndart.StandBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
kndart.Save();
}
goto default;
}
if (kndart.Fehlmenge != kvp.Value[1])
case AuftragTyp.SOLL_Erhoehung:
{
kndart.Fehlmenge = kvp.Value[1];
kndart.FehlmengeBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (kndart.Stand != kvp.Value[2])
{
kndart.Stand = kvp.Value[2];
kndart.StandBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (kndart.Korrektur != kvp.Value[3])
{
kndart.Korrektur = kvp.Value[3];
kndart.KorrekturBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
kndart.Save();
}
WriteToCSV(dictionary);
if (kndart.Stand > 0 & kvp.Value[2] > 0)
{
kndart.Stand += kvp.Value[2];
kndart.StandBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
kndart.Save();
}
goto default;
}
case AuftragTyp.IST_Erhoehung:
{
foreach (var kvp in dictionary)
{
KundeArtikel kndart = KundeArtikel.GetItem(kvp.Key);
if (kndart.Reklamation > 0 & kvp.Value[0] > 0)
{
kndart.Reklamation -= kvp.Value[0];
kndart.ReklamationBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (kndart.Fehlmenge > 0 & kvp.Value[1] > 0)
{
kndart.Fehlmenge -= kvp.Value[1];
kndart.FehlmengeBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (kndart.Stand > 0 & kvp.Value[2] > 0)
{
kndart.Stand += kvp.Value[2];
kndart.StandBearbeitet = this.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
kndart.Save();
}
goto default;
}
default:
{
if (auftragDictionary.Count > 0)
{
foreach (var kvp in auftragDictionary)
{
AuftragArtikel aufart = AuftragArtikel.GetArtikel(kvp.Key);
aufart.Anzahl = (int)kvp.Value;
if (aufart.Anzahl == 0) aufart.Erledigt = true;
else { aufart.Erledigt = false; Toclose = false; }
aufart.Save();
}
}
}
break;
}
}
Tosave = false;
}
//SCHMUTZWÄSCHESCHEIN DRUCKEN
@ -354,6 +420,18 @@ namespace Deckungsbeitrag
//AUFTRAG ABSCHLIESSEN
private void ButtonFertig_Click(object sender, EventArgs e)
{
if (this.kndartListe != null)
{
foreach (OLVListItem item in this.oLVArtikel.Items)
{
KundeArtikel kndart = (KundeArtikel)item.RowObject;
if (kndart.Korrektur == 0) continue;
int oldValue = kndart.Korrektur;
int newValue = 0;
ChangeAnzahl(newValue, oldValue, kndart);
}
}
if (zahlenChanged) EtikettDrucken();
if (Tosave && etikettgedruckt || Tosave && !zahlenChanged) AuftragSpeichern();
else Toclose = false;
@ -370,6 +448,7 @@ namespace Deckungsbeitrag
meldung.NoCleanContainer();
return;
case AuftragTyp.Inventur:
Program.InventurFertig(this.auftrag);
break;
case AuftragTyp.SOLL_Erhoehung:
break;
@ -382,6 +461,8 @@ namespace Deckungsbeitrag
return;
case AuftragTyp.Laufzettel:
break;
case AuftragTyp.IST_Erhoehung:
break;
default:
break;
}
@ -562,65 +643,46 @@ namespace Deckungsbeitrag
btn.FlatAppearance.BorderColor = Color.White;
this.Controls.Add(fb);
fb.BringToFront();
if (uci != null)
{
uci.Location = this.oLVArtikel.Location = new Point(this.oLVArtikel.Location.X, fb.Bottom + 2);
uci.Visible = true;
this.ClientSize = new Size(uci.Right, uci.Bottom + buttonAbbrechen.Height + 25);
}
else
{
int width = 0;
foreach (OLVColumn col in this.oLVArtikel.Columns) width += col.Width;
if (this.oLVArtikel.Scrollable) width += Program.scrollBar;
this.oLVArtikel.Width = width;
this.oLVArtikel.Height = textBoxZusatz.Bottom;
//AdjustHeightToFitAll(this.oLVArtikel);
this.buttonAbbrechen.Location = new Point(this.buttonAbbrechen.Left, this.oLVArtikel.Bottom + 15);
this.buttonFertig.Location = new Point(this.buttonFertig.Left, this.oLVArtikel.Bottom + 15);
this.buttonKundeInfo.Location = new Point(20, this.buttonAbbrechen.Top);
if (this.oLVArtikel.Visible) this.ClientSize = new Size(oLVArtikel.Right + 10, buttonAbbrechen.Bottom + 10);
else this.ClientSize = new Size(textBoxZusatz.Right + 10, pictureBoxDirtPlus.Bottom + 10 + buttonAbbrechen.Height + 20);
}
int width = 0;
foreach (OLVColumn col in this.oLVArtikel.Columns) width += col.Width;
if (this.oLVArtikel.Scrollable) width += Program.scrollBar;
this.oLVArtikel.Width = width;
this.oLVArtikel.Height = textBoxZusatz.Bottom;
//AdjustHeightToFitAll(this.oLVArtikel);
this.buttonAbbrechen.Location = new Point(this.buttonAbbrechen.Left, this.oLVArtikel.Bottom + 15);
this.buttonFertig.Location = new Point(this.buttonFertig.Left, this.oLVArtikel.Bottom + 15);
this.buttonKundeInfo.Location = new Point(20, this.buttonAbbrechen.Top);
if (this.oLVArtikel.Visible) this.ClientSize = new Size(oLVArtikel.Right + 10, buttonAbbrechen.Bottom + 10);
else this.ClientSize = new Size(textBoxZusatz.Right + 10, pictureBoxDirtPlus.Bottom + 10 + buttonAbbrechen.Height + 20);
if (fb != null) fb.Location = new Point(this.ClientSize.Width - fb.Width - 7, 0);
while (this.Right > Screen.PrimaryScreen.WorkingArea.Width)
{
this.Width--;
}
//if (oLVArtikel != null) this.ClientSize = new Size(oLVArtikel.Right + 10, oLVArtikel.Bottom + buttonAbbrechen.Height + 25);
if (oLVArtikel != null) this.ClientSize = new Size(oLVArtikel.Right + 10, oLVArtikel.Bottom + buttonAbbrechen.Height + 25);
}
private void AdjustHeightToFitAll(ObjectListView olv)
{
//TODO: HEIGHT SO EINSTELLEN, DASS ALLE ITEMS SICHTBAR SIND.
if (olv.Items.Count == 0)
{
olv.Visible = false;
//olv.Height = olv.HeaderControl?.ClientRectangle.Height ?? 0;
return;
}
int rowHeight = olv.RowHeightEffective; // Standard oder gesetzt
int headerHeight = olv.HeaderControl?.ClientRectangle.Height ?? 0;
int totalHeight = headerHeight + (olv.Items.Count * rowHeight);
// Optional: Header berücksichtigen, wenn View=Details
olv.Height = totalHeight;
}
private void ChangeAnzahl(int newValue, int oldvalue, AuftragArtikel auftragArtikel)
private void ChangeAnzahl(int newValue, int oldvalue, object _artikel)
{
KundeArtikel kndart;
if (this.auftrag.Typ == AuftragTyp.SOLL_Verminderung) if (newValue > 0) newValue *= -1;
diff = oldvalue - (newValue);
if (diff != 0) Tosave = true;
if (auftragDictionary.TryGetValue((int)auftragArtikel.AuftragArtikelID, out int val))
if (_artikel is AuftragArtikel auftragArtikel)
{
auftragDictionary[(int)auftragArtikel.AuftragArtikelID] = newValue;
//if (newValue == 0) e.ListViewItem.Checked = true;
}
else auftragDictionary.Add((int)auftragArtikel.AuftragArtikelID, newValue);
if (auftragDictionary.TryGetValue((int)auftragArtikel.AuftragArtikelID, out int val))
{
auftragDictionary[(int)auftragArtikel.AuftragArtikelID] = newValue;
//if (newValue == 0) e.ListViewItem.Checked = true;
}
else auftragDictionary.Add((int)auftragArtikel.AuftragArtikelID, newValue);
KundeArtikel kndart = KundeArtikel.GetKundeArtikelVonArtikelID(this.kunde.KundeID, auftragArtikel.ArtikelID);
kndart = KundeArtikel.GetKundeArtikelVonArtikelID(this.kunde.KundeID, auftragArtikel.ArtikelID);
}
else kndart = (KundeArtikel)_artikel;
int reklamation = kndart.Reklamation;
int fehlmenge = kndart.Fehlmenge;
@ -650,6 +712,13 @@ namespace Deckungsbeitrag
this.SuspendLayout();
ObjectListView olv = (ObjectListView)sender;
if (e.RowObject is KundeArtikel)
{
if (e.Value != e.NewValue) zahlenChanged = true;
this.ResumeLayout();
this.Cursor = Cursors.Default;
return;
}
AuftragArtikel auftragArtikel = (AuftragArtikel)e.RowObject;
int newValue = (int)e.NewValue;
int oldValue = (int)e.Value;
@ -684,8 +753,8 @@ namespace Deckungsbeitrag
//}
//else dictionary.Add((int)kndart.KundeArtikelID, bestand);
////WriteToCSV(kndart);
//this.ResumeLayout();
//this.Cursor = Cursors.Default;
this.ResumeLayout();
this.Cursor = Cursors.Default;
}
public void KorrigiereBestand(int diff, ref int reklamation, ref int fehlmenge, ref int stand, ref int korrektur)
@ -726,7 +795,7 @@ namespace Deckungsbeitrag
}
case AuftragTyp.SOLL_Verminderung:
{
if (diff > 0) { MessageBox.Show("Eine SOLL-Verminderung kann keine positiven Zahlen haben. Bitte korrigiere die Zahlen.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Stop ); return; }
if (diff > 0) { diff *= -1; }
bestand[2] = diff;
stand += diff;
}
@ -754,6 +823,8 @@ namespace Deckungsbeitrag
if (rest > 0)
stand += rest;
bestand[2] = rest;
// 4) Wenn kein Rest dann Korrektur auf null
if (rest == 0) korrektur = bestand[3] = rest;
}
break;
}

View File

@ -35,7 +35,7 @@
System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormExpedit));
this.buttonNeuerAuftrag = new System.Windows.Forms.Button();
this.buttonSuchen = new System.Windows.Forms.Button();
this.buttonGetKundeVW = new System.Windows.Forms.Button();
this.buttonReklamation = new System.Windows.Forms.Button();
this.buttonSWS_Drucken = new System.Windows.Forms.Button();
this.chartFehlmenge = new System.Windows.Forms.DataVisualization.Charting.Chart();
@ -56,10 +56,10 @@
this.containerSauberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.containerSchmutzigToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tourToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.auftraginfoAnsehenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aufgabeErledigtToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.auftragVerschiebenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.auftragLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.auftraginfoAnsehenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabPageSonder = new System.Windows.Forms.TabPage();
this.objectListViewSonder = new BrightIdeasSoftware.ObjectListView();
this.tabPageGeschaeft = new System.Windows.Forms.TabPage();
@ -106,23 +106,23 @@
this.buttonNeuerAuftrag.UseVisualStyleBackColor = false;
this.buttonNeuerAuftrag.Click += new System.EventHandler(this.ButtonNeuerAuftrag_Click);
//
// buttonSuchen
// buttonGetKundeVW
//
this.buttonSuchen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonSuchen.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonSuchen.BackColor = System.Drawing.Color.DarkOrange;
this.buttonSuchen.FlatAppearance.BorderSize = 0;
this.buttonSuchen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSuchen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSuchen.ForeColor = System.Drawing.Color.Black;
this.buttonSuchen.Location = new System.Drawing.Point(284, 649);
this.buttonSuchen.Margin = new System.Windows.Forms.Padding(2);
this.buttonSuchen.Name = "buttonSuchen";
this.buttonSuchen.Size = new System.Drawing.Size(200, 41);
this.buttonSuchen.TabIndex = 63;
this.buttonSuchen.Text = "Auftrag Suchen";
this.buttonSuchen.UseVisualStyleBackColor = false;
this.buttonSuchen.Click += new System.EventHandler(this.ButtonSuchen_Click);
this.buttonGetKundeVW.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonGetKundeVW.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonGetKundeVW.BackColor = System.Drawing.Color.DarkOrange;
this.buttonGetKundeVW.FlatAppearance.BorderSize = 0;
this.buttonGetKundeVW.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonGetKundeVW.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonGetKundeVW.ForeColor = System.Drawing.Color.Black;
this.buttonGetKundeVW.Location = new System.Drawing.Point(284, 649);
this.buttonGetKundeVW.Margin = new System.Windows.Forms.Padding(2);
this.buttonGetKundeVW.Name = "buttonGetKundeVW";
this.buttonGetKundeVW.Size = new System.Drawing.Size(200, 41);
this.buttonGetKundeVW.TabIndex = 63;
this.buttonGetKundeVW.Text = "Kundendetails";
this.buttonGetKundeVW.UseVisualStyleBackColor = false;
this.buttonGetKundeVW.Click += new System.EventHandler(this.ButtonGetKundeVW_Click);
//
// buttonReklamation
//
@ -184,6 +184,7 @@
this.chartFehlmenge.Titles.Add(title1);
this.chartFehlmenge.Visible = false;
this.chartFehlmenge.VisibleChanged += new System.EventHandler(this.ChartFehlmenge_VisibleChanged);
this.chartFehlmenge.DoubleClick += new System.EventHandler(this.chartFehlmenge_DoubleClick);
//
// groupBoxKndInfo
//
@ -398,6 +399,14 @@
this.tourToolStripMenuItem.Text = "Tour";
this.tourToolStripMenuItem.Click += new System.EventHandler(this.ContextMenuStripBearbeiten_Click);
//
// auftraginfoAnsehenToolStripMenuItem
//
this.auftraginfoAnsehenToolStripMenuItem.Image = global::Deckungsbeitrag.Properties.Resources.InformationSymbol_16x;
this.auftraginfoAnsehenToolStripMenuItem.Name = "auftraginfoAnsehenToolStripMenuItem";
this.auftraginfoAnsehenToolStripMenuItem.Size = new System.Drawing.Size(239, 26);
this.auftraginfoAnsehenToolStripMenuItem.Text = "Auftraginfo ansehen";
this.auftraginfoAnsehenToolStripMenuItem.Click += new System.EventHandler(this.ContextMenuStripAuftragInfo_Click);
//
// aufgabeErledigtToolStripMenuItem
//
this.aufgabeErledigtToolStripMenuItem.Image = global::Deckungsbeitrag.Properties.Resources.Checkmark_blue_16x;
@ -422,14 +431,6 @@
this.auftragLöschenToolStripMenuItem.Text = "Auftrag Löschen";
this.auftragLöschenToolStripMenuItem.Click += new System.EventHandler(this.ContextMenuStripAuftragDelete_Click);
//
// auftraginfoAnsehenToolStripMenuItem
//
this.auftraginfoAnsehenToolStripMenuItem.Image = global::Deckungsbeitrag.Properties.Resources.InformationSymbol_16x;
this.auftraginfoAnsehenToolStripMenuItem.Name = "auftraginfoAnsehenToolStripMenuItem";
this.auftraginfoAnsehenToolStripMenuItem.Size = new System.Drawing.Size(239, 26);
this.auftraginfoAnsehenToolStripMenuItem.Text = "Auftraginfo ansehen";
this.auftraginfoAnsehenToolStripMenuItem.Click += new System.EventHandler(this.ContextMenuStripAuftragInfo_Click);
//
// tabPageSonder
//
this.tabPageSonder.Controls.Add(this.objectListViewSonder);
@ -670,7 +671,7 @@
this.Controls.Add(this.groupBoxKndInfo);
this.Controls.Add(this.chartFehlmenge);
this.Controls.Add(this.buttonReklamation);
this.Controls.Add(this.buttonSuchen);
this.Controls.Add(this.buttonGetKundeVW);
this.Controls.Add(this.buttonStats);
this.Controls.Add(this.buttonEinstellung);
this.Controls.Add(this.buttonNeuerAuftrag);
@ -679,7 +680,6 @@
this.HelpButton = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MinimizeBox = false;
this.Name = "FormExpedit";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "EXPEDIT";
@ -714,7 +714,7 @@
private System.Windows.Forms.Button buttonNeuerAuftrag;
private System.Windows.Forms.Button buttonEinstellung;
private System.Windows.Forms.Button buttonStats;
private System.Windows.Forms.Button buttonSuchen;
private System.Windows.Forms.Button buttonGetKundeVW;
private System.Windows.Forms.Button buttonReklamation;
private System.Windows.Forms.DataVisualization.Charting.Chart chartFehlmenge;
private System.Windows.Forms.GroupBox groupBoxKndInfo;

View File

@ -13,12 +13,16 @@ using System.Data;
using System.Diagnostics;
using System.Diagnostics.Eventing.Reader;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using System.Xml.Resolvers;
using ZXing;
namespace Deckungsbeitrag
{
@ -91,6 +95,8 @@ namespace Deckungsbeitrag
this.SuspendLayout();
_settings.Load();
UCFeedback fb = new UCFeedback(this.benutzer);
this.Controls.Add(fb);
@ -199,51 +205,10 @@ namespace Deckungsbeitrag
FormEinstellung einstellung = new FormEinstellung(this.benutzer);
einstellung.ShowDialog();
}
private void ButtonSuchen_Click(object sender, EventArgs e)
private void ButtonGetKundeVW_Click(object sender, EventArgs e)
{
int kundeID = 0;
string eingabe = PromptForText(
"Welchen Kunden suchst du? \n\n" +
"Bitte scanne den QR-Code des Kunden den du suchst:",
"QR-Code Inhalt",
"0");
if (string.IsNullOrWhiteSpace(eingabe))
{
this.UseWaitCursor = false;
return;
}
string cleanedText = new string(eingabe.Where(char.IsLetterOrDigit).ToArray());
if (int.TryParse(cleanedText, out _)) kundeID = Kunde.GetKundeID(cleanedText, null);
else kundeID = Kunde.GetKundeID(null, cleanedText);
var model = objectListViewAuftrag.Objects.Cast<Auftrag>().FirstOrDefault(a => a.KundeID == kundeID);
if (model == null)
{
}
if (model != null)
{
objectListViewAuftrag.SelectedObject = model;
objectListViewAuftrag.EnsureModelVisible(model);
objectListViewAuftrag.Focus();
}
else
{
FormShowUserControl showGroupBox = new FormShowUserControl("Auftrag Suchen", this.benutzer);
if (showGroupBox.ShowDialog() == DialogResult.OK)
{
suchliste = showGroupBox.auftragliste;
AddTabPage(suchliste, ListenArt.Suchliste);
}
}
FormKundeVW kundeVW = new FormKundeVW();
kundeVW.ShowDialog();
}
private void ButtonReklamation_Click(object sender, EventArgs e)
{
@ -298,12 +263,12 @@ namespace Deckungsbeitrag
ObjectListView olv = (ObjectListView)this.tabControlAuftragList.SelectedTab.Controls[0];
ToolStripItem item = (ToolStripItem)sender;
string aspect = item.AccessibleName;
var col = olv.AllColumns.OfType<BrightIdeasSoftware.OLVColumn>().First(x => x.AspectName == aspect);
var col = olv.AllColumns.OfType<OLVColumn>().First(x => x.AspectName == aspect);
if (this.benutzer.Rolle == BenutzerRolle.Admin) col.IsEditable = true;
if (olv.SelectedItem != null)
{
int idx = olv.AllColumns.IndexOf(col);
int idx = col.Index;
olv.StartCellEdit(olv.SelectedItem, idx);
}
@ -379,7 +344,7 @@ namespace Deckungsbeitrag
foreach (ToolStripDropDownItem item in tsi.DropDownItems)
{
string aspect = item.AccessibleName;
var col = olv.AllColumns.OfType<BrightIdeasSoftware.OLVColumn>().First(x => x.AspectName == aspect);
var col = olv.AllColumns.OfType<OLVColumn>().First(x => x.AspectName == aspect);
if (col.IsEditable) item.Enabled = true;
else item.Enabled = false;
}
@ -393,10 +358,13 @@ namespace Deckungsbeitrag
// Überprüfen ob ObjectListView Rampe ist.
if (!olv.Name.Contains("Rampe")) this.auftragVerschiebenToolStripMenuItem.Enabled = false;
else this.auftragVerschiebenToolStripMenuItem.Enabled = true;
// Überprüfen ob Auftrag eine Aufgabe hat.
if (_auftrag.AufgabeID == null) this.aufgabeErledigtToolStripMenuItem.Enabled = false;
else this.aufgabeErledigtToolStripMenuItem.Enabled = true;
// Überprüfen ob User Admin ist.
if (this.benutzer.Rolle != BenutzerRolle.Admin & this.benutzer.Rolle != BenutzerRolle.Master) this.auftragLöschenToolStripMenuItem.Enabled = false;
else this.auftragLöschenToolStripMenuItem.Enabled = true;
}
#region ObjectListView-Events
@ -488,6 +456,15 @@ namespace Deckungsbeitrag
}
// --- Kunde-Icon ---
var tourCol = Find("TourID");
if (tourCol != null)
{
tourCol.AspectName = "Tour";
}
// --- Schmutzig / Sauber ---
var dirtCol = Find("Schmutzig");
if (dirtCol != null)
@ -553,7 +530,7 @@ namespace Deckungsbeitrag
{
var auftrag = Auftrag.GetAuftrag(expeditAufgabe.AuftragID);
var aufgabe = Aufgabe.GetAufgabe(null, auftrag.AufgabeID);
e.Text = aufgabe?.Bezeichnung;
e.Text = aufgabe?.Beschreibung;
return;
}
@ -669,7 +646,7 @@ namespace Deckungsbeitrag
}
else
{
fehlermeldung.AuftragFertig();
if (e.ClickCount == 1) fehlermeldung.AuftragFertig();
}
olv.Focus();
@ -774,7 +751,7 @@ namespace Deckungsbeitrag
foreach (OLVListItem item in olv.CheckedItems)
{
this.auftrag = (Auftrag)item.RowObject;
this.auftrag = Auftrag.GetAuftrag(((View_Auftrag_Expedit)item.RowObject).AuftragID);
Auftrag_Fertig();
}
@ -797,7 +774,7 @@ namespace Deckungsbeitrag
this.auftrag = auftrag;
if (this.auftrag.ContainerClean == 0)
if (this.auftrag.ContainerClean == 0 & this.auftrag.Typ < AuftragTyp.Inventur)
{
if (meldung.NoCleanContainer() == DialogResult.OK)
return;
@ -898,18 +875,23 @@ namespace Deckungsbeitrag
}
}
PrepareContainerCleanForEtikett();
var result = Funktionen.Etikett_Drucken(auftrag, nocont);
if (result == DialogResult.OK)
if (this.auftrag.Typ < AuftragTyp.Inventur || (this.auftrag.Typ >= AuftragTyp.Inventur && this.auftrag.ContainerClean > 0))
{
this.auftrag.Gedruckt = DateTime.Now;
this.auftrag.GedrucktVon = (int)this.benutzer.BenutzerID;
this.auftrag.Status = AuftragStatus.Vorbereitet;
this.auftrag.Save();
this.auftrag = null;
PrepareContainerCleanForEtikett();
var result = Funktionen.Etikett_Drucken(auftrag, nocont);
if (result == DialogResult.OK)
{
this.auftrag.Gedruckt = DateTime.Now;
this.auftrag.GedrucktVon = (int)this.benutzer.BenutzerID;
}
}
this.auftrag.Status = AuftragStatus.Vorbereitet;
this.auftrag.Save();
this.auftrag = null;
}
private void PrepareContainerCleanForEtikett()
@ -1055,13 +1037,24 @@ namespace Deckungsbeitrag
break;
case var t when t == "Tour":
{ //TODO: Mit Tour statt Fahrer durchgehen.
if (e.NewValue != null)
if (!string.IsNullOrWhiteSpace(e.NewValue.ToString()))
{
this.auftrag.TourID = ((Tour)e.NewValue).TourID;
this.auftrag.Priority = ((Tour)e.NewValue).Priority;
Saison saison = Saison.GetAktivSaison();
Tour tour = Tour.GetTour(saison.SaisonId, e.NewValue.ToString().ToUpper());
if (tour == null) { e.NewValue = string.Empty; return; }
this.auftrag.TourID = tour.TourID;
this.auftrag.Priority = tour.Priority;
e.NewValue = tour.Bezeichnung;
}
}
break;
case var t when t == "ContainerDirt":
{
if (int.TryParse(e.NewValue.ToString(), out int i)) this.auftrag.Container = i;
else return;
}
break;
default:
if (propInfo != null && e.NewValue != null)
{
@ -1175,8 +1168,9 @@ namespace Deckungsbeitrag
}
else
{
if (liste == null || liste == ListenArt.Auftragliste) listAuftragToday = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, frottee: true, datum: DateTime.Today.Date.AddDays(2));
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Laufzettel, minTypFilter: AuftragTyp.Inventur, frottee: true);
if (liste == null || liste == ListenArt.Auftragliste) listAuftragToday = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, kategorie: ArtikelKategorie.Frottee, datum: DateTime.Today.Date.AddDays(2));
if (liste == null || liste == ListenArt.Geschäftliste) listAuftragGeschaeft = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Abgeholt, typFilter: AuftragTyp.Geschäft, kategorie: ArtikelKategorie.Frottee);
if (liste == null || liste == ListenArt.Sonderliste) listSonderAuftrag = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Fertig, minStatusFilter: AuftragStatus.Herrichten, typFilter: AuftragTyp.Laufzettel, minTypFilter: AuftragTyp.Inventur, kategorie: ArtikelKategorie.Frottee);
}
}
@ -1215,6 +1209,12 @@ namespace Deckungsbeitrag
if (this.benutzer.Rolle == BenutzerRolle.Frottee) this.auftrag.Abteilungen |= AbteilungsStatus.FrotteeBeendet;
else this.auftrag.Status = AuftragStatus.Fertig;
this.auftrag.Save();
if (this.auftrag.Typ == AuftragTyp.Inventur)
{
Program.InventurFertig(this.auftrag);
}
this.auftrag = null;
}
@ -1399,6 +1399,31 @@ namespace Deckungsbeitrag
}
}
private void chartFehlmenge_DoubleClick(object sender, EventArgs e)
{
Chart chart = (Chart)sender;
Kunde _knd = chart.Tag as Kunde;
List<KundeArtikel> kndartListe = KundeArtikel.GetList(_knd.KundeID.ToString());
Auftrag _auftrag = new Auftrag()
{
KundeID = (int)_knd.KundeID,
Typ = AuftragTyp.IST_Erhoehung,
Erstellt = DateTime.Now,
ErstelltVon = (int)this.benutzer.BenutzerID,
Status = AuftragStatus.Vorbereitet,
};
_auftrag.Save();
FormAuftragDetail detail = new FormAuftragDetail(_auftrag, this.benutzer, kndartListe);
detail.Show();
//TODO: Wie soll es weiter gehen?
}
private void FormExpedit_MouseMove(object sender, MouseEventArgs e)
{
}
}
}
//TODO: Lösung zum Löschen von Aufträgen überlegen. (Kevin fragen)

View File

@ -134,7 +134,7 @@
<data name="auftragLöschenToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vwAADr8BOAVTJAAAALlJREFUOE+tkrERwjAMRbMAa1CnpHZNwQgUbMBEdFBmhCxjoIrdqBX3fZFPFsEO
vAAADrwBlbxySQAAALlJREFUOE+tkrERwjAMRbMAa1CnpHZNwQgUbMBEdFBmhCxjoIrdqBX3fZFPFsEO
HMU7y+f8Z8mXjpm7GkTUE1GYQV3s8QE3COP5xAB1ePg47Hd5nwTOuUVwFp93RuCy3aSQ1FgLQZhigQiI
6KglEkYneYSGoJe2RSDtrxLo27HqcZpvAIbbNQchE+GbwHagmbxPIv0mzREsMtL8bxwQRv2TQNN8A01V
8OlGy9cCG7D8T7DEakENG7C8AEMBEFYEw8flAAAAAElFTkSuQmCC

View File

@ -26,6 +26,7 @@ namespace Deckungsbeitrag
Kunde kunde;
Auftrag auftrag;
List<KundeArtikel> artikelListe;
public List<View_Auftrag_Expedit> liste;
readonly Meldungen meldung = new Meldungen();
private readonly Benutzer benutzer;
private List<object> auftragsliste;
@ -33,6 +34,7 @@ namespace Deckungsbeitrag
readonly string userid;
private Dictionary<int, int> auftragDictionary = new Dictionary<int, int>();
private bool etikettgedruckt = false;
#region Form-Konstruktor
public FormFehlmengeCount()
@ -53,7 +55,7 @@ namespace Deckungsbeitrag
#endregion
private void FormFehlmengeCount_Load(object sender, EventArgs e)
private async void FormFehlmengeCount_Load(object sender, EventArgs e)
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
this.Text = " Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
@ -66,7 +68,7 @@ namespace Deckungsbeitrag
//Kunde wird durch Scan oder Handeingabe Ausgewählt.
//this.kunde = Funktionen.KundenAuswahl();
Open_Liste();
await Open_Liste();
ControlLaden();
CloseKeyboard();
@ -393,60 +395,63 @@ namespace Deckungsbeitrag
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonFertig_Click(object sender, EventArgs e)
private async void ButtonFertig_Click(object sender, EventArgs e)
{
// Controls werden durchgegangen und ausgeblendet oder der Text entfernt.
foreach (Control ctr in this.Controls)
if (auftrag != null)
{
switch (ctr)
// Controls werden durchgegangen und ausgeblendet oder der Text entfernt.
foreach (Control ctr in this.Controls)
{
case Label lbl:
//lbl.Text = string.Empty;
lbl.Visible = false;
break;
case GroupBox gb:
gb.Visible = false;
break;
case TextBox txt:
txt.Clear();
txt.Enabled = true;
break;
default:
break;
}
}
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Frottee))
{
EtikettDrucken();
if (etikettgedruckt)
{
DialogResult result = meldung.GetFrage(this, "Möchtest du eine weitere Reklamation eingeben?", false);
switch (result)
switch (ctr)
{
case DialogResult.Yes:
case Label lbl:
//lbl.Text = string.Empty;
lbl.Visible = false;
break;
case GroupBox gb:
gb.Visible = false;
break;
case TextBox txt:
txt.Clear();
txt.Enabled = true;
break;
case DialogResult.No:
this.Close();
return;
default:
break;
}
}
else return;
}
else
{
// AbteilungsStatus für Kleinteile und Großteile wird hier gesetzt.
if (!userid.Contains("frottee") & !userid.Contains("spannleintuch"))
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Frottee))
{
if (userid.Contains("kleinteile")) { auftrag.Abteilungen |= AbteilungsStatus.KleinteileBeendet; auftrag.Save(); }
if (userid.Contains("grossteile")) { auftrag.Abteilungen |= AbteilungsStatus.GrossteileBeendet; auftrag.Save(); }
EtikettDrucken();
if (etikettgedruckt)
{
DialogResult result = meldung.GetFrage(this, "Möchtest du eine weitere Reklamation eingeben?", false);
switch (result)
{
case DialogResult.Yes:
break;
case DialogResult.No:
this.Close();
return;
default:
break;
}
}
else return;
}
else
{
// AbteilungsStatus für Kleinteile und Großteile wird hier gesetzt.
if (!userid.Contains("frottee") & !userid.Contains("spannleintuch"))
{
if (userid.Contains("kleinteile")) { auftrag.Abteilungen |= AbteilungsStatus.KleinteileBeendet; auftrag.Save(); }
if (userid.Contains("grossteile")) { auftrag.Abteilungen |= AbteilungsStatus.GrossteileBeendet; auftrag.Save(); }
}
}
}
//Kunde wird durch Scan oder Handeingabe Ausgewählt.
Open_Liste();
await Open_Liste();
ControlLaden();
}
private void EtikettDrucken()
@ -464,15 +469,18 @@ namespace Deckungsbeitrag
/// Auftragliste aufrufen.
/// </summary>
/// <param name="extra">Wenn Extrakunde dann true</param>
private async void Open_Liste()
private async Task Open_Liste()
{
int listentyp = 0;
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Frottee)) { auftragsliste = null; listentyp = 5; }
else auftragsliste = new List<object>(Auftrag.GetFinishingList(kategorie));
if ((userid != null && userid.Contains("reklamation")) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Expedit) || (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Frottee)) { this.liste = null; listentyp = 5; }
else
{
await Task.WhenAll(
GetAuftraegeAsync());
}
FormListe liste = new FormListe(auftragsliste, listentyp);
FormListe liste = new FormListe(this.liste, listentyp, kategorie);
if (liste.ShowDialog() == DialogResult.OK)
{
if (liste.auftrag != null)
@ -483,6 +491,10 @@ namespace Deckungsbeitrag
else this.kunde = liste.kunde;
}
}
private async Task GetAuftraegeAsync()
{
this.liste = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, kategorie: kategorie);
}
/// <summary>
/// TextBox Scann Events
@ -540,6 +552,11 @@ namespace Deckungsbeitrag
// Beim geklickten Artikel wird Fehlmenge erhöht
Button btn = (Button)sender;
KundeArtikel kndart = (KundeArtikel)btn.Tag;
if (kndart.ArtikelID == null)
{
kndart.ArtikelID = Artikel.GetArtikelID(kndart.ArtikelNR);
kndart.Save();
}
DateTime timestamp = DateTime.Now.Date;
ArtikelNachwaesche artnw = ArtikelNachwaesche.FindeDatensatz(kndart.ArtikelID, timestamp);
if (artnw.NachwaescheID == null)

View File

@ -34,8 +34,27 @@ namespace Deckungsbeitrag
private readonly Benutzer benutzer;
int beforeedit = 0;
private bool formloading = false;
private bool _tosave = false;
private DataGridView.HitTestInfo _hitInfo;
public bool _tosave = false;
private bool _tosaveInventur = false;
public bool TosaveInventur
{
get { return _tosaveInventur; }
set
{
_tosaveInventur = value;
if (_tosaveInventur & dateTimePickerInventur.Checked & dateTimePickerLiefertag.Checked)
{
buttonFreigeben.Enabled = true;
buttonFreigeben.BackColor = Color.FromArgb(0, 192, 0);
}
else
{
buttonFreigeben.Enabled = false;
buttonFreigeben.BackColor = Color.Gray;
}
}
}
public FormKundeVW()
{
@ -79,7 +98,7 @@ namespace Deckungsbeitrag
if (this.kunde != null) DatenLesen();
else this.Close();
formloading = false;
}
private void FormKundeVW_Shown(object sender, EventArgs e)
@ -89,6 +108,7 @@ namespace Deckungsbeitrag
private void ComboBox_Laden()
{
// Service Liste erstellen und mit ComboBox verknüpfen.
this.comboBoxService.Enabled = false;
List<string> list = Kunde.GetServiceDistinct();
@ -114,8 +134,9 @@ namespace Deckungsbeitrag
}
private void DatenLesen()
{
//TextBoxen deaktivieren.
TextBoxes_Unable();
formloading = true;
//TextBoxen deaktivieren.
TextBoxes_Unable();
//Alle Einträge der DataGridView entfernen. Davor muss die DataSource entfernt werden.
this.dGArtikel.DataSource = null;
@ -209,9 +230,19 @@ namespace Deckungsbeitrag
}
this.comboBoxLRSommer.SelectedIndexChanged -= ComboBoxLieferrhythmus_SelectedIndexChanged;
this.comboBoxLRWinter.SelectedIndexChanged -= ComboBoxLieferrhythmus_SelectedIndexChanged;
this.comboBoxAufgabe.SelectedIndexChanged -= ComboBoxAufgabe_SelectedIndexChanged;
// ComboBox-Item für Lieferrhythmus wird gewählt
this.comboBoxLRSommer.SelectedValue = (Liefertage)this.kunde.SommerLieferRhythmus;
this.comboBoxLRWinter.SelectedValue = (Liefertage)this.kunde.WinterLieferRhythmus;
if (this.kunde.Aufgabe == null) this.comboBoxAufgabe.SelectedIndex = -1;
else this.comboBoxAufgabe.SelectedItem = Aufgabe.GetAufgabe(null, this.kunde.Aufgabe);
this.comboBoxAufgabe.SelectedIndexChanged += ComboBoxAufgabe_SelectedIndexChanged;
this.comboBoxLRSommer.SelectedIndexChanged += ComboBoxLieferrhythmus_SelectedIndexChanged;
this.comboBoxLRWinter.SelectedIndexChanged += ComboBoxLieferrhythmus_SelectedIndexChanged;
// numericUpDown für AufgabeCount befüllen
this.numericUpDownAufgabeCount.Value = (decimal)this.kunde.AufgabeCount;
@ -226,7 +257,10 @@ namespace Deckungsbeitrag
OLV_Load();
Chart_Load();
}
this.tabControlKunde.SelectedIndex = 0;
formloading = false;
}
private void CompareToSortiment()
{
int reihung = 1;
@ -270,15 +304,29 @@ namespace Deckungsbeitrag
}
private void TSBNext_Click(object sender, EventArgs e)
{
if (_tosave)
{
if (MessageBox.Show("Möchtest du die Änderungen speichern?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) this.kunde.Save();
}
SaveChanges();
// Kundenliste öffnen und Kunde auswählen.
this.kunde = Funktionen.KundenAuswahl();
if (kunde != null) DatenLesen();
}
private void SaveChanges()
{
if (_tosave)
{
if (this.comboBoxAufgabe.SelectedItem != null && this.numericUpDownAufgabeCount.Value == 0) { meldung.GetFehler(this, $"Du hast für deine Aufgabe noch keine Auftraganzahl eingegeben. Hole das bitte jetzt nach."); return; }
if (this.comboBoxAufgabe.SelectedItem == null && this.numericUpDownAufgabeCount.Value > 0) { meldung.GetFehler(this, "Du hast noch keine Aufgabe ausgewählt. Hole das bitte jetzt nach."); return; }
if (MessageBox.Show("Möchtest du die Änderungen speichern?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) this.kunde.Save();
_tosave = false;
}
if (TosaveInventur)
{
if (MessageBox.Show("Du hast die Inventur noch nicht gespeichert, möchtest du diese jetzt speichern?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ButtonFreigeben_Click(buttonFreigeben, null);
TosaveInventur = false;
}
}
private void ButtonProgramm_Click(object sender, EventArgs e)
{
}
@ -576,15 +624,12 @@ namespace Deckungsbeitrag
private void ComboBoxAufgabe_SelectedIndexChanged(object sender, EventArgs e)
{
if (formloading) return;
if (this.comboBoxAufgabe.SelectedItem != null && this.numericUpDownAufgabeCount.Value == 0) { meldung.GetFehler(this, $"Du hast für deine Aufgabe noch keine Auftraganzahl eingegeben. Hole das bitte jetzt nach."); return; }
_tosave = true;
}
private void NumericUpDownAufgabeCount_ValueChanged(object sender, EventArgs e)
{
NumericUpDown numeric = (NumericUpDown)sender;
if (formloading) return;
if (numeric.Value > 0) NumericUpDownAufgabeCount_Leave(this, null);
else { meldung.GetFehler(this, $"Du hast für deine Aufgabe noch keine Auftraganzahl eingegeben. Hole das bitte jetzt nach."); return; }
_tosave = true;
}
private void ComboBoxService_SelectedValueChanged(object sender, EventArgs e)
@ -609,10 +654,7 @@ namespace Deckungsbeitrag
/// <param name="e"></param>
private void FormKundeVW_FormClosing(object sender, FormClosingEventArgs e)
{
if (_tosave)
{
if (MessageBox.Show("Möchtest du die Änderungen speichern?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) this.kunde.Save();
}
SaveChanges();
}
private void CheckBoxNW_Click(object sender, EventArgs e)
{
@ -630,25 +672,119 @@ namespace Deckungsbeitrag
this.tabControlInventur.Cursor = Cursors.WaitCursor;
this.tabControlInventur.SuspendLayout();
GetInventurColumns();
GetRowHeader();
GetOLVItems();
string savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
string delPath = Path.Combine(savePath, $"Warten-{this.kunde.KundeNummer}.csv");
string[] lines = null;
if (File.Exists(delPath))
{
int i = 0;
//int j = 0;
lines = File.ReadAllLines(delPath, Encoding.UTF8);
this.dateTimePickerInventur.ValueChanged -= DateTimePicker_ValueChanged;
this.dateTimePickerLiefertag.ValueChanged -= DateTimePicker_ValueChanged;
this.dGVZahlen.Columns.Clear();
this.dGVZahlen.Rows.Clear();
this.dGVZahlen.AllowUserToAddRows = false;
// 1. alle Zeilen lesen
foreach (string line in lines)
{
i++;
if (i == 1 || i == 2 || i == 3 || i ==6 || i == 7 || i == 8)
{
if (i == 2 && line.Split(':')[1].Replace(';', ' ').Trim() != this.kunde.KundeNummer) return;
else continue;
}
if (i == 4 && DateTime.TryParse(line.Split(':')[1].Replace(';', ' ').Trim(), out DateTime dt)) dateTimePickerInventur.Value = dt;
if (i == 5 && DateTime.TryParse(line.Split(':')[1].Replace(';', ' ').Trim(), out DateTime date)) dateTimePickerLiefertag.Value = date;
if (i == 9)
{
string[] artikel = line.Split(';');
DataGridViewColumn col;
for (int x = 0; x < artikel.Length; x++)
{
if (x == 0) continue;
KundeArtikel kndart = KundeArtikel.GetItemIfAvailable((int)this.kunde.KundeID, int.Parse(artikel[x].Split(':')[1]));
col = new DataGridViewTextBoxColumn
{
HeaderText = artikel[x],
Name = "col_" + artikel[x],
Tag = kndart,
ReadOnly = false,
SortMode = DataGridViewColumnSortMode.NotSortable
};
this.dGVZahlen.Columns.Add(col);
}
}
if (i > 9)
{
string[] data = line.Split(';');
DataGridViewRow drow = new DataGridViewRow();
drow.CreateCells(this.dGVZahlen);
for (int j = 0; j < data.Length; j++)
{
if (j == 0) drow.HeaderCell.Value = data[0];
else drow.Cells[j - 1].Value = data[j];
}
this.dGVZahlen.Rows.Add(drow);
}
}
}
else
{
GetInventurColumns();
GetRowHeader(null);
GetOLVItems();
}
GetRowLayout();
this.dateTimePickerInventur.ValueChanged += DateTimePicker_ValueChanged;
this.dateTimePickerLiefertag.ValueChanged += DateTimePicker_ValueChanged;
this.tabControlInventur.ResumeLayout();
this.tabControlInventur.Cursor = Cursors.Default;
}
}
private void GetRowHeader()
{
string[] rows = new string[] { "IST-Stand", "SOLL-Stand", "INV-Ausgleich", "Reklamation", "Nachwäsche", "Schwund" };
this.dGVZahlen.Rows.Clear();
this.dGVZahlen.Rows.Add(rows.Length - 1);
/// <summary>
/// Laden von alten Inventuren.
/// </summary>
private void GetOldInventuren()
{
string savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
string[] invFiles = Directory.GetFiles(savePath, $"*-{this.kunde.KundeNummer}.csv");
string[] lines = null;
// Wenn keine Files vorhanden -> RETURN
if (invFiles.Length == 0) return;
int i = 0;
foreach (string s in invFiles)
{
i++;
// Wartende Inventur wird ignoriert.
if (s.StartsWith("Warten")) continue;
// 1. alle Zeilen lesen
lines = File.ReadAllLines(Path.Combine(savePath, s), Encoding.UTF8);
// 2. an UCInventur übergeben
}
}
private void GetRowLayout()
{
foreach (DataGridViewRow row in this.dGVZahlen.Rows)
{
row.HeaderCell.Value = rows[row.Index];
row.ReadOnly = true;
if (row.HeaderCell.Value == null) continue;
switch (row.HeaderCell.Value.ToString())
{
case var t when t == "INV-Ausgleich":
@ -671,6 +807,42 @@ namespace Deckungsbeitrag
this.dGVZahlen.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
}
private void GetRowHeader(string[] datarows)
{
string[] rows;
if (datarows != null) { rows = datarows.ToArray(); }
else rows = new string[] { "IST-Stand", "SOLL-Stand", "INV-Ausgleich", "Reklamation", "Nachwäsche", "Schwund" };
this.dGVZahlen.Rows.Clear();
this.dGVZahlen.Rows.Add(rows.Length - 1);
foreach (DataGridViewRow row in this.dGVZahlen.Rows)
{
row.HeaderCell.Value = rows[row.Index];
row.ReadOnly = true;
//switch (row.HeaderCell.Value.ToString())
//{
// case var t when t == "INV-Ausgleich":
// row.HeaderCell.Style.BackColor = row.DefaultCellStyle.BackColor = Color.Green;
// row.HeaderCell.Style.Font = row.DefaultCellStyle.Font = new Font(dGVZahlen.Font, FontStyle.Bold);
// row.HeaderCell.Style.ForeColor = row.DefaultCellStyle.ForeColor = Color.White;
// break;
// case var t when t == "Schwund":
// row.HeaderCell.Style.BackColor = row.DefaultCellStyle.BackColor = Color.Red;
// row.HeaderCell.Style.Font = row.DefaultCellStyle.Font = new Font(dGVZahlen.Font, FontStyle.Bold);
// row.HeaderCell.Style.ForeColor = row.DefaultCellStyle.ForeColor = Color.White;
// break;
// case var t when t == "IST-Stand":
// row.HeaderCell.Style.Font = row.DefaultCellStyle.Font = new Font(dGVZahlen.Font, FontStyle.Bold);
// break;
// default:
// break;
//}
}
//this.dGVZahlen.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
}
private void GetOLVItems()
{
foreach (DataGridViewColumn col in this.dGVZahlen.Columns)
@ -719,6 +891,7 @@ namespace Deckungsbeitrag
// Neue Zeile mit Daten erstellen
DataGridViewRow newRow = new DataGridViewRow();
newRow.CreateCells(this.dGVZahlen);
foreach (DataGridViewCell cell in newRow.Cells) cell.Value = 0;
newRow.HeaderCell.Value = text;
// An Position 2 einfügen (vor bestehender Zeile 2)
@ -753,7 +926,7 @@ namespace Deckungsbeitrag
switch (row.HeaderCell.Value.ToString())
{
case var t when t == "SOLL-Stand":
sollStand = (int)row.Cells[colIndex].Value;
sollStand = int.Parse(row.Cells[colIndex].Value.ToString());
break;
case var t when t == "INV-Ausgleich":
row.Cells[colIndex].Value = invAusgleich = sollStand - istStand;
@ -766,17 +939,19 @@ namespace Deckungsbeitrag
row.Cells[colIndex].Value = istStand;
break;
case var t when t == "Reklamation":
reklamation = (int)row.Cells[colIndex].Value;
reklamation = int.Parse(row.Cells[colIndex].Value.ToString());
break;
case var t when t == "Nachwäsche":
nachwaesche = (int)row.Cells[colIndex].Value;
nachwaesche = int.Parse(row.Cells[colIndex].Value.ToString());
break;
default:
break;
}
}
TosaveInventur = true;
}
private void dGVZahlen_CellEndEdit(object sender, DataGridViewCellEventArgs e)
private void DGVZahlen_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
DoCalculation(e.ColumnIndex);
}
@ -792,7 +967,7 @@ namespace Deckungsbeitrag
}
return -1; // Nicht gefunden
}
private void contextMenuStripGridView_Opening(object sender, CancelEventArgs e)
private void ContextMenuStripGridView_Opening(object sender, CancelEventArgs e)
{
if (_hitInfo.RowIndex >= 0 && _hitInfo.ColumnIndex >= 0)
{
@ -803,6 +978,196 @@ namespace Deckungsbeitrag
}
}
private void ButtonFreigeben_Click(object sender, EventArgs e)
{
string savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
string delPath = Path.Combine(savePath, $"Warten-{this.kunde.KundeNummer}.csv");
SaveInventurToCSV("Speichern", null);
if (File.Exists(delPath))
{
if (MessageBox.Show("Möchtest du die Inventur abschließen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
int auftragID = ErstelleInventurAuftrag();
SaveInventurToCSV("Abschließen", auftragID);
}
}
else
{
Program.AddFehler(this.benutzer, $"Inventur konnte nicht gesoeichert werden.", $"KundeNr: {this.kunde.KundeNummer} Liefertag: {dateTimePickerLiefertag}", null);
MessageBox.Show("Die Inventur konnte nicht gespeichert werden. Der Fehler wurde gemeldet.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
TabControlKunde_SelectedIndexChanged(this.tabControlKunde, null);
}
private int ErstelleInventurAuftrag()
{
int auftragId = 0;
Auftrag inv = new Auftrag()
{
KundeID = (int)this.kunde.KundeID,
ArbeiterID = (int)this.benutzer.BenutzerID,
Typ = AuftragTyp.Inventur,
Status = AuftragStatus.Herrichten,
Erstellt = DateTime.Now,
ErstelltVon = (int)this.benutzer.BenutzerID,
Liefertag = dateTimePickerLiefertag.Value.Date,
};
int[] inventur = inv.Save();
if (inventur[0] == 1)
{
auftragId = inventur[1];
foreach (DataGridViewRow row in dGVZahlen.Rows)
{
if (row.HeaderCell.Value.ToString() == "INV-Ausgleich")
{
int save = dGVZahlen.Columns.Count;
int saved = 0;
foreach (DataGridViewColumn column in dGVZahlen.Columns)
{
KundeArtikel kndart = (KundeArtikel)column.Tag;
Artikel art = Artikel.GetArtikel(null, ((KundeArtikel)column.Tag).ArtikelID);
if (row.Cells[column.Index].Value == null || int.Parse(row.Cells[column.Index].Value.ToString()) == 0) { save -= 1; continue; }
KundeArtikel.SaveKundeArtikel_Numbers(kndart, int.Parse(row.Cells[column.Index].Value.ToString()), 0, 0, null);
AuftragArtikel aufart = new AuftragArtikel()
{
AuftragID = inventur[1],
ArtikelID = art.ArtikelID,
ArtikelName = art.Bezeichnung,
Gesamt = row.Cells[column.Index].Value == null ? 0 : int.Parse(row.Cells[column.Index].Value.ToString()),
Anzahl = row.Cells[column.Index].Value == null ? 0 : int.Parse(row.Cells[column.Index].Value.ToString()),
Erledigt = false,
};
saved += aufart.Save();
}
if (save != saved)
{
Program.AddFehler(this.benutzer, "Es wurden nicht alle Artikel der Inventur gespeichert.", $"Auftrag: {inventur[1]} Fehler bei <FormKundeVW><ErstelleInventurAuftrag>", null);
MessageBox.Show("Es konnten nicht alle Artikel gespeichert werden. Vergleiche den Auftrag mit der CSV.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
return auftragId;
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Möchtest du die Inventur wirklich löschen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
this.dateTimePickerInventur.Checked = this.dateTimePickerLiefertag.Checked = false;
foreach(DataGridViewRow row in dGVZahlen.Rows)
{
if (!dGVZahlen.Rows[row.Index].ReadOnly) this.dGVZahlen.Rows.RemoveAt(row.Index);
foreach (DataGridViewColumn column in this.dGVZahlen.Columns) DoCalculation(column.Index);
}
TosaveInventur = false;
}
}
/// <summary>
/// DataGridView wird geladen.
/// Wenn Inventurdatei vorhanden werden Spalten hinzugefügt und Zeilen aufgefüllt.
/// </summary>
/// <param name="sender"></param>
private void SaveInventurToCSV(object sender, int? Id)
{
Kunde _knd = this.kunde;
Benutzer _user = this.benutzer;
List<KundeArtikel> _artikelliste = this.standListe;
string status = string.Empty;
string savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
// Inventur Status Warten wenn noch Zahlen fehlen.
if (sender.ToString() == "Speichern") status = "Warten";
else
{
// Inventur Status Herrichten wenn alle Zahlen vorhanden und Auftrag erstellt wurde.
if (sender.ToString() == "Abschließen")
{
status = $"Herrichten-{Id}";
string deletePath = Path.Combine(savePath, $"Warten-{_knd.KundeNummer}.csv");
if (File.Exists(deletePath)) File.Delete(deletePath);
}
else // Inventur Status Fertig wenn Inventur fertig hergerichtet und demnäcsht ausgeliefert.
{
//TODO: Wenn Auftrag Fertig dann Fertig Datei erstellen und Herrichten löschen.
status = $"Fertig-{Id}";
string delPath = Path.Combine(savePath, $"Herrichten-{Id}-{_knd.KundeNummer}.csv");
if (File.Exists(delPath)) File.Delete(delPath);
}
}
string artikel = string.Empty;
string cols = string.Empty;
string fileName = $"{status}-{_knd.KundeNummer}.csv"; // Dateiname: Status-AuftragID-KundeNummer.csv
string csvPath;
csvPath = Path.Combine(savePath, fileName);
// Prüfen ob Header schon existiert
//bool headerExists = File.Exists(csvPath);
// Artikelbezeichnungen in string convertieren
foreach (KundeArtikel art in _artikelliste) artikel += art.ArtikelName + ";";
foreach (var col in dGVZahlen.Columns.Cast<DataGridViewColumn>().Where(c => c.Visible).OrderBy(c => c.DisplayIndex))
{
if (col.Visible) cols += ";" + col.HeaderText + ":" + ((KundeArtikel)col.Tag).ArtikelNR.ToString();
}
// Prüfen ob Inventur neu ist
//if (headerExists) neueinventur = NeueInventur(csvPath, cols);
// Nur Header bei NEUER Datei
var csv = new StringBuilder();
csv.AppendLine("=== INVENTUR INFO ===");
csv.AppendLine($"KundeNr: {_knd.KundeNummer}");
csv.AppendLine($"Kunde: {_knd.KundeName}");
csv.AppendLine($"Inventurdatum: {dateTimePickerInventur.Value.Date:d}");
csv.AppendLine($"Liefertag: {dateTimePickerLiefertag.Value.Date:d}");
if (Id != null) csv.AppendLine($"Auftrag: {Id}");
else csv.AppendLine("Auftrag: ");
csv.AppendLine();
csv.AppendLine(new string('=', 30));
csv.AppendLine($"Artikel{cols}");
File.WriteAllText(csvPath, csv.ToString(), Encoding.UTF8);
// NEUE Artikel ANHÄNGEN (ohne Header)
var appendCsv = new StringBuilder();
foreach (DataGridViewRow row in this.dGVZahlen.Rows)
{
// Nur sichtbare Spalten auslesen
var values = new List<string>();
for (int i = 0; i < row.Cells.Count; i++)
{
if (row.Cells[i].Visible)
{
if (i == 0)
{
values.Add(row.HeaderCell.Value.ToString());
}
values.Add(row.Cells[i].Value?.ToString() ?? "0");
}
}
// Eine Zeile pro Row, mit allen Werten getrennt durch ";"
appendCsv.AppendLine(string.Join(";", values));
}
File.AppendAllText(csvPath, appendCsv.ToString(), Encoding.UTF8);
TosaveInventur = false;
}
private void DateTimePicker_ValueChanged(object sender, EventArgs e)
{
DateTimePicker dtp = sender as DateTimePicker;
if (dtp.Checked == true) TosaveInventur = true;
else TosaveInventur = false;
}
#endregion

View File

@ -30,15 +30,15 @@ namespace Deckungsbeitrag
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea14 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend14 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea15 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend15 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormKundeVW));
this.textBoxKndNr = new System.Windows.Forms.TextBox();
this.labelKundeNummer = new System.Windows.Forms.Label();
@ -96,7 +96,7 @@ namespace Deckungsbeitrag
this.deleteRowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panelButtons = new System.Windows.Forms.Panel();
this.buttonFreigeben = new System.Windows.Forms.Button();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.buttonDelete = new System.Windows.Forms.Button();
this.panelDaten = new System.Windows.Forms.Panel();
this.labelAddRow = new System.Windows.Forms.Label();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
@ -153,7 +153,7 @@ namespace Deckungsbeitrag
this.textBoxKndNr.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxKndNr.Location = new System.Drawing.Point(13, 99);
this.textBoxKndNr.Name = "textBoxKndNr";
this.textBoxKndNr.Size = new System.Drawing.Size(102, 30);
this.textBoxKndNr.Size = new System.Drawing.Size(102, 35);
this.textBoxKndNr.TabIndex = 0;
//
// labelKundeNummer
@ -163,7 +163,7 @@ namespace Deckungsbeitrag
this.labelKundeNummer.ForeColor = System.Drawing.Color.White;
this.labelKundeNummer.Location = new System.Drawing.Point(9, 76);
this.labelKundeNummer.Name = "labelKundeNummer";
this.labelKundeNummer.Size = new System.Drawing.Size(86, 25);
this.labelKundeNummer.Size = new System.Drawing.Size(105, 29);
this.labelKundeNummer.TabIndex = 2;
this.labelKundeNummer.Text = "KND NR";
//
@ -174,7 +174,7 @@ namespace Deckungsbeitrag
this.labelKundeName.ForeColor = System.Drawing.Color.White;
this.labelKundeName.Location = new System.Drawing.Point(9, 128);
this.labelKundeName.Name = "labelKundeName";
this.labelKundeName.Size = new System.Drawing.Size(64, 25);
this.labelKundeName.Size = new System.Drawing.Size(78, 29);
this.labelKundeName.TabIndex = 3;
this.labelKundeName.Text = "Name";
//
@ -184,7 +184,7 @@ namespace Deckungsbeitrag
this.textBoxKundeName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxKundeName.Location = new System.Drawing.Point(13, 151);
this.textBoxKundeName.Name = "textBoxKundeName";
this.textBoxKundeName.Size = new System.Drawing.Size(263, 30);
this.textBoxKundeName.Size = new System.Drawing.Size(263, 35);
this.textBoxKundeName.TabIndex = 4;
//
// textBoxStraße
@ -193,7 +193,7 @@ namespace Deckungsbeitrag
this.textBoxStraße.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxStraße.Location = new System.Drawing.Point(13, 255);
this.textBoxStraße.Name = "textBoxStraße";
this.textBoxStraße.Size = new System.Drawing.Size(352, 30);
this.textBoxStraße.Size = new System.Drawing.Size(352, 35);
this.textBoxStraße.TabIndex = 5;
//
// labelStraße
@ -203,7 +203,7 @@ namespace Deckungsbeitrag
this.labelStraße.ForeColor = System.Drawing.Color.White;
this.labelStraße.Location = new System.Drawing.Point(9, 232);
this.labelStraße.Name = "labelStraße";
this.labelStraße.Size = new System.Drawing.Size(116, 25);
this.labelStraße.Size = new System.Drawing.Size(141, 29);
this.labelStraße.TabIndex = 6;
this.labelStraße.Text = "Straße/HNr.";
//
@ -213,7 +213,7 @@ namespace Deckungsbeitrag
this.textBoxPLZ.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxPLZ.Location = new System.Drawing.Point(13, 307);
this.textBoxPLZ.Name = "textBoxPLZ";
this.textBoxPLZ.Size = new System.Drawing.Size(102, 30);
this.textBoxPLZ.Size = new System.Drawing.Size(102, 35);
this.textBoxPLZ.TabIndex = 9;
//
// labelPLZ
@ -223,7 +223,7 @@ namespace Deckungsbeitrag
this.labelPLZ.ForeColor = System.Drawing.Color.White;
this.labelPLZ.Location = new System.Drawing.Point(9, 284);
this.labelPLZ.Name = "labelPLZ";
this.labelPLZ.Size = new System.Drawing.Size(48, 25);
this.labelPLZ.Size = new System.Drawing.Size(56, 29);
this.labelPLZ.TabIndex = 10;
this.labelPLZ.Text = "PLZ";
//
@ -233,7 +233,7 @@ namespace Deckungsbeitrag
this.textBoxOrt.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxOrt.Location = new System.Drawing.Point(121, 307);
this.textBoxOrt.Name = "textBoxOrt";
this.textBoxOrt.Size = new System.Drawing.Size(244, 30);
this.textBoxOrt.Size = new System.Drawing.Size(244, 35);
this.textBoxOrt.TabIndex = 11;
//
// labelOrt
@ -243,7 +243,7 @@ namespace Deckungsbeitrag
this.labelOrt.ForeColor = System.Drawing.Color.White;
this.labelOrt.Location = new System.Drawing.Point(117, 284);
this.labelOrt.Name = "labelOrt";
this.labelOrt.Size = new System.Drawing.Size(39, 25);
this.labelOrt.Size = new System.Drawing.Size(46, 29);
this.labelOrt.TabIndex = 12;
this.labelOrt.Text = "Ort";
//
@ -254,7 +254,7 @@ namespace Deckungsbeitrag
this.labelKdnName2.ForeColor = System.Drawing.Color.White;
this.labelKdnName2.Location = new System.Drawing.Point(9, 180);
this.labelKdnName2.Name = "labelKdnName2";
this.labelKdnName2.Size = new System.Drawing.Size(123, 25);
this.labelKdnName2.Size = new System.Drawing.Size(147, 29);
this.labelKdnName2.TabIndex = 25;
this.labelKdnName2.Text = "NameZusatz";
//
@ -264,7 +264,7 @@ namespace Deckungsbeitrag
this.textBoxKndName2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxKndName2.Location = new System.Drawing.Point(13, 203);
this.textBoxKndName2.Name = "textBoxKndName2";
this.textBoxKndName2.Size = new System.Drawing.Size(352, 30);
this.textBoxKndName2.Size = new System.Drawing.Size(352, 35);
this.textBoxKndName2.TabIndex = 26;
//
// buttonBewertung
@ -298,7 +298,7 @@ namespace Deckungsbeitrag
this.textBoxSuchtext.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxSuchtext.Location = new System.Drawing.Point(122, 99);
this.textBoxSuchtext.Name = "textBoxSuchtext";
this.textBoxSuchtext.Size = new System.Drawing.Size(154, 30);
this.textBoxSuchtext.Size = new System.Drawing.Size(154, 35);
this.textBoxSuchtext.TabIndex = 38;
//
// label1
@ -308,7 +308,7 @@ namespace Deckungsbeitrag
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(118, 76);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(122, 25);
this.label1.Size = new System.Drawing.Size(145, 29);
this.label1.TabIndex = 39;
this.label1.Text = "SUCHTEXT";
//
@ -319,7 +319,7 @@ namespace Deckungsbeitrag
this.comboBoxAufgabe.FormattingEnabled = true;
this.comboBoxAufgabe.Location = new System.Drawing.Point(13, 498);
this.comboBoxAufgabe.Name = "comboBoxAufgabe";
this.comboBoxAufgabe.Size = new System.Drawing.Size(263, 33);
this.comboBoxAufgabe.Size = new System.Drawing.Size(263, 37);
this.comboBoxAufgabe.TabIndex = 41;
this.comboBoxAufgabe.SelectedIndexChanged += new System.EventHandler(this.ComboBoxAufgabe_SelectedIndexChanged);
this.comboBoxAufgabe.DropDownClosed += new System.EventHandler(this.ComboBoxAufgabe_DropDownClosed);
@ -331,7 +331,7 @@ namespace Deckungsbeitrag
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(9, 475);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(152, 25);
this.label2.Size = new System.Drawing.Size(183, 29);
this.label2.TabIndex = 42;
this.label2.Text = "Kundenaufgabe";
//
@ -341,14 +341,14 @@ namespace Deckungsbeitrag
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.nächsterKundeToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(217, 28);
this.contextMenuStrip1.Size = new System.Drawing.Size(250, 36);
//
// nächsterKundeToolStripMenuItem
//
this.nächsterKundeToolStripMenuItem.Name = "nächsterKundeToolStripMenuItem";
this.nächsterKundeToolStripMenuItem.ShortcutKeyDisplayString = "[F9]";
this.nächsterKundeToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F9;
this.nächsterKundeToolStripMenuItem.Size = new System.Drawing.Size(216, 24);
this.nächsterKundeToolStripMenuItem.Size = new System.Drawing.Size(249, 32);
this.nächsterKundeToolStripMenuItem.Text = "Nächster Kunde";
this.nächsterKundeToolStripMenuItem.Click += new System.EventHandler(this.NaechsterKundeToolStripMenuItem_Click);
//
@ -376,9 +376,9 @@ namespace Deckungsbeitrag
this.tabPageVorschau.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.tabPageVorschau.Controls.Add(this.buttonSWS_Drucken);
this.tabPageVorschau.Controls.Add(this.pictureBoxEntwurf);
this.tabPageVorschau.Location = new System.Drawing.Point(4, 34);
this.tabPageVorschau.Location = new System.Drawing.Point(4, 38);
this.tabPageVorschau.Name = "tabPageVorschau";
this.tabPageVorschau.Size = new System.Drawing.Size(1001, 734);
this.tabPageVorschau.Size = new System.Drawing.Size(1001, 730);
this.tabPageVorschau.TabIndex = 2;
this.tabPageVorschau.Text = "SWS-Vorschau";
//
@ -389,7 +389,7 @@ namespace Deckungsbeitrag
this.buttonSWS_Drucken.FlatAppearance.BorderSize = 0;
this.buttonSWS_Drucken.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSWS_Drucken.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSWS_Drucken.Location = new System.Drawing.Point(698, 690);
this.buttonSWS_Drucken.Location = new System.Drawing.Point(698, 686);
this.buttonSWS_Drucken.Name = "buttonSWS_Drucken";
this.buttonSWS_Drucken.Size = new System.Drawing.Size(300, 41);
this.buttonSWS_Drucken.TabIndex = 36;
@ -407,7 +407,7 @@ namespace Deckungsbeitrag
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(1001, 684);
this.pictureBoxEntwurf.Size = new System.Drawing.Size(1001, 680);
this.pictureBoxEntwurf.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxEntwurf.TabIndex = 16;
this.pictureBoxEntwurf.TabStop = false;
@ -424,11 +424,11 @@ namespace Deckungsbeitrag
this.tabPageUmsatz.Controls.Add(this.labelJahresumsatz);
this.tabPageUmsatz.Controls.Add(this.chartJahresumsatz);
this.tabPageUmsatz.Controls.Add(this.olvJahresumsatz);
this.tabPageUmsatz.Location = new System.Drawing.Point(4, 34);
this.tabPageUmsatz.Location = new System.Drawing.Point(4, 38);
this.tabPageUmsatz.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageUmsatz.Name = "tabPageUmsatz";
this.tabPageUmsatz.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageUmsatz.Size = new System.Drawing.Size(1001, 734);
this.tabPageUmsatz.Size = new System.Drawing.Size(1001, 730);
this.tabPageUmsatz.TabIndex = 0;
this.tabPageUmsatz.Text = "Umsatz";
//
@ -439,22 +439,22 @@ namespace Deckungsbeitrag
this.labelMonatsumsatz.ForeColor = System.Drawing.Color.White;
this.labelMonatsumsatz.Location = new System.Drawing.Point(615, 53);
this.labelMonatsumsatz.Name = "labelMonatsumsatz";
this.labelMonatsumsatz.Size = new System.Drawing.Size(164, 25);
this.labelMonatsumsatz.Size = new System.Drawing.Size(193, 29);
this.labelMonatsumsatz.TabIndex = 46;
this.labelMonatsumsatz.Text = "Monatsumsätze";
//
// chartMonatsumsatz
//
chartArea13.Name = "ChartArea1";
this.chartMonatsumsatz.ChartAreas.Add(chartArea13);
legend13.Name = "Legend1";
this.chartMonatsumsatz.Legends.Add(legend13);
chartArea1.Name = "ChartArea1";
this.chartMonatsumsatz.ChartAreas.Add(chartArea1);
legend1.Name = "Legend1";
this.chartMonatsumsatz.Legends.Add(legend1);
this.chartMonatsumsatz.Location = new System.Drawing.Point(619, 309);
this.chartMonatsumsatz.Name = "chartMonatsumsatz";
series13.ChartArea = "ChartArea1";
series13.Legend = "Legend1";
series13.Name = "Series1";
this.chartMonatsumsatz.Series.Add(series13);
series1.ChartArea = "ChartArea1";
series1.Legend = "Legend1";
series1.Name = "Series1";
this.chartMonatsumsatz.Series.Add(series1);
this.chartMonatsumsatz.Size = new System.Drawing.Size(299, 312);
this.chartMonatsumsatz.TabIndex = 45;
this.chartMonatsumsatz.Text = "chart1";
@ -495,22 +495,22 @@ namespace Deckungsbeitrag
this.labelQuartalsumsatz.ForeColor = System.Drawing.Color.White;
this.labelQuartalsumsatz.Location = new System.Drawing.Point(309, 53);
this.labelQuartalsumsatz.Name = "labelQuartalsumsatz";
this.labelQuartalsumsatz.Size = new System.Drawing.Size(175, 25);
this.labelQuartalsumsatz.Size = new System.Drawing.Size(207, 29);
this.labelQuartalsumsatz.TabIndex = 43;
this.labelQuartalsumsatz.Text = "Quartalsumsätze";
//
// chartQuartalsumsatz
//
chartArea14.Name = "ChartArea1";
this.chartQuartalsumsatz.ChartAreas.Add(chartArea14);
legend14.Name = "Legend1";
this.chartQuartalsumsatz.Legends.Add(legend14);
chartArea2.Name = "ChartArea1";
this.chartQuartalsumsatz.ChartAreas.Add(chartArea2);
legend2.Name = "Legend1";
this.chartQuartalsumsatz.Legends.Add(legend2);
this.chartQuartalsumsatz.Location = new System.Drawing.Point(313, 309);
this.chartQuartalsumsatz.Name = "chartQuartalsumsatz";
series14.ChartArea = "ChartArea1";
series14.Legend = "Legend1";
series14.Name = "Series1";
this.chartQuartalsumsatz.Series.Add(series14);
series2.ChartArea = "ChartArea1";
series2.Legend = "Legend1";
series2.Name = "Series1";
this.chartQuartalsumsatz.Series.Add(series2);
this.chartQuartalsumsatz.Size = new System.Drawing.Size(300, 312);
this.chartQuartalsumsatz.TabIndex = 42;
this.chartQuartalsumsatz.Text = "chart1";
@ -551,22 +551,22 @@ namespace Deckungsbeitrag
this.labelJahresumsatz.ForeColor = System.Drawing.Color.White;
this.labelJahresumsatz.Location = new System.Drawing.Point(7, 55);
this.labelJahresumsatz.Name = "labelJahresumsatz";
this.labelJahresumsatz.Size = new System.Drawing.Size(159, 25);
this.labelJahresumsatz.Size = new System.Drawing.Size(187, 29);
this.labelJahresumsatz.TabIndex = 40;
this.labelJahresumsatz.Text = "Jahresumsätze";
//
// chartJahresumsatz
//
chartArea15.Name = "ChartArea1";
this.chartJahresumsatz.ChartAreas.Add(chartArea15);
legend15.Name = "Legend1";
this.chartJahresumsatz.Legends.Add(legend15);
chartArea3.Name = "ChartArea1";
this.chartJahresumsatz.ChartAreas.Add(chartArea3);
legend3.Name = "Legend1";
this.chartJahresumsatz.Legends.Add(legend3);
this.chartJahresumsatz.Location = new System.Drawing.Point(7, 309);
this.chartJahresumsatz.Name = "chartJahresumsatz";
series15.ChartArea = "ChartArea1";
series15.Legend = "Legend1";
series15.Name = "Series1";
this.chartJahresumsatz.Series.Add(series15);
series3.ChartArea = "ChartArea1";
series3.Legend = "Legend1";
series3.Name = "Series1";
this.chartJahresumsatz.Series.Add(series3);
this.chartJahresumsatz.Size = new System.Drawing.Size(300, 312);
this.chartJahresumsatz.TabIndex = 39;
this.chartJahresumsatz.Text = "chart1";
@ -605,11 +605,11 @@ namespace Deckungsbeitrag
this.tabPageArtikel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.tabPageArtikel.Controls.Add(this.buttonSpeichern);
this.tabPageArtikel.Controls.Add(this.dGArtikel);
this.tabPageArtikel.Location = new System.Drawing.Point(4, 34);
this.tabPageArtikel.Location = new System.Drawing.Point(4, 38);
this.tabPageArtikel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageArtikel.Name = "tabPageArtikel";
this.tabPageArtikel.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPageArtikel.Size = new System.Drawing.Size(1001, 734);
this.tabPageArtikel.Size = new System.Drawing.Size(1001, 730);
this.tabPageArtikel.TabIndex = 1;
this.tabPageArtikel.Text = "Artikelliste";
//
@ -621,7 +621,7 @@ namespace Deckungsbeitrag
this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSpeichern.ForeColor = System.Drawing.Color.White;
this.buttonSpeichern.Location = new System.Drawing.Point(694, 685);
this.buttonSpeichern.Location = new System.Drawing.Point(694, 681);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(300, 41);
this.buttonSpeichern.TabIndex = 37;
@ -651,7 +651,7 @@ namespace Deckungsbeitrag
this.dGArtikel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dGArtikel.Name = "dGArtikel";
this.dGArtikel.RowHeadersWidth = 51;
this.dGArtikel.Size = new System.Drawing.Size(989, 672);
this.dGArtikel.Size = new System.Drawing.Size(989, 668);
this.dGArtikel.TabIndex = 11;
this.dGArtikel.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.DGArtikel_CellBeginEdit);
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGArtikel_CellValueChanged);
@ -738,9 +738,9 @@ namespace Deckungsbeitrag
// tabPageInventur
//
this.tabPageInventur.Controls.Add(this.tabControlInventur);
this.tabPageInventur.Location = new System.Drawing.Point(4, 34);
this.tabPageInventur.Location = new System.Drawing.Point(4, 38);
this.tabPageInventur.Name = "tabPageInventur";
this.tabPageInventur.Size = new System.Drawing.Size(1001, 734);
this.tabPageInventur.Size = new System.Drawing.Size(1001, 730);
this.tabPageInventur.TabIndex = 3;
this.tabPageInventur.Text = "Inventuren";
this.tabPageInventur.UseVisualStyleBackColor = true;
@ -752,7 +752,7 @@ namespace Deckungsbeitrag
this.tabControlInventur.Location = new System.Drawing.Point(0, 0);
this.tabControlInventur.Name = "tabControlInventur";
this.tabControlInventur.SelectedIndex = 0;
this.tabControlInventur.Size = new System.Drawing.Size(1001, 734);
this.tabControlInventur.Size = new System.Drawing.Size(1001, 730);
this.tabControlInventur.TabIndex = 0;
//
// tabPageNeueInventur
@ -762,10 +762,10 @@ namespace Deckungsbeitrag
this.tabPageNeueInventur.Controls.Add(this.dGVZahlen);
this.tabPageNeueInventur.Controls.Add(this.panelButtons);
this.tabPageNeueInventur.Controls.Add(this.panelDaten);
this.tabPageNeueInventur.Location = new System.Drawing.Point(4, 34);
this.tabPageNeueInventur.Location = new System.Drawing.Point(4, 38);
this.tabPageNeueInventur.Name = "tabPageNeueInventur";
this.tabPageNeueInventur.Padding = new System.Windows.Forms.Padding(3);
this.tabPageNeueInventur.Size = new System.Drawing.Size(993, 696);
this.tabPageNeueInventur.Size = new System.Drawing.Size(993, 688);
this.tabPageNeueInventur.TabIndex = 0;
this.tabPageNeueInventur.Text = "Neue Inventur";
//
@ -782,9 +782,9 @@ namespace Deckungsbeitrag
this.dGVZahlen.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
this.dGVZahlen.RowHeadersWidth = 51;
this.dGVZahlen.RowTemplate.Height = 24;
this.dGVZahlen.Size = new System.Drawing.Size(977, 524);
this.dGVZahlen.Size = new System.Drawing.Size(977, 516);
this.dGVZahlen.TabIndex = 3;
this.dGVZahlen.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGVZahlen_CellEndEdit);
this.dGVZahlen.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGVZahlen_CellEndEdit);
this.dGVZahlen.MouseDown += new System.Windows.Forms.MouseEventHandler(this.DGVZahlen_MouseDown);
//
// contextMenuStripGridView
@ -793,23 +793,23 @@ namespace Deckungsbeitrag
this.contextMenuStripGridView.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.deleteRowToolStripMenuItem});
this.contextMenuStripGridView.Name = "contextMenuStripGridView";
this.contextMenuStripGridView.Size = new System.Drawing.Size(173, 30);
this.contextMenuStripGridView.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripGridView_Opening);
this.contextMenuStripGridView.Size = new System.Drawing.Size(194, 36);
this.contextMenuStripGridView.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripGridView_Opening);
//
// deleteRowToolStripMenuItem
//
this.deleteRowToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("deleteRowToolStripMenuItem.Image")));
this.deleteRowToolStripMenuItem.Name = "deleteRowToolStripMenuItem";
this.deleteRowToolStripMenuItem.Size = new System.Drawing.Size(172, 26);
this.deleteRowToolStripMenuItem.Size = new System.Drawing.Size(193, 32);
this.deleteRowToolStripMenuItem.Text = "Zeile Löschen";
this.deleteRowToolStripMenuItem.Click += new System.EventHandler(this.DeleteRowToolStripMenuItem_Click);
//
// panelButtons
//
this.panelButtons.Controls.Add(this.buttonFreigeben);
this.panelButtons.Controls.Add(this.buttonAbbrechen);
this.panelButtons.Controls.Add(this.buttonDelete);
this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtons.Location = new System.Drawing.Point(3, 639);
this.panelButtons.Location = new System.Drawing.Point(3, 631);
this.panelButtons.Name = "panelButtons";
this.panelButtons.Padding = new System.Windows.Forms.Padding(5);
this.panelButtons.Size = new System.Drawing.Size(983, 50);
@ -833,22 +833,24 @@ namespace Deckungsbeitrag
this.buttonFreigeben.Text = "Speichern/Freigeben";
this.buttonFreigeben.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonFreigeben.UseVisualStyleBackColor = false;
this.buttonFreigeben.Click += new System.EventHandler(this.ButtonFreigeben_Click);
//
// buttonAbbrechen
// buttonDelete
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.Black;
this.buttonAbbrechen.Location = new System.Drawing.Point(728, 5);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(250, 40);
this.buttonAbbrechen.TabIndex = 42;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonDelete.BackColor = System.Drawing.Color.Red;
this.buttonDelete.FlatAppearance.BorderSize = 0;
this.buttonDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonDelete.ForeColor = System.Drawing.Color.Black;
this.buttonDelete.Location = new System.Drawing.Point(728, 5);
this.buttonDelete.Margin = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.buttonDelete.Name = "buttonDelete";
this.buttonDelete.Size = new System.Drawing.Size(250, 40);
this.buttonDelete.TabIndex = 42;
this.buttonDelete.Text = "Löschen";
this.buttonDelete.UseVisualStyleBackColor = false;
this.buttonDelete.Click += new System.EventHandler(this.ButtonDelete_Click);
//
// panelDaten
//
@ -870,7 +872,7 @@ namespace Deckungsbeitrag
this.labelAddRow.AutoSize = true;
this.labelAddRow.Location = new System.Drawing.Point(765, 63);
this.labelAddRow.Name = "labelAddRow";
this.labelAddRow.Size = new System.Drawing.Size(161, 25);
this.labelAddRow.Size = new System.Drawing.Size(195, 29);
this.labelAddRow.TabIndex = 42;
this.labelAddRow.Text = "Zeile hinzufügen:";
//
@ -893,7 +895,7 @@ namespace Deckungsbeitrag
this.labelLiefertag.AutoSize = true;
this.labelLiefertag.Location = new System.Drawing.Point(18, 63);
this.labelLiefertag.Name = "labelLiefertag";
this.labelLiefertag.Size = new System.Drawing.Size(93, 25);
this.labelLiefertag.Size = new System.Drawing.Size(113, 29);
this.labelLiefertag.TabIndex = 3;
this.labelLiefertag.Text = "Liefertag:";
//
@ -902,7 +904,7 @@ namespace Deckungsbeitrag
this.labelInventur.AutoSize = true;
this.labelInventur.Location = new System.Drawing.Point(18, 13);
this.labelInventur.Name = "labelInventur";
this.labelInventur.Size = new System.Drawing.Size(142, 25);
this.labelInventur.Size = new System.Drawing.Size(169, 29);
this.labelInventur.TabIndex = 2;
this.labelInventur.Text = "Inventurdatum:";
//
@ -913,8 +915,9 @@ namespace Deckungsbeitrag
this.dateTimePickerLiefertag.Location = new System.Drawing.Point(166, 60);
this.dateTimePickerLiefertag.Name = "dateTimePickerLiefertag";
this.dateTimePickerLiefertag.ShowCheckBox = true;
this.dateTimePickerLiefertag.Size = new System.Drawing.Size(200, 30);
this.dateTimePickerLiefertag.Size = new System.Drawing.Size(200, 35);
this.dateTimePickerLiefertag.TabIndex = 1;
this.dateTimePickerLiefertag.ValueChanged += new System.EventHandler(this.DateTimePicker_ValueChanged);
//
// dateTimePickerInventur
//
@ -923,8 +926,9 @@ namespace Deckungsbeitrag
this.dateTimePickerInventur.Location = new System.Drawing.Point(166, 11);
this.dateTimePickerInventur.Name = "dateTimePickerInventur";
this.dateTimePickerInventur.ShowCheckBox = true;
this.dateTimePickerInventur.Size = new System.Drawing.Size(200, 30);
this.dateTimePickerInventur.Size = new System.Drawing.Size(200, 35);
this.dateTimePickerInventur.TabIndex = 0;
this.dateTimePickerInventur.ValueChanged += new System.EventHandler(this.DateTimePicker_ValueChanged);
//
// buttonNextKunde
//
@ -948,7 +952,7 @@ namespace Deckungsbeitrag
this.label3.ForeColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(9, 336);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 25);
this.label3.Size = new System.Drawing.Size(94, 29);
this.label3.TabIndex = 47;
this.label3.Text = "Service";
//
@ -959,7 +963,7 @@ namespace Deckungsbeitrag
this.comboBoxService.Location = new System.Drawing.Point(13, 361);
this.comboBoxService.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.comboBoxService.Name = "comboBoxService";
this.comboBoxService.Size = new System.Drawing.Size(315, 33);
this.comboBoxService.Size = new System.Drawing.Size(315, 37);
this.comboBoxService.TabIndex = 48;
this.comboBoxService.SelectedValueChanged += new System.EventHandler(this.ComboBoxService_SelectedValueChanged);
//
@ -984,7 +988,7 @@ namespace Deckungsbeitrag
this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(9, 529);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(135, 25);
this.label4.Size = new System.Drawing.Size(162, 29);
this.label4.TabIndex = 51;
this.label4.Text = "Anmerkungen";
//
@ -995,7 +999,7 @@ namespace Deckungsbeitrag
this.labelAnzahlChars.ForeColor = System.Drawing.Color.White;
this.labelAnzahlChars.Location = new System.Drawing.Point(312, 532);
this.labelAnzahlChars.Name = "labelAnzahlChars";
this.labelAnzahlChars.Size = new System.Drawing.Size(68, 20);
this.labelAnzahlChars.Size = new System.Drawing.Size(84, 25);
this.labelAnzahlChars.TabIndex = 52;
this.labelAnzahlChars.Text = "000/000";
//
@ -1009,7 +1013,7 @@ namespace Deckungsbeitrag
0,
0});
this.numericUpDownAufgabeCount.Name = "numericUpDownAufgabeCount";
this.numericUpDownAufgabeCount.Size = new System.Drawing.Size(46, 34);
this.numericUpDownAufgabeCount.Size = new System.Drawing.Size(46, 40);
this.numericUpDownAufgabeCount.TabIndex = 53;
this.numericUpDownAufgabeCount.ValueChanged += new System.EventHandler(this.NumericUpDownAufgabeCount_ValueChanged);
this.numericUpDownAufgabeCount.Leave += new System.EventHandler(this.NumericUpDownAufgabeCount_Leave);
@ -1021,7 +1025,7 @@ namespace Deckungsbeitrag
this.comboBoxLRSommer.Location = new System.Drawing.Point(13, 435);
this.comboBoxLRSommer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.comboBoxLRSommer.Name = "comboBoxLRSommer";
this.comboBoxLRSommer.Size = new System.Drawing.Size(170, 33);
this.comboBoxLRSommer.Size = new System.Drawing.Size(170, 37);
this.comboBoxLRSommer.TabIndex = 55;
this.comboBoxLRSommer.SelectedIndexChanged += new System.EventHandler(this.ComboBoxLieferrhythmus_SelectedIndexChanged);
//
@ -1032,7 +1036,7 @@ namespace Deckungsbeitrag
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(9, 397);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(140, 25);
this.label5.Size = new System.Drawing.Size(170, 29);
this.label5.TabIndex = 54;
this.label5.Text = "Lieferrhythmus";
//
@ -1043,7 +1047,7 @@ namespace Deckungsbeitrag
this.comboBoxLRWinter.Location = new System.Drawing.Point(195, 435);
this.comboBoxLRWinter.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.comboBoxLRWinter.Name = "comboBoxLRWinter";
this.comboBoxLRWinter.Size = new System.Drawing.Size(170, 33);
this.comboBoxLRWinter.Size = new System.Drawing.Size(170, 37);
this.comboBoxLRWinter.TabIndex = 56;
this.comboBoxLRWinter.SelectedIndexChanged += new System.EventHandler(this.ComboBoxLieferrhythmus_SelectedIndexChanged);
//
@ -1054,7 +1058,7 @@ namespace Deckungsbeitrag
this.label6.ForeColor = System.Drawing.Color.White;
this.label6.Location = new System.Drawing.Point(10, 417);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(60, 17);
this.label6.Size = new System.Drawing.Size(72, 20);
this.label6.TabIndex = 57;
this.label6.Text = "Sommer";
//
@ -1065,7 +1069,7 @@ namespace Deckungsbeitrag
this.label7.ForeColor = System.Drawing.Color.White;
this.label7.Location = new System.Drawing.Point(192, 417);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(49, 17);
this.label7.Size = new System.Drawing.Size(58, 20);
this.label7.TabIndex = 58;
this.label7.Text = "Winter";
//
@ -1106,7 +1110,7 @@ namespace Deckungsbeitrag
this.checkBoxNW.ForeColor = System.Drawing.Color.White;
this.checkBoxNW.Location = new System.Drawing.Point(297, 152);
this.checkBoxNW.Name = "checkBoxNW";
this.checkBoxNW.Size = new System.Drawing.Size(68, 29);
this.checkBoxNW.Size = new System.Drawing.Size(79, 33);
this.checkBoxNW.TabIndex = 59;
this.checkBoxNW.Text = "NW";
this.checkBoxNW.UseVisualStyleBackColor = true;
@ -1268,7 +1272,7 @@ namespace Deckungsbeitrag
private System.Windows.Forms.DateTimePicker dateTimePickerInventur;
private System.Windows.Forms.Label labelLiefertag;
private System.Windows.Forms.Panel panelButtons;
private System.Windows.Forms.Button buttonAbbrechen;
private System.Windows.Forms.Button buttonDelete;
private System.Windows.Forms.Button buttonFreigeben;
private System.Windows.Forms.Label labelAddRow;
private System.Windows.Forms.PictureBox pictureBoxPlus;

View File

@ -120,80 +120,47 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>430, 17</value>
</metadata>
<metadata name="KundeArtikelID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KundeID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelNR.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Stand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Fehlmenge.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Reklamation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Korrektur.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StandBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FehlmengeBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KorrekturBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenuStripGridView.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>615, 17</value>
</metadata>
<metadata name="KundeArtikelID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KundeID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelNR.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Stand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Fehlmenge.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Reklamation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Korrektur.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StandBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FehlmengeBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KorrekturBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KundeArtikelID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KundeID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelNR.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ArtikelName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Stand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Fehlmenge.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Reklamation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Korrektur.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StandBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FehlmengeBearbeitet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<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="deleteRowToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wgAADsIBFShKgAAAALlJREFUOE+tkrERwjAMRbMAa1CnpHZNwQgUbMBEdFBmhCxjoIrdqBX3fZFPFsEO
vQAADr0BR/uQrQAAALlJREFUOE+tkrERwjAMRbMAa1CnpHZNwQgUbMBEdFBmhCxjoIrdqBX3fZFPFsEO
HMU7y+f8Z8mXjpm7GkTUE1GYQV3s8QE3COP5xAB1ePg47Hd5nwTOuUVwFp93RuCy3aSQ1FgLQZhigQiI
6KglEkYneYSGoJe2RSDtrxLo27HqcZpvAIbbNQchE+GbwHagmbxPIv0mzREsMtL8bxwQRv2TQNN8A01V
8OlGy9cCG7D8T7DEakENG7C8AEMBEFYEw8flAAAAAElFTkSuQmCC

View File

@ -1,6 +1,7 @@
using AForge.Video;
using AForge.Video.DirectShow;
using DatenDB;
using Deckungsbeitrag.AA_Klassen;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -33,7 +34,7 @@ namespace Deckungsbeitrag
public Auftrag auftrag;
private List<Kunde> Kundenliste;
private readonly List<Auftrag> Auftragliste;
private readonly List<Auftrag> Finishingliste;
private readonly List<View_Auftrag_Expedit> Finishingliste;
private readonly Meldungen meldung = new Meldungen();
readonly int type_of_list;
readonly string ben_col = "Vorname,Nachname,Benutzername,Rolle,Schein,Gueltig bis,Aktiv";
@ -43,7 +44,7 @@ namespace Deckungsbeitrag
public Timer timer;
private readonly string kndService;
private QwertzKeyboard keyboard;
private ArtikelKategorie kategorie = 0;
#region Form-Konstruktor
@ -51,7 +52,7 @@ namespace Deckungsbeitrag
{
InitializeComponent();
}
public FormListe(List<object> objliste, int listentyp) : this()
public FormListe(List<View_Auftrag_Expedit> objliste, int listentyp) : this()
{
// Welcher Listentyp angezeigt wird muss beim Öffnen mitgegeben werden.
this.type_of_list = listentyp;
@ -64,14 +65,18 @@ namespace Deckungsbeitrag
if (objliste != null)
{
this.type_of_list = (int)Listentyp.Finishingliste;
this.Finishingliste = objliste.Cast<Auftrag>().ToList();
this.Finishingliste = objliste;
}
}
}
public FormListe(List<object> objliste, int listentyp, string kndService) : this(objliste, listentyp)
public FormListe(List<View_Auftrag_Expedit> objliste, int listentyp, string kndService) : this(objliste, listentyp)
{
this.kndService = kndService;
}
public FormListe(List<View_Auftrag_Expedit> objliste, int listentyp, ArtikelKategorie _kategorie) : this(objliste, listentyp)
{
this.kategorie = _kategorie;
}
#endregion
private void FormListe_Load(object sender, EventArgs e)
@ -84,7 +89,6 @@ namespace Deckungsbeitrag
ListViewKunde_Load();
this.textBoxKunde.Focus();
this.CenterToScreen();
}
private void FormListe_Shown(object sender, EventArgs e)
@ -93,11 +97,11 @@ namespace Deckungsbeitrag
}
private void ListViewKunde_Load()
{
//LISTE LEEREN
// LISTE LEEREN
this.listViewKunde.Items.Clear();
this.listViewKunde.Columns.Clear();
//SWITCH NACH LISTENTYP
// SWITCH NACH LISTENTYP
switch (type_of_list)
{
case var _ when type_of_list == (int)Listentyp.Kundenliste:
@ -235,9 +239,10 @@ namespace Deckungsbeitrag
}
//KUNDEN LADEN
this.Text = "KUNDE WÄHLEN";
foreach (Auftrag a in this.Finishingliste)
foreach (View_Auftrag_Expedit a in this.Finishingliste)
{
Kunde knd = Kunde.GetKunde(null, a.KundeID, null);
Kunde knd = Kunde.GetKunde(null, a.KundeID, null);
ListViewItem item = new ListViewItem
{
@ -252,7 +257,7 @@ namespace Deckungsbeitrag
}
if (listViewKunde.Items.Count == 1)
{
auftrag = (Auftrag)listViewKunde.Items[0].Tag;
auftrag = Auftrag.GetAuftrag(((View_Auftrag_Expedit)listViewKunde.Items[0].Tag).AuftragID);
this.DialogResult = DialogResult.OK;
this.Close();
}
@ -301,11 +306,30 @@ namespace Deckungsbeitrag
default:
break;
}
ListViewKunde_Design();
//Funktionen.Columns_Resize(this.listViewKunde);
//this.Size = new Size(this.listViewKunde.Width + 70, this.Height);
}
private void FillListView(List<View_Auftrag_Expedit> items)
{
listViewKunde.BeginUpdate();
listViewKunde.Items.Clear();
foreach (var item in items)
{
Kunde knd = Kunde.GetKunde(null, item.KundeID, null);
var lvi = new ListViewItem(knd.KundeNummer);
lvi.SubItems.Add(knd.Suchtext);
lvi.SubItems.Add(knd.KundeName);
lvi.SubItems.Add(knd.Ort);
lvi.Tag = item;
listViewKunde.Items.Add(lvi);
}
listViewKunde.EndUpdate();
}
private void ListViewKunde_Design()
{
int lvwWidth = 0;
@ -325,8 +349,32 @@ namespace Deckungsbeitrag
}
private void TextBoxKunde_Enter(object sender, EventArgs e)
{
if (this.benutzer != null && this.benutzer.Rolle == BenutzerRolle.Fahrer)
{
this.textBoxKunde.ForeColor = Color.Black;
this.textBoxKunde.Clear();
}
}
private void TextBoxKunde_Click(object sender, EventArgs e)
{
this.textBoxKunde.ForeColor = Color.Black;
this.textBoxKunde.Clear();
this.textBoxKunde.Clear();
if (Program.istTouch & Screen.PrimaryScreen.WorkingArea.Width > 0 & Screen.PrimaryScreen.WorkingArea.Width < 2000)
{
if (keyboard == null || keyboard.IsDisposed)
{
keyboard = new QwertzKeyboard(textBoxKunde, "isAlpha");
if (keyboard.ShowDialog() == DialogResult.OK) this.ActiveControl.Focus();
}
else
{
keyboard.Close();
keyboard = new QwertzKeyboard(textBoxKunde, "isAlpha");
if (keyboard.ShowDialog() == DialogResult.OK) this.ActiveControl.Focus();
}
}
}
private void TextBoxKunde_TextChanged(object sender, EventArgs e)
{
@ -334,38 +382,52 @@ namespace Deckungsbeitrag
timer.Stop(); // Alten Timer beenden
timer.Start(); // Neuen Timer starten
}
private void Timer_Tick(object sender, EventArgs e)
private async void Timer_Tick(object sender, EventArgs e)
{
timer.Stop(); // Timer stoppen
if (string.IsNullOrEmpty(textBoxKunde.Text)) { return; }
if (textBoxKunde.ForeColor != Color.Black & !this.textBoxKunde.Text.StartsWith("https")) { return; }
else TextBoxKunde_Leave(textBoxKunde, e);
//// Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt.
//if (!textBoxKunde.Text.StartsWith("?"))
//{
// string text;
// if (textBoxKunde.Text.StartsWith("http"))
// {
// int index = 1;
// index += textBoxKunde.Text.IndexOf("=", index);
// int i = textBoxKunde.Text.IndexOf("%", index);
// text = textBoxKunde.Text.Substring(index, i - index);
// textBoxKunde.Text = text;
// }
// else text = this.textBoxKunde.Text;
// Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt.
if (!textBoxKunde.Text.StartsWith("?"))
{
string text;
if (textBoxKunde.Text.StartsWith("http"))
{
int index = 1;
index += textBoxKunde.Text.IndexOf("=", index);
int i = textBoxKunde.Text.IndexOf("%", index);
text = textBoxKunde.Text.Substring(index, i - index);
textBoxKunde.Text = text;
}
else text = this.textBoxKunde.Text;
// if (kategorie == 0)
// {
// this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
// ListViewKunde_Load();
// }
// else
// {
// List<View_Auftrag_Expedit> _allÍtems = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, typFilter: AuftragTyp.Standart, kategorie: kategorie, undFertig: true);
// string term = text.Trim().ToLower();
// if (!string.IsNullOrWhiteSpace(term))
// {
// var filtered = string.IsNullOrWhiteSpace(term) ? _allÍtems : _allÍtems.Where(x => x.KundeName != null && x.KundeName.ToLower().Contains(term)).ToList();
// FillListView(filtered);
// }
// else FillListView(_allÍtems);
// }
// return;
//}
this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
ListViewKunde_Load();
return;
}
// Wenn Fragezeichen am Anfang wird OK-Button aktiviert.
if (textBoxKunde.Text.StartsWith("?"))
{
this.listViewKunde.Visible = this.listViewKunde.Enabled = false;
this.buttonOK.Visible = this.buttonOK.Enabled = true;
this.Height = this.buttonOK.Bottom + 100;
}
//// Wenn Fragezeichen am Anfang wird OK-Button aktiviert.
//if (textBoxKunde.Text.StartsWith("?"))
//{
// this.listViewKunde.Visible = this.listViewKunde.Enabled = false;
// this.buttonOK.Visible = this.buttonOK.Enabled = true;
// this.Height = this.buttonOK.Bottom + 100;
//}
}
private void ListViewKunde_MouseClick(object sender, MouseEventArgs e)
@ -387,7 +449,7 @@ namespace Deckungsbeitrag
this.Close();
break;
case var _ when type_of_list == (int)Listentyp.Finishingliste:
auftrag = (Auftrag)item.Tag;
auftrag = Auftrag.GetAuftrag(((View_Auftrag_Expedit)item.Tag).AuftragID);
this.DialogResult = DialogResult.OK;
this.Close();
break;
@ -462,9 +524,9 @@ namespace Deckungsbeitrag
this.DialogResult = DialogResult.OK;
this.Close();
}
private void TextBoxKunde_Leave(object sender, EventArgs e)
private async void TextBoxKunde_Leave(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxKunde.Text)) { return; }
if (string.IsNullOrEmpty(textBoxKunde.Text) || this.textBoxKunde.Text == "Hier eingeben") { return; }
// Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt.
if (!textBoxKunde.Text.StartsWith("?"))
@ -480,8 +542,22 @@ namespace Deckungsbeitrag
}
else text = this.textBoxKunde.Text;
this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
ListViewKunde_Load();
if (kategorie == 0)
{
this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
ListViewKunde_Load();
}
else
{
List<View_Auftrag_Expedit> _allÍtems = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, typFilter: AuftragTyp.Standart, kategorie: kategorie, undFertig: true);
string term = text.Trim().ToLower();
if (!string.IsNullOrWhiteSpace(term))
{
var filtered = string.IsNullOrWhiteSpace(term) ? _allÍtems : _allÍtems.Where(x => x.KundeName != null && x.KundeName.ToLower().Contains(term)).ToList();
FillListView(filtered);
}
else FillListView(_allÍtems);
}
return;
}
@ -506,23 +582,5 @@ namespace Deckungsbeitrag
{
if (keyboard != null) keyboard.Close();
}
private void TextBoxKunde_Click(object sender, EventArgs e)
{
if (Program.istTouch & Screen.PrimaryScreen.WorkingArea.Width > 0 & Screen.PrimaryScreen.WorkingArea.Width < 2000)
{
if (keyboard == null || keyboard.IsDisposed)
{
keyboard = new QwertzKeyboard(textBoxKunde, "isAlpha");
if (keyboard.ShowDialog() == DialogResult.OK) this.ActiveControl.Focus();
}
else
{
keyboard.Close();
keyboard = new QwertzKeyboard(textBoxKunde, "isAlpha");
if (keyboard.ShowDialog() == DialogResult.OK) this.ActiveControl.Focus();
}
}
}
}
}

View File

@ -52,7 +52,6 @@ namespace Deckungsbeitrag
private OnboardingSchritt onBoardingArt = OnboardingSchritt.Main;
private UCStatistik uCStatistik;
private UCAuftragSuchen uCAuftrag;
private UCInventur uCInventur;
private readonly Screen screen = Screen.PrimaryScreen;
private Kunde kunde;
private Tour tour;
@ -101,7 +100,7 @@ namespace Deckungsbeitrag
// Inventuren sind ausschließlich für Admin, Verwaltung oder Master sichtbar.
if (this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Master)
{
GetInventuren();
//GetInventuren();
GetSaison();
}
else
@ -128,8 +127,6 @@ namespace Deckungsbeitrag
GetUserControls();
// Controls werde Enabled
Enable_Controls();
// Location für UCInventur festlegen.
Get_UCInventur_Location();
this.Activate();
@ -281,7 +278,7 @@ namespace Deckungsbeitrag
private void TSBExpedit_Click(object sender, EventArgs e)
{
FormExpedit exp = new FormExpedit(benutzer);
exp.ShowDialog();
exp.Show();
}
private void TSBAuftragVW_Click(object sender, EventArgs e)
{
@ -342,7 +339,7 @@ namespace Deckungsbeitrag
private void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, AuftragTyp.Standart);
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
neuerAuftrag.ShowDialog();
}
private void ButtonScannTest_Click(object sender, EventArgs e)
{
@ -505,7 +502,7 @@ namespace Deckungsbeitrag
private void buttonSonderAuftrag_Click(object sender, EventArgs e)
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.benutzer, null);
if (neuerAuftrag.ShowDialog() == DialogResult.Abort) { this.kunde = neuerAuftrag.kunde; GetNeueInventur(); }
neuerAuftrag.ShowDialog();
}
#endregion
@ -1040,76 +1037,6 @@ namespace Deckungsbeitrag
}
#endregion
private void GetNeueInventur()
{
if (this.kunde == null)
{
FormListe liste = new FormListe(null, (int)Listentyp.Reklamationliste, "Miete");
if (liste.ShowDialog() == DialogResult.OK)
{
this.kunde = liste.kunde;
}
}
uCInventur = new UCInventur(this.kunde, this.benutzer);
uCInventur.UCInventur_Update += () => { this.GetInventuren(); };
uCInventur.UCInventur_Delete += Do_UCInventur_Delete;
this.panelMain.Controls.Add(uCInventur);
uCInventur.Location = new Point(100, 100);
uCInventur.BringToFront();
RegisterDragEvents(uCInventur);
}
private async void GetInventuren()
{
foreach (UCInventur uci in panelMain.Controls.OfType<UCInventur>())
{
this.panelMain.Controls.Remove(uci);
}
string loadPath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") loadPath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
// Alle "Warten" Inventur Files auflisten.
string[] invFiles = Directory.GetFiles(loadPath, "Warten-*.csv");
if (invFiles.Length == 0) return;
int i = 0;
foreach (string s in invFiles)
{
i++;
// 1. alle Zeilen lesen
string[] lines = File.ReadAllLines(Path.Combine(loadPath, s), Encoding.UTF8);
// 2. an UCInventur übergeben
uCInventur = new UCInventur(lines, this.benutzer, this)
{
Visible = false,
Name = $"uci_{i}"
};
uCInventur.UCInventur_Update += () => { this.GetInventuren(); };
uCInventur.UCInventur_Delete += Do_UCInventur_Delete;
this.panelMain.Controls.Add(uCInventur);
}
//Get_UCInventur_Location();
}
private void Do_UCInventur_Delete()
{
this.panelMain.Controls.Remove(uCInventur);
}
private void Get_UCInventur_Location()
{
// UCInventur in den Vordergrund bringen und Location setzen.
int y = panelMain.Controls["feedback"].Bottom + 10;
foreach (UCInventur uci in panelMain.Controls.OfType<UCInventur>())
{
int x = panelMain.Width - uCInventur.Width - 10;
uci.Visible = true;
uci.BringToFront();
uci.Location = new Point(x, y);
y += uci.Height;
}
}
private async void ZeigeOnboarding()
{

View File

@ -58,6 +58,7 @@ namespace Deckungsbeitrag
}
}
aufgabe.Save();
this.Close();
}
private void buttonAbbrechen_Click(object sender, EventArgs e)
{

View File

@ -19,6 +19,7 @@ using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Web.Caching;
using System.Web.UI.WebControls.WebParts;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
@ -212,10 +213,29 @@ namespace Deckungsbeitrag
{
this.SuspendLayout();
this.comboBoxTyp.SelectedValueChanged -= ComboBoxTyp_SelectedValueChanged;
// Items werden von AuftragTyp geladen.
this.comboBoxTyp.DataSource = Enum.GetValues(typeof(AuftragTyp));
this.comboBoxTyp.DropDownWidth = GetDropDownWidth(this.comboBoxTyp);
// Wenn der Kunde ein Geschäftskunde ist, wird AuftragTyp.Geschäft ausgewählt. Andernfalls wird der AuftragTyp aus dem Konstruktor gewählt.
List<AuftragTyp> allowedValues = new List<AuftragTyp>();
switch (this.benutzer.Rolle)
{
case BenutzerRolle.Verwaltung:
allowedValues = new List<AuftragTyp>() { AuftragTyp.Geschäft, AuftragTyp.Standart, AuftragTyp.SOLL_Erhoehung, AuftragTyp.IST_Erhoehung, AuftragTyp.SOLL_Verminderung, AuftragTyp.Regelmäßig, AuftragTyp.AufAbruf, AuftragTyp.Laufzettel};
break;
case BenutzerRolle.Fahrer:
allowedValues = new List<AuftragTyp>() { AuftragTyp.AufAbruf, AuftragTyp.Standart };
break;
case BenutzerRolle.Admin:
allowedValues = new List<AuftragTyp>() { AuftragTyp.Geschäft, AuftragTyp.Standart, AuftragTyp.SOLL_Erhoehung, AuftragTyp.IST_Erhoehung, AuftragTyp.SOLL_Verminderung, AuftragTyp.Regelmäßig, AuftragTyp.AufAbruf, AuftragTyp.Laufzettel };
break;
case BenutzerRolle.Master:
allowedValues = new List<AuftragTyp>() { AuftragTyp.Geschäft, AuftragTyp.Standart, AuftragTyp.SOLL_Erhoehung, AuftragTyp.IST_Erhoehung, AuftragTyp.SOLL_Verminderung, AuftragTyp.Regelmäßig, AuftragTyp.AufAbruf, AuftragTyp.Laufzettel };
break;
case BenutzerRolle.Expedit:
allowedValues = new List<AuftragTyp>() { AuftragTyp.Geschäft, AuftragTyp.Standart };
break;
}
this.comboBoxTyp.DataSource = allowedValues;
this.comboBoxTyp.SelectedValueChanged += ComboBoxTyp_SelectedValueChanged;
if (this.auftragtyp == null) this.comboBoxTyp.SelectedIndex = -1;
@ -301,7 +321,7 @@ namespace Deckungsbeitrag
break;
case AuftragTyp.Regelmäßig:
this.textBoxText.Visible = false;
this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.comboBoxRhythmus.Enabled = this.panelRegAuftrag.Enabled = this.panelRegAuftrag.Visible = true;
this.pictureBoxPlus.Enabled = this.pictureBoxMinus.Enabled = this.textBoxCont.Enabled = false;
this.labelText.Text = "Rhythmus:";
this.Width = this.panelRegAuftrag.Right + 25;
@ -339,7 +359,7 @@ namespace Deckungsbeitrag
this.Width = textBoxKundeName.Right + 30;
this.Height = 470;
}
//PanelRegAuftrag_EnabledChanged(this.panelRegAuftrag, null);
PanelRegAuftrag_EnabledChanged(this.panelRegAuftrag, null);
}
else
{
@ -376,8 +396,13 @@ namespace Deckungsbeitrag
if (meldung.GetFrage(this, "Möchtest du den Auftrag wirklich einer anderen Tour zuteilen?", false) == DialogResult.No) { ((ComboBox)sender).SelectedIndex = -1; e.Cancel = true; }
else
{
//TODO: CustomInputBox einrichten.
eingabe = Interaction.InputBox("Warum möchtest du den Auftrag einem anderen Fahrer zuteilen?\n\nGrund:", "Sonderzuteilung", "");
CustomInputBox inputBox = new CustomInputBox("Warum möchtest du den Auftrag einem anderen Fahrer zuteilen?", "SONDERZUTEILUNG", "Grund", "isAlpha");
if (inputBox.ShowDialog() == DialogResult.OK)
{
eingabe = inputBox.text;
}
else return;
if (string.IsNullOrWhiteSpace(eingabe)) e.Cancel = true;
}
}
@ -550,33 +575,88 @@ namespace Deckungsbeitrag
string artname = string.Empty;
string anzahl = string.Empty;
UCArtikel uca;
CustomInputBox inputBox = new CustomInputBox("Möchtest du einen individuellen Artikel eingeben?", "ARTIKELNAME", "Artikelname", "isAlpha");
if (inputBox.ShowDialog() == DialogResult.OK) artname = inputBox.text;
else return;
if (!string.IsNullOrWhiteSpace(artname))
if (comboBoxTyp.SelectedIndex == -1) return;
if ((AuftragTyp)comboBoxTyp.SelectedValue == AuftragTyp.SOLL_Erhoehung)
{
inputBox = new CustomInputBox("Wieviel Stück sollen geliefert oder eingezogen werden?", "ARTIKELANZAHL", "Anzahl", "isNumeric");
if (inputBox.ShowDialog() == DialogResult.OK)
FormArtikelVW artikelVW = new FormArtikelVW(this.benutzer, AuftragTyp.SOLL_Erhoehung);
if (artikelVW.ShowDialog() == DialogResult.OK)
{
artAnzahl = int.Parse(inputBox.text);
var art = artikelVW.artikel;
if (MessageBox.Show($"Möchtest du den Artikel {art.Bezeichnung} dem Kundensortiment hinzufügen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
List<KundeArtikel> _kndartList = KundeArtikel.GetList(this.kunde.KundeID.ToString());
if (_kndartList.Count > 0)
{
foreach (KundeArtikel item in _kndartList)
{
if (item.ArtikelID.Equals(art.ArtikelID))
{
MessageBox.Show($"Der Artikel {art.Bezeichnung} ist bereits im Kundensortiment und kann nicht hinzugefügt werden.", "FEHLER", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
CustomInputBox inputBox = new CustomInputBox("Wieviel Stück sollen geliefert oder eingezogen werden?", "ARTIKELANZAHL", "Anzahl", "isNumeric");
if (inputBox.ShowDialog() == DialogResult.OK)
{
artAnzahl = int.Parse(inputBox.text);
}
else return;
KundeArtikel kndart;
if (art is Artikel)
{
kndart = new KundeArtikel()
{
ArtikelID = art.ArtikelID,
ArtikelName = art.Bezeichnung,
ArtikelNR = art.Nummer,
KundeID = this.kunde.KundeID,
Stand = artAnzahl,
};
kndart.Save();
uca = new UCArtikel(kndart, artAnzahl)
{
Width = fLPArtikel.Width - 25
};
uca.DeleteClicked += Uca_DeleteClicked;
this.fLPArtikel.Controls.Add(uca);
}
}
else return;
}
var art = new Artikel()
else
{
Bezeichnung = artname,
Nummer = 0000
};
//CustomInputBox inputBox = new CustomInputBox("Möchtest du einen individuellen Artikel eingeben?", "ARTIKELNAME", "Artikelname", "isAlpha");
//if (inputBox.ShowDialog() == DialogResult.OK) artname = inputBox.text;
//else return;
uca = new UCArtikel(art, artAnzahl)
{
Width = fLPArtikel.Width - 25
};
uca.DeleteClicked += Uca_DeleteClicked;
this.fLPArtikel.Controls.Add(uca);
//if (!string.IsNullOrWhiteSpace(artname))
//{
// inputBox = new CustomInputBox("Wieviel Stück sollen geliefert oder eingezogen werden?", "ARTIKELANZAHL", "Anzahl", "isNumeric");
// if (inputBox.ShowDialog() == DialogResult.OK)
// {
// artAnzahl = int.Parse(inputBox.text);
// }
// else return;
//}
//var art = new Artikel()
//{
// Bezeichnung = artname,
// Nummer = 0000
//};
//uca = new UCArtikel(art, artAnzahl)
//{
// Width = fLPArtikel.Width - 25
//};
//uca.DeleteClicked += Uca_DeleteClicked;
//this.fLPArtikel.Controls.Add(uca);
}
}
private void Container_Click(object sender, EventArgs e)
{
@ -666,7 +746,7 @@ namespace Deckungsbeitrag
if (uca.Tag is Artikel artikel)
{
id = artikel.ArtikelID;
artname = artikel.Nummer + artikel.Bezeichnung;
artname = artikel.Bezeichnung;
}
else
{

View File

@ -276,44 +276,44 @@ namespace Deckungsbeitrag.AA_Forms
/// <param name="extra">Wenn Extrakunde dann true</param>
private void Open_Liste(bool extra)
{
auftragsliste = new List<object>(Auftrag.GetRampeAuftragList());
//auftragsliste = new List<object>(Auftrag.GetRampeAuftragList());
FormListe liste = new FormListe(auftragsliste, 3);
switch (liste.ShowDialog())
{
case DialogResult.None:
break;
case DialogResult.OK:
if (extra)
{
this.extraAuftrag = liste.auftrag;
this.extraAuftrag.Status = AuftragStatus.Aufgelegt;
if (this.extraAuftrag.Save()[0] != 1) meldung.Speicherfehler();
}
else
{
this.auftrag = liste.auftrag;
this.auftrag.Status = AuftragStatus.Aufgelegt;
if (this.auftrag.Save()[0] != 1) meldung.Speicherfehler();
}
Fach_speichern();
break;
case DialogResult.Cancel:
break;
case DialogResult.Abort:
break;
case DialogResult.Retry:
break;
case DialogResult.Ignore:
break;
case DialogResult.Yes:
Open_NeuerAuftrag(extra);
break;
case DialogResult.No:
break;
default:
break;
}
//FormListe liste = new FormListe(auftragsliste, 3);
//switch (liste.ShowDialog())
//{
// case DialogResult.None:
// break;
// case DialogResult.OK:
// if (extra)
// {
// this.extraAuftrag = liste.auftrag;
// this.extraAuftrag.Status = AuftragStatus.Aufgelegt;
// if (this.extraAuftrag.Save()[0] != 1) meldung.Speicherfehler();
// }
// else
// {
// this.auftrag = liste.auftrag;
// this.auftrag.Status = AuftragStatus.Aufgelegt;
// if (this.auftrag.Save()[0] != 1) meldung.Speicherfehler();
// }
// Fach_speichern();
// break;
// case DialogResult.Cancel:
// break;
// case DialogResult.Abort:
// break;
// case DialogResult.Retry:
// break;
// case DialogResult.Ignore:
// break;
// case DialogResult.Yes:
// Open_NeuerAuftrag(extra);
// break;
// case DialogResult.No:
// break;
// default:
// break;
//}
}

View File

@ -168,8 +168,8 @@ namespace DatenDB
using (NpgsqlCommand cmd = new NpgsqlCommand())
{
cmd.Connection = DatenbankConnection.GetConnection();
//cmd.CommandText = $"select {COLUMNS} from {TABLE} where status = 2 order by liefertag asc";
if (kategorie == ArtikelKategorie.Frottee) cmd.CommandText = $"select {ACOLUMNS} from {TABLE} a JOIN kundenverwaltung.kunde_artikel k ON a.kunde_id = k.kunde_id JOIN kundenverwaltung.artikel b ON k.artikel_id = b.artikel_id WHERE a.status = 2 and b.kategorie = {(int)kategorie} or a.status = 2 and b.kategorie = 4 GROUP BY a.auftrag_id, a.kunde_id HAVING COUNT(*) >= 1";
if (kategorie == ArtikelKategorie.Frottee) cmd.CommandText = $"select {ACOLUMNS} from {TABLE} a JOIN kundenverwaltung.kunde_artikel k ON a.kunde_id = k.kunde_id JOIN kundenverwaltung.artikel b ON k.artikel_id = b.artikel_id WHERE a.status = 2 and b.kategorie = {(int)kategorie} or a.status = 2 and b.kategorie = 4 GROUP BY a.auftrag_id, a.kunde_id HAVING COUNT(*) >= 1";
else cmd.CommandText = $"select {ACOLUMNS} from {TABLE} a JOIN kundenverwaltung.kunde_artikel k ON a.kunde_id = k.kunde_id JOIN kundenverwaltung.artikel b ON k.artikel_id = b.artikel_id WHERE a.status = 2 and b.kategorie = {(int)kategorie} GROUP BY a.auftrag_id, a.kunde_id HAVING COUNT(*) >= 1";
NpgsqlDataReader reader = cmd.ExecuteReader();

View File

@ -158,8 +158,9 @@ namespace Deckungsbeitrag.AA_Klassen
AuftragStatus? minStatusFilter = null,
AuftragTyp? typFilter = null,
AuftragTyp? minTypFilter = null,
bool? frottee = null,
ArtikelKategorie? kategorie = null,
DateTime? datum = null,
bool? undFertig = null,
NpgsqlConnection conn = null)
{
string _connectionString = ConfigurationManager.AppSettings["ConnectionString"];
@ -176,6 +177,13 @@ namespace Deckungsbeitrag.AA_Klassen
var conditions = new List<string>();
var parameters = new List<NpgsqlParameter>();
// Frottee-Filter
if (kategorie.HasValue)
{
if (undFertig.HasValue && undFertig.Value) conditions.Add($"{kategorie.ToString().ToLower()}_status < 3");
else conditions.Add($"{kategorie.ToString().ToLower()}_status < 2");
}
// Status-Filter
if (statusFilter.HasValue)
{
@ -223,17 +231,8 @@ namespace Deckungsbeitrag.AA_Klassen
conditions.Add("typ >= @typ");
parameters.Add(new NpgsqlParameter("@typ", (int)minTypFilter.Value));
}
else
{
//conditions.Add("typ <= @typ OR typ > @typ");
//parameters.Add(new NpgsqlParameter("@typ", (int)AuftragTyp.Standart));
}
}
// Frottee-Filter
if (frottee.HasValue && frottee.Value)
conditions.Add($"frottee_status < 2");
// Datum-Filter
if (datum.HasValue)
{

View File

@ -1089,12 +1089,15 @@ namespace Deckungsbeitrag
Bitmap bitmap = new Bitmap(300, 1200);
Graphics g = Graphics.FromImage(bitmap);
Font font0 = new Font("Arial", 10, FontStyle.Regular);
Font font1 = new Font("Arial", 15, FontStyle.Bold);
Font font2 = new Font("Arial", 30, FontStyle.Bold);
Font font3 = new Font("Arial", 20, FontStyle.Regular);
Font font4 = new Font("Arial", 150, FontStyle.Bold);
float height_font0 = g.MeasureString("012345", font0).Height;
float height_font1 = g.MeasureString($"{kunde.Suchtext}", font1).Height;
float height_font2 = g.MeasureString($"{kunde.PLZ} {kunde.Ort})", font2).Height;
float height_font3 = g.MeasureString($"{kunde.PLZ} {kunde.Ort})", font3).Height;
SizeF size_container = g.MeasureString($"Container/Pakete:", font3);
SizeF size_Liefertag = new SizeF(g.MeasureString("Liefertag:", font3));
float width_date_font1 = g.MeasureString("25.05.2023", font1).Width;
@ -1127,6 +1130,8 @@ namespace Deckungsbeitrag
int reklAnzahl = kvp.Value; // z.B. [3, 0, 5]
string shortName = _artikel.Short;
float bestandWidth = g.MeasureString($"{reklAnzahl}", font2).Width;
g.DrawString($"{_artikel.Nummer}", font3, Brushes.Black, einzug, nextposition);
nextposition += (int)height_font3;
g.DrawString($"{shortName}", font2, Brushes.Black, einzug, nextposition);
nextposition += (int)height_font2;
g.DrawString($"{reklAnzahl}", font2, Brushes.Black, bitmap.Width - bestandWidth, nextposition);
@ -1146,6 +1151,8 @@ namespace Deckungsbeitrag
if (ist == 0 & artbestand[2] == 0) ist = artbestand[3];
string shortName = _artikel.Short;
float bestandWidth = g.MeasureString($"{ist}/({artbestand[2]})", font2).Width;
g.DrawString($"{_artikel.Nummer}", font3, Brushes.Black, einzug, nextposition);
nextposition += (int)height_font3;
g.DrawString($"{shortName}", font2, Brushes.Black, einzug, nextposition);
nextposition += (int)height_font2;
if (artbestand[2] < 0) g.DrawString($"{ist}/({artbestand[2]})", font2, Brushes.Black, bitmap.Width - bestandWidth - 10, nextposition);
@ -1509,9 +1516,11 @@ namespace Deckungsbeitrag
public static Chart Load_FehlmengeChart(List<KundeArtikel> artikelDaten, Chart chart1)
{
chart1.Series.Clear();
Kunde _knd = Kunde.GetKunde(null, artikelDaten[0].KundeID, null);
chart1.Tag = _knd;
Title title = chart1.Titles[0];
title.Text = Kunde.GetKunde(null, artikelDaten[0].KundeID, null).Suchtext == null ? Kunde.GetKunde(null, artikelDaten[0].KundeID, null).KundeName : Kunde.GetKunde(null, artikelDaten[0].KundeID, null).Suchtext;
title.Text = _knd.Suchtext?? _knd.KundeName;
title.Font = new Font("Arial", 16, FontStyle.Bold);
title.ForeColor = Color.White;
title.BackColor = Color.Transparent;

View File

@ -1,4 +1,5 @@
using BrightIdeasSoftware;
using Deckungsbeitrag;
using Npgsql;
using System;
using System.Collections.Generic;
@ -97,7 +98,7 @@ namespace DatenDB
List<KundeArtikel> resultList = new List<KundeArtikel>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
if (!string.IsNullOrWhiteSpace(kundeid)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kundeid} and SUBSTRING(artikel_nr::text, 1, 1) = '6' order by reihung asc";
if (!string.IsNullOrWhiteSpace(kundeid)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_id = {kundeid} and SUBSTRING(artikel_nr::text, 1, 1) = '6' or kunde_id = {kundeid} and SUBSTRING(artikel_nr::text, 1, 1) = '1' order by reihung asc";
else command.CommandText = $"select {COLUMNS} from {TABLE} where artikel_id = {artikelID} order by artikel_nr";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultList.Add(new KundeArtikel(reader));
@ -118,6 +119,32 @@ namespace DatenDB
}
public static void SaveKundeArtikel_Numbers(KundeArtikel kndart, int? korrektur, int? fehlmenge, int? reklamation, int? stand)
{
if (korrektur.HasValue)
{
kndart.Korrektur = korrektur.Value;
kndart.KorrekturBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (fehlmenge.HasValue)
{
kndart.Fehlmenge = fehlmenge.Value;
kndart.FehlmengeBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (reklamation.HasValue)
{
kndart.Reklamation = reklamation.Value;
kndart.ReklamationBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
if (stand.HasValue)
{
kndart.Stand = stand.Value;
kndart.StandBearbeitet = Program.benutzer.BenutzerName + " am " + DateTime.Now.ToString();
}
kndart.Save();
}
public int Save()
@ -241,27 +268,21 @@ namespace DatenDB
this.ReklamationBearbeitet = reader.IsDBNull(13) ? string.Empty : reader.GetString(13);
}
[OLVColumn(IsVisible = false)]
public int? KundeArtikelID { get; set; }
[OLVIgnore]
public int? KundeID { get; set; }
[OLVColumn("ArtNr.", DisplayIndex = 2, TextAlign = HorizontalAlignment.Left)]
public int ArtikelNR { get; set; }
[OLVColumn("Artikel", DisplayIndex = 3, TextAlign = HorizontalAlignment.Left)]
public string ArtikelName { get; set; }
[OLVIgnore]
public int Stand { get; set; }
[OLVColumn("Nachwäsche", DisplayIndex = 4, TextAlign = HorizontalAlignment.Center)]
public int Fehlmenge { get; set; }
public string StandBearbeitet { get; set; }
public string FehlmengeBearbeitet { get; set; }
public int Korrektur { get; set; }
public string KorrekturBearbeitet { get; set; }
public int Reklamation { get; set; }
public int? ArtikelID { get; set; }
[OLVColumn("Reihung", IsVisible = false)]
public int Reihung { get; set; }
[OLVColumn("ArtNr.", DisplayIndex = 2, TextAlign = HorizontalAlignment.Left)] public int ArtikelNR { get; set; }
[OLVColumn("Artikel", DisplayIndex = 3, TextAlign = HorizontalAlignment.Left)] public string ArtikelName { get; set; }
[OLVColumn("Nachwäsche", DisplayIndex = 4, TextAlign = HorizontalAlignment.Center)] public int Fehlmenge { get; set; }
[OLVColumn("Korrektur", DisplayIndex = 5, TextAlign = HorizontalAlignment.Center)] public int Korrektur { get; set; }
[OLVColumn("Reihung", DisplayIndex = 6, IsVisible = false)] public int Reihung { get; set; }
[OLVIgnore] public int? KundeArtikelID { get; set; }
[OLVIgnore] public int? KundeID { get; set; }
[OLVIgnore] public int Stand { get; set; }
[OLVIgnore] public string StandBearbeitet { get; set; }
[OLVIgnore] public string FehlmengeBearbeitet { get; set; }
[OLVIgnore] public string KorrekturBearbeitet { get; set; }
[OLVIgnore] public int Reklamation { get; set; }
[OLVIgnore] public int? ArtikelID { get; set; }
[OLVIgnore] public string ComboBoxAnzeige => $"{ArtikelNR} {ArtikelName}";
public string ReklamationBearbeitet { get; set; }
[OLVIgnore] public string ReklamationBearbeitet { get; set; }
}
}

View File

@ -132,7 +132,7 @@ namespace Deckungsbeitrag
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Screen[] screens = Screen.AllScreens;
Cursor.Current = Cursors.WaitCursor;
Application.UseWaitCursor = true;
// Check, Install und Update wenn Update vorhanden.
if (CheckAndInstallUpdate())
@ -140,6 +140,8 @@ namespace Deckungsbeitrag
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;
Application.UseWaitCursor = false;
Application.Exit();
//return;
}
@ -177,7 +179,7 @@ namespace Deckungsbeitrag
}
Settings.Default.Save();
Cursor.Current = Cursors.Default;
Application.UseWaitCursor = false;
if (istest) { Application.Run(new FormAufleger()); return; }
@ -672,7 +674,31 @@ namespace Deckungsbeitrag
#endregion
#region public-Funktion
public static void InventurFertig(Auftrag auftrag)
{
string savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren";
if (ConfigurationManager.AppSettings["ConnectionString"].Split(';')[4].Split('=')[1] == "Test_Wirl") savePath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Test\\Inventuren") ?? "Inventuren";
Kunde kunde = Kunde.GetKunde(null, auftrag.KundeID, null);
string delPath = Path.Combine(savePath, $"Herrichten-{auftrag.AuftragID}-{kunde.KundeNummer}.csv");
string[] lines = null;
if (File.Exists(delPath))
{
lines = File.ReadAllLines(delPath, Encoding.UTF8);
lines[7] += auftrag.AuftragID.ToString();
string fileName = $"Fertig-{auftrag.AuftragID}-{kunde.KundeNummer}.csv"; // Dateiname: Status-AuftragID-KundeNummer.csv
string csvPath;
csvPath = Path.Combine(savePath, fileName);
var csv = new StringBuilder();
foreach (string line in lines) csv.AppendLine(line);
File.WriteAllText(csvPath, csv.ToString(), Encoding.UTF8);
if (File.Exists(delPath)) File.Delete(delPath);
}
}
public static void AddFeedback(Benutzer user, string feedbackText, string bildDateiname, string timeStamp)
{
string vaultPath = Path.Combine(savePath, "Feedback\\VerwaltungFeedback.md");

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.1.1.7")]
[assembly: AssemblyFileVersion("1.1.1.7")]
[assembly: AssemblyVersion("1.1.3.1")]
[assembly: AssemblyFileVersion("1.1.3.1")]

View File

@ -1235,7 +1235,7 @@
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:VirtualKeyboard, Version=1.0.1.9, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:VirtualKeyboard, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_848FCB2438E4DBC274C4D124CEB9562C"
@ -1690,15 +1690,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SetupVerwaltung"
"ProductCode" = "8:{049D8565-9755-44F0-BC9C-88DC9765C35C}"
"PackageCode" = "8:{C2847EAC-1B66-4CEA-A9AC-60AACF7C2FC2}"
"ProductCode" = "8:{D9B50D82-0DA0-42AA-BA1A-0C403DB66D1E}"
"PackageCode" = "8:{B8F0DE4F-7514-40E3-9E53-8690D6CF5643}"
"UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.1.17"
"ProductVersion" = "8:1.1.31"
"Manufacturer" = "8:Kilian Wirl GmbH"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"

View File

@ -394,12 +394,6 @@
<Compile Include="UserControls\UCFeedback.Designer.cs">
<DependentUpon>UCFeedback.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\UCInventur.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\UCInventur.Designer.cs">
<DependentUpon>UCInventur.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\UCKunde.cs">
<SubType>UserControl</SubType>
</Compile>
@ -544,9 +538,6 @@
<EmbeddedResource Include="UserControls\UCFeedback.resx">
<DependentUpon>UCFeedback.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\UCInventur.resx">
<DependentUpon>UCInventur.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\UCKunde.resx">
<DependentUpon>UCKunde.cs</DependentUpon>
</EmbeddedResource>

View File

@ -1,5 +1,5 @@
=====================================
NEUIGKEITEN - Version 1.1.1.7
NEUIGKEITEN - Version 1.1.3.1
=====================================
Build-Info:
@ -71,5 +71,5 @@ Build-Info:
Keine Install-Reminder vorhanden ✅
Installation: 14.05.2026 15:42
Installation: 28.05.2026 12:28
=====================================