diff --git a/AA-Forms/FormAusschlager.Designer.cs b/AA-Forms/FormAusschlager.Designer.cs index 27c23b5..2f177d7 100644 --- a/AA-Forms/FormAusschlager.Designer.cs +++ b/AA-Forms/FormAusschlager.Designer.cs @@ -29,31 +29,43 @@ private void InitializeComponent() { this.tableLayoutPanelWS = new System.Windows.Forms.TableLayoutPanel(); + this.statusStripAusschlager = new System.Windows.Forms.StatusStrip(); this.SuspendLayout(); // // tableLayoutPanelWS // + this.tableLayoutPanelWS.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanelWS.ColumnCount = 2; this.tableLayoutPanelWS.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanelWS.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanelWS.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanelWS.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanelWS.Name = "tableLayoutPanelWS"; this.tableLayoutPanelWS.RowCount = 2; this.tableLayoutPanelWS.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanelWS.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanelWS.Size = new System.Drawing.Size(600, 366); + this.tableLayoutPanelWS.Size = new System.Drawing.Size(600, 341); this.tableLayoutPanelWS.TabIndex = 0; // + // statusStripAusschlager + // + this.statusStripAusschlager.Location = new System.Drawing.Point(0, 344); + this.statusStripAusschlager.Name = "statusStripAusschlager"; + this.statusStripAusschlager.Size = new System.Drawing.Size(600, 22); + this.statusStripAusschlager.TabIndex = 1; + this.statusStripAusschlager.Text = "statusStrip1"; + // // FormAusschlager // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); this.ClientSize = new System.Drawing.Size(600, 366); + this.Controls.Add(this.statusStripAusschlager); this.Controls.Add(this.tableLayoutPanelWS); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormAusschlager"; @@ -62,14 +74,14 @@ this.Text = "FormAusschlager"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.FormAusschlager_Load); - this.ResizeEnd += new System.EventHandler(this.FormAusschlager_ResizeEnd); - this.SizeChanged += new System.EventHandler(this.FormAusschlager_SizeChanged); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanelWS; + private System.Windows.Forms.StatusStrip statusStripAusschlager; } } \ No newline at end of file diff --git a/AA-Forms/FormAusschlager.cs b/AA-Forms/FormAusschlager.cs index 97c7012..c836b35 100644 --- a/AA-Forms/FormAusschlager.cs +++ b/AA-Forms/FormAusschlager.cs @@ -21,6 +21,7 @@ namespace Deckungsbeitrag { private Fehlermeldungen meldung = new Fehlermeldungen(); private Auftrag auftrag; + private WSFach fach; public Maschine maschine; public List fachliste; bool maximised = false; @@ -73,17 +74,31 @@ namespace Deckungsbeitrag List fachliste = WSFach.GetFachliste(this.maschine); if (fachliste.Count > 0) { - // Alle Zellen einer Spalte durchlaufen - int columnIndex = 1; - for (int row = 0; row < tlp.RowCount; row++) + foreach (WSFach f in fachliste) { - Control cellControl = tlp.GetControlFromPosition(columnIndex, row); - - if (cellControl != null && cellControl is Label lbl) + Auftrag auftrag = Auftrag.GetAuftrag(f.AuftragID); + + // Alle Zellen einer Spalte durchlaufen + for (int col = 0; col < tableLayoutPanelWS.ColumnCount; col++) { - // Label in Zelle (col=2, row) bearbeiten - lbl.BackColor = Color.LightBlue; - lbl.Text = $"Col {columnIndex} Row {row}"; + if (col == 1 || col == 2 || col == 3) + { + for (int row = 0; row < tlp.RowCount; row++) + { + Control cellControl = tlp.GetControlFromPosition(col, row); + + if (cellControl != null && cellControl is Label lbl) + { + // Label in Zelle (col=2, row) bearbeiten + if (col == 1) lbl.Text = Kunde.GetKunde(string.Empty, auftrag.KundeID, string.Empty).Suchtext; + if (col == 2) lbl.Text = auftrag.Liefertag.DayOfWeek.ToString(); + if (auftrag.AufgabeID != null) + { + if (col == 3) lbl.Text = Aufgabe.GetAufgabe(string.Empty, (int?)auftrag.AufgabeID).Bezeichnung; + } + } + } + } } } } @@ -112,7 +127,7 @@ namespace Deckungsbeitrag for (int col = 0; col < cols; col++) { - tlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute)); + //tlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute)); Label lbl = new Label(); lbl.Name = $"Zeile {row}, Spalte {col}"; lbl.Dock = DockStyle.Fill; @@ -226,17 +241,21 @@ namespace Deckungsbeitrag } } } + private void Fach_Laden() + { + fach = new WSFach(); + fach.AuftragID = (int)this.auftrag.AufgabeID; + fach.MaschineID = (int)this.maschine.MaschineID; + fach.Gewaschen = DateTime.Now; + fach.Gewicht = 0; + } + private void Fach_Speichern() + { - + } public void Form_Refresh(Maschine ms, SPSDaten spsdaten) { } - private void FormAusschlager_SizeChanged(object sender, EventArgs e) - { - } - private void FormAusschlager_ResizeEnd(object sender, EventArgs e) - { - } /// /// Umrechnen der Prozentgröße der Zeile in Pixelhöhe (int). @@ -250,13 +269,12 @@ namespace Deckungsbeitrag float colPercent = 0; float rowPercent = tlp.RowStyles[0].Height; - int pixelWidth = colPercent == 0 ? 0 : (int)(tlp.Width * (colPercent / 100f)); + int pixelWidth = (int)colPercent; int pixelHeight = rowPercent == 0 ? 0 : (int)(tlp.Height * (rowPercent / 100f)); return new Size(pixelWidth, pixelHeight); } - /// /// KEIN VERWEIS NOTWENDIG /// Wenn ESC gedrückt wird schließt sich das Fenster. @@ -277,12 +295,15 @@ namespace Deckungsbeitrag } return base.ProcessDialogKey(keyData); } + + private void Open_NeuerAuftrag() { FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.Userid); if (neuerAuftrag.ShowDialog() == DialogResult.OK) { this.auftrag = neuerAuftrag.Auftrag; + Fach_Laden(); } } diff --git a/AA-Forms/FormAusschlager.resx b/AA-Forms/FormAusschlager.resx index 1af7de1..3f52b66 100644 --- a/AA-Forms/FormAusschlager.resx +++ b/AA-Forms/FormAusschlager.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/AA-Forms/FormExpedit.Designer.cs b/AA-Forms/FormExpedit.Designer.cs index 1520cf1..d9d699b 100644 --- a/AA-Forms/FormExpedit.Designer.cs +++ b/AA-Forms/FormExpedit.Designer.cs @@ -467,6 +467,7 @@ this.label4.Size = new System.Drawing.Size(172, 31); this.label4.TabIndex = 41; this.label4.Text = "Artikelstände"; + this.label4.Visible = false; // // buttonNeuerAuftrag // @@ -518,11 +519,12 @@ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.dGArtikel.DefaultCellStyle = dataGridViewCellStyle2; - this.dGArtikel.Location = new System.Drawing.Point(631, 43); + this.dGArtikel.Location = new System.Drawing.Point(638, 42); this.dGArtikel.Name = "dGArtikel"; this.dGArtikel.RowHeadersWidth = 62; this.dGArtikel.Size = new System.Drawing.Size(527, 679); this.dGArtikel.TabIndex = 44; + this.dGArtikel.Visible = false; this.dGArtikel.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dGArtikel_CellBeginEdit); this.dGArtikel.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellEndEdit); this.dGArtikel.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dGArtikel_CellValidating); @@ -610,7 +612,7 @@ this.tabPageSonder.Location = new System.Drawing.Point(4, 34); this.tabPageSonder.Name = "tabPageSonder"; this.tabPageSonder.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSonder.Size = new System.Drawing.Size(617, 675); + this.tabPageSonder.Size = new System.Drawing.Size(1153, 675); this.tabPageSonder.TabIndex = 1; this.tabPageSonder.Text = "Sonderaufträge"; this.tabPageSonder.UseVisualStyleBackColor = true; @@ -625,7 +627,7 @@ this.objectListViewSonder.HideSelection = false; this.objectListViewSonder.Location = new System.Drawing.Point(3, 3); this.objectListViewSonder.Name = "objectListViewSonder"; - this.objectListViewSonder.Size = new System.Drawing.Size(611, 669); + this.objectListViewSonder.Size = new System.Drawing.Size(1147, 669); this.objectListViewSonder.TabIndex = 2; this.objectListViewSonder.UseCompatibleStateImageBehavior = false; this.objectListViewSonder.UseHotControls = false; @@ -639,7 +641,7 @@ this.tabPageAll.Location = new System.Drawing.Point(4, 34); this.tabPageAll.Name = "tabPageAll"; this.tabPageAll.Padding = new System.Windows.Forms.Padding(3); - this.tabPageAll.Size = new System.Drawing.Size(617, 675); + this.tabPageAll.Size = new System.Drawing.Size(1153, 675); this.tabPageAll.TabIndex = 0; this.tabPageAll.Text = "Aufträge heute"; this.tabPageAll.UseVisualStyleBackColor = true; @@ -654,7 +656,7 @@ this.objectListViewAuftrag.HideSelection = false; this.objectListViewAuftrag.Location = new System.Drawing.Point(3, 3); this.objectListViewAuftrag.Name = "objectListViewAuftrag"; - this.objectListViewAuftrag.Size = new System.Drawing.Size(611, 669); + this.objectListViewAuftrag.Size = new System.Drawing.Size(1147, 669); this.objectListViewAuftrag.TabIndex = 1; this.objectListViewAuftrag.UseCompatibleStateImageBehavior = false; this.objectListViewAuftrag.UseHotControls = false; @@ -673,7 +675,7 @@ this.tabControlAuftragList.Location = new System.Drawing.Point(4, 9); this.tabControlAuftragList.Name = "tabControlAuftragList"; this.tabControlAuftragList.SelectedIndex = 0; - this.tabControlAuftragList.Size = new System.Drawing.Size(625, 713); + this.tabControlAuftragList.Size = new System.Drawing.Size(1161, 713); this.tabControlAuftragList.TabIndex = 0; this.tabControlAuftragList.Visible = false; this.tabControlAuftragList.SelectedIndexChanged += new System.EventHandler(this.tabControlAuftragList_SelectedIndexChanged); diff --git a/AA-Forms/FormExpedit.cs b/AA-Forms/FormExpedit.cs index d18d70b..cf24a79 100644 --- a/AA-Forms/FormExpedit.cs +++ b/AA-Forms/FormExpedit.cs @@ -30,6 +30,7 @@ namespace Deckungsbeitrag int? altecontclean = null; Timer timer1 = new Timer(); private Screen[] screens; + private Point itemlocation; public FormExpedit(Benutzer benutzer) { @@ -49,11 +50,11 @@ namespace Deckungsbeitrag public FormExpedit(Benutzer benutzer, Screen[] screens) : this(benutzer) { this.screens = screens; - foreach(Screen screen in screens) + foreach (Screen screen in screens) { if (screen.Primary) { - if (screens[0].WorkingArea.Width < 1500) { this.objectListViewAuftrag.Font = new Font(this.objectListViewAuftrag.Font.FontFamily, 10); } + if (screen.WorkingArea.Width < 1500) { this.objectListViewAuftrag.Font = new Font(this.objectListViewAuftrag.Font.FontFamily, 10); } } } } @@ -251,6 +252,11 @@ namespace Deckungsbeitrag // Alle Zeilenhöhen an Zellinhalt anpassen this.dGArtikel.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; + this.dGArtikel = Funktionen.DGV_Size_Anpassen(this.dGArtikel); + + this.dGArtikel.Location = new Point(this.tabControlAuftragList.Right - dGArtikel.Width, this.dGArtikel.Location.Y); + if (this.dGArtikel.Rows.Count > 0) this.dGArtikel.Visible = true; + else this.dGArtikel.Visible = false; } @@ -367,6 +373,7 @@ namespace Deckungsbeitrag /// private void objectListViewAuftrag_CellClick(object sender, CellClickEventArgs e) { + itemlocation = new Point(e.Location.X, e.Location.Y); if(e.Model == null) return; ObjectListView olv = (ObjectListView)sender; Auftrag _auftrag = (Auftrag)e.Model; @@ -563,6 +570,7 @@ namespace Deckungsbeitrag } private void Liefertag_rB_Checked(object sender, EventArgs e) { + //TODO: OLV-Item refresh. Neuer Liefertag speichern. foreach (RadioButton radioButton in this.groupBoxEtikett.Controls.OfType()) { if (radioButton.Checked) radioButton.BackColor = Color.Yellow; @@ -585,7 +593,9 @@ namespace Deckungsbeitrag if (this.auftrag != null) { this.auftrag.Liefertag = this.dTPLiefertag.Value; + this.auftrag.Save(); Load_Etikett_GroupBox(); + this.objectListViewAuftrag.RefreshObject(this.auftrag); } } @@ -667,5 +677,6 @@ namespace Deckungsbeitrag FormEinstellung einstellung = new FormEinstellung(this); einstellung.ShowDialog(); } + } } diff --git a/AA-Forms/FormListe.cs b/AA-Forms/FormListe.cs index c249a13..d5b87be 100644 --- a/AA-Forms/FormListe.cs +++ b/AA-Forms/FormListe.cs @@ -39,6 +39,7 @@ namespace Deckungsbeitrag string auf_col = "Aufgabe,Beschreibung"; string progFiles = @"C:\Program Files\Common Files\Microsoft Shared\ink"; string keyboardPath; + private Timer timer; //QR-Code Scan mit integrierter Kamera @@ -62,7 +63,13 @@ namespace Deckungsbeitrag } private void FormListe_Load(object sender, EventArgs e) { - this.buttonOK.Visible = this.buttonOK.Enabled = false; + // Timer für Wartezeit bis TextChanged eintritt. + timer = new Timer(); + timer.Interval = 1000; // 1 Sekunden + timer.Tick += Timer_Tick; + + + this.buttonOK.Visible = this.buttonOK.Enabled = false; listViewKunde_Load(); @@ -200,21 +207,31 @@ namespace Deckungsbeitrag } private void textBoxKunde_TextChanged(object sender, EventArgs e) { - if (!textBoxKunde.Text.StartsWith("?") && textBoxKunde.TextLength > 3) - { - + // 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 Timer_Tick(object sender, EventArgs e) + { + timer.Stop(); // Timer stoppen + + // Wenn kein Fragezeichen am Anfang und die Textlänge ist größer 3 wird Kundenliste erstellt. + if (!textBoxKunde.Text.StartsWith("?") && textBoxKunde.TextLength > 3) + { Kundenliste = Kunde.GetTmpList(this.textBoxKunde.Text); listViewKunde_Load(); } - 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) + private void listViewKunde_MouseClick(object sender, MouseEventArgs e) { ListViewItem item = this.listViewKunde.GetItemAt(e.X, e.Y); diff --git a/AA-Forms/FormNeuerAuftrag.cs b/AA-Forms/FormNeuerAuftrag.cs index 07f1ed3..d9cb914 100644 --- a/AA-Forms/FormNeuerAuftrag.cs +++ b/AA-Forms/FormNeuerAuftrag.cs @@ -118,7 +118,8 @@ namespace Deckungsbeitrag private void DatenLaden() { this.textBoxKndNr.Text = kunde.KundeNummer; - this.textBoxKundeName.Text = kunde.Suchtext; + if (string.IsNullOrWhiteSpace(kunde.Suchtext)) this.textBoxKundeName.Text = kunde.KundeName; + else this.textBoxKundeName.Text = kunde.Suchtext; if (letzterLiefertag.HasValue) this.dTPLiefertag.Value = letzterLiefertag.Value; else this.dTPLiefertag.Value = DateTime.Today.AddDays(1); @@ -343,17 +344,9 @@ namespace Deckungsbeitrag } } - // Wenn Waschstrasse bleibt Fenster offen. - if(benutzer.Rolle != BenutzerRolle.Waschstrasse) - { - this.DialogResult = DialogResult.OK; - this.Close(); - } - else - { - Auftrag = new Auftrag(); - FormNeuerAuftrag_Load(this, e); - } + this.DialogResult = DialogResult.OK; + this.Close(); + } private void Container_Click(object sender, EventArgs e) { diff --git a/AA-Forms/FormWSVerfolgung.Designer.cs b/AA-Forms/FormWSVerfolgung.Designer.cs new file mode 100644 index 0000000..f7e6d53 --- /dev/null +++ b/AA-Forms/FormWSVerfolgung.Designer.cs @@ -0,0 +1,118 @@ +namespace Deckungsbeitrag.AA_Forms +{ + partial class FormWSVerfolgung + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormWSVerfolgung)); + this.statusStripWSVerfolgung = new System.Windows.Forms.StatusStrip(); + this.tableLayoutPanelWSVerfolgung = new System.Windows.Forms.TableLayoutPanel(); + this.toolStripStatusLabelInfo = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabelInfoShortCut = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripDropDownButtonInfo = new System.Windows.Forms.ToolStripDropDownButton(); + this.statusStripWSVerfolgung.SuspendLayout(); + this.SuspendLayout(); + // + // statusStripWSVerfolgung + // + this.statusStripWSVerfolgung.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabelInfo, + this.toolStripStatusLabelInfoShortCut, + this.toolStripDropDownButtonInfo}); + this.statusStripWSVerfolgung.Location = new System.Drawing.Point(0, 428); + this.statusStripWSVerfolgung.Name = "statusStripWSVerfolgung"; + this.statusStripWSVerfolgung.Size = new System.Drawing.Size(800, 22); + this.statusStripWSVerfolgung.TabIndex = 0; + this.statusStripWSVerfolgung.Text = "statusStrip1"; + // + // tableLayoutPanelWSVerfolgung + // + this.tableLayoutPanelWSVerfolgung.BackColor = System.Drawing.Color.Transparent; + this.tableLayoutPanelWSVerfolgung.ColumnCount = 1; + this.tableLayoutPanelWSVerfolgung.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanelWSVerfolgung.Dock = System.Windows.Forms.DockStyle.Top; + this.tableLayoutPanelWSVerfolgung.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanelWSVerfolgung.Name = "tableLayoutPanelWSVerfolgung"; + this.tableLayoutPanelWSVerfolgung.RowCount = 2; + this.tableLayoutPanelWSVerfolgung.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanelWSVerfolgung.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanelWSVerfolgung.Size = new System.Drawing.Size(800, 422); + this.tableLayoutPanelWSVerfolgung.TabIndex = 1; + // + // toolStripStatusLabelInfo + // + this.toolStripStatusLabelInfo.BackColor = System.Drawing.SystemColors.Control; + this.toolStripStatusLabelInfo.Name = "toolStripStatusLabelInfo"; + this.toolStripStatusLabelInfo.Size = new System.Drawing.Size(72, 17); + this.toolStripStatusLabelInfo.Text = "Info wählen:"; + // + // toolStripStatusLabelInfoShortCut + // + this.toolStripStatusLabelInfoShortCut.BackColor = System.Drawing.SystemColors.Control; + this.toolStripStatusLabelInfoShortCut.Name = "toolStripStatusLabelInfoShortCut"; + this.toolStripStatusLabelInfoShortCut.Size = new System.Drawing.Size(55, 17); + this.toolStripStatusLabelInfoShortCut.Text = "[Strg]+[I]"; + // + // toolStripDropDownButtonInfo + // + this.toolStripDropDownButtonInfo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripDropDownButtonInfo.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButtonInfo.Image"))); + this.toolStripDropDownButtonInfo.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButtonInfo.Name = "toolStripDropDownButtonInfo"; + this.toolStripDropDownButtonInfo.Size = new System.Drawing.Size(29, 20); + this.toolStripDropDownButtonInfo.Text = "toolStripDropDownButton1"; + // + // FormWSVerfolgung + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.tableLayoutPanelWSVerfolgung); + this.Controls.Add(this.statusStripWSVerfolgung); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.KeyPreview = true; + this.Name = "FormWSVerfolgung"; + this.Text = "WSVerfolgung"; + this.Load += new System.EventHandler(this.WSVerfolgung_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormWSVerfolgung_KeyDown); + this.statusStripWSVerfolgung.ResumeLayout(false); + this.statusStripWSVerfolgung.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.StatusStrip statusStripWSVerfolgung; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanelWSVerfolgung; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelInfo; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelInfoShortCut; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButtonInfo; + } +} \ No newline at end of file diff --git a/AA-Forms/FormWSVerfolgung.cs b/AA-Forms/FormWSVerfolgung.cs new file mode 100644 index 0000000..776dd04 --- /dev/null +++ b/AA-Forms/FormWSVerfolgung.cs @@ -0,0 +1,299 @@ +using DatenDB; +using Deckungsbeitrag.AA_Klassen; +using HarfBuzzSharp; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Font = System.Drawing.Font; + +namespace Deckungsbeitrag.AA_Forms +{ + public partial class FormWSVerfolgung : Form + { + private readonly SPSDaten _monitor; //Ziel der Eventanfragen für die SPS. + private string Userid; + private Maschine maschine; + private Auftrag auftrag; + private Fehlermeldungen meldung = new Fehlermeldungen(); + private Aufgabe aufgabe; + private WSFach fach; + + public bool ws1transport = false; + public bool ws2transport = false; + + public FormWSVerfolgung() + { + InitializeComponent(); + } + public FormWSVerfolgung(string userid) : this() + { + this.Userid = userid; + if (userid.Contains("01")) this.maschine = Maschine.GetMaschine(null, "Waschstrasse 1"); + if (userid.Contains("02")) this.maschine = Maschine.GetMaschine(null, "Waschstrasse 2"); + + this._monitor = new SPSDaten(); + + //Je nach Maschine werden die richtigen Events erstellt. + if (maschine.MaschineID == 1) + { + _monitor.WS1Transport += Transport_ValueChanged; + //_monitor.Presse1Leer += WS1_Value_Changed; + //_monitor.Trockner1Beladen += WS1_Value_Changed; + //_monitor.Trockner1Entladen += WS1_Value_Changed; + //_monitor.TischSummaryWS1_print += TischSummary_print; + //_monitor.BegleitzettelWS1_print += Begleitzettel_print; + } //Maschine 1 + else + { + _monitor.WS2Transport += Transport_ValueChanged; + //_monitor.Presse2Leer += WS2_Value_Changed; + //_monitor.Trockner2Beladen += WS2_Value_Changed; + //_monitor.Trockner2Entladen += WS2_Value_Changed; + //_monitor.TischSummaryWS2_print += TischSummary_print; + //_monitor.BegleitzettelWS2_print += Begleitzettel_print; + } //Maschine 2 + + } + + private void WSVerfolgung_Load(object sender, EventArgs e) + { + // WaitCursor und Controls ausblenden. + this.Cursor = Cursors.WaitCursor; + //Funktionen.HideControls(this.Controls); + + // StatusStrip DropDown + this.toolStripDropDownButtonInfo.DropDownItems.Clear(); + List aufgabenliste = Aufgabe.GetList((int)Kategorie.Waschstrasse); + foreach(Aufgabe auf in aufgabenliste) + { + ToolStripMenuItem item = new ToolStripMenuItem(auf.Bezeichnung); + item.Tag = auf; + item.Click += AufgabeAuswaehlen_Click; + toolStripDropDownButtonInfo.DropDownItems.Add(item); + } + + + this.BackColor = Properties.Settings.Default.Wirlblau; + this.WindowState = FormWindowState.Maximized; + this.FormBorderStyle = FormBorderStyle.None; + this.tableLayoutPanelWSVerfolgung.Height = this.statusStripWSVerfolgung.Top; + + if (maschine.TrocknerKaputt) this.tableLayoutPanelWSVerfolgung.RowCount = maschine.Faecher - 1; + else this.tableLayoutPanelWSVerfolgung.RowCount = maschine.Faecher; + this.tableLayoutPanelWSVerfolgung.RowStyles.Clear(); + for (int i = 0; i < tableLayoutPanelWSVerfolgung.RowCount; i++) + { + tableLayoutPanelWSVerfolgung.RowStyles.Add(new RowStyle(SizeType.Percent, 100f / tableLayoutPanelWSVerfolgung.RowCount)); + } + + Panel_Laden(1); + //DefaultCursor und Controls einblenden. + //Funktionen.ShowControls(this.Controls); + this.Cursor = Cursors.Default; + } + + private void AufgabeAuswaehlen_Click(object sender, EventArgs e) + { + ToolStripMenuItem item = (ToolStripMenuItem)sender; + this.aufgabe = (Aufgabe)item.Tag; + Fach_update(); + } + + private void Panel_Laden(int start) + { + + List fachliste = WSFach.GetFachliste(maschine); + + // Wenn erster Start dann Auftrag aus letztem Fach holen? + if (start == 1) + { + if (meldung.MaschinenStart() == DialogResult.Yes) this.auftrag = Auftrag.GetAuftrag(fachliste[0].AuftragID); + else this.auftrag = null; + } + + // Alle Controls aus dem Panel entfernen. + this.tableLayoutPanelWSVerfolgung.Controls.Clear(); + + + // UserControls mit Daten aus Fachliste in Panel laden. + for (int row = 0; row < fachliste.Count; row++) + { + Auftrag auftrag = Auftrag.GetAuftrag(fachliste[row].AuftragID); + UCFach ucfach = new UCFach(); + ucfach.Dock = DockStyle.Fill; + + // Fach Name und Farbe + if (this.maschine.Bezeichnung == "Waschstrasse 1") + { + switch (row + 1) + { + case int n when (n <= 4): + ucfach.ForeColor = Config.FarbenConfig.Farben["Beladeband"]; + ucfach.FachName = $"F"; + break; + case int n when (n >= 5 && n <= 13): + ucfach.ForeColor = Config.FarbenConfig.Farben["Waschstrasse"]; + ucfach.FachName = $"W"; + break; + case int n when (n == 14): + ucfach.ForeColor = Config.FarbenConfig.Farben["Presse"]; + ucfach.FachName = $"P"; + break; + case int n when (n == 15): + ucfach.ForeColor = Config.FarbenConfig.Farben["Hubband"]; + ucfach.FachName = $"H"; + break; + case int n when (n == 16): + ucfach.ForeColor = Config.FarbenConfig.Farben["Trockner"]; + ucfach.FachName = $"T"; + break; + case int n when (n == 17): + if (maschine.TrocknerKaputt) { ucfach.ForeColor = Config.FarbenConfig.Farben["Entladeband"]; ucfach.FachName = $"E"; } + else { ucfach.ForeColor = Config.FarbenConfig.Farben["Trockner"]; ucfach.FachName = $"T"; } + break; + case int n when (n == 18): + ucfach.ForeColor = Config.FarbenConfig.Farben["Entladeband"]; + ucfach.FachName = $"E"; + break; + default: + break; + } + + } + ucfach.KundeName = Kunde.GetKunde(null, auftrag.KundeID, null).Suchtext; + CultureInfo deCult = new CultureInfo("de-DE"); + ucfach.LieferTag = ((Liefertag)auftrag.Liefertag.DayOfWeek).ToString(); + + //TODO: Aufgabe Text + if (aufgabe != null) ucfach.Aufgabe = aufgabe.Bezeichnung; + + this.tableLayoutPanelWSVerfolgung.Controls.Add(ucfach, 0, row); + } + } + + private void Open_NeuerAuftrag() + { + FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.Userid); + if (neuerAuftrag.ShowDialog() == DialogResult.OK) + { + this.auftrag = neuerAuftrag.Auftrag; + Fach_speichern(); + } + } + private void Fach_speichern() + { + WSFach wsfach = new WSFach(); + wsfach.AuftragID = (int)this.auftrag.AuftragID; + wsfach.MaschineID = (int)this.maschine.MaschineID; + wsfach.Gewaschen = DateTime.Now; + wsfach.Gewicht = 0; + wsfach.WProgrammID = 1; + wsfach.AufgabeID = this.aufgabe.AufgabeID; + + if (wsfach.Save() == 1) + { + this.fach = wsfach; + wsfach = null; + Panel_Laden(2); + } + + } + private void Fach_update() + { + this.fach = new WSFach(); + this.fach.AuftragID = (int)this.auftrag.AuftragID; + this.fach.MaschineID = (int)this.maschine.MaschineID; + this.fach.Gewaschen = DateTime.Now; + this.fach.Gewicht = 0; + this.fach.WProgrammID = 1; + this.fach.AufgabeID = this.aufgabe.AufgabeID; + + if (this.fach.Save() == 1) Panel_Laden(2); + } + + /// + /// Value für Transport hat sich geändert und Fach wird gespeichert. + /// + /// + /// + private void Transport_ValueChanged(object sender, EventArgs e) + { + //this.SuspendLayout(); + + // Warten bis erster Transport durchgeführt wurde. + while (_monitor.WS_1_Transport == true & _monitor.WS_2_Transport == true) + { + } + if (_monitor.WS_1_Transport || _monitor.WS_2_Transport) + { + Maschine ms = (Maschine)this.maschine; + if (this.auftrag != null) + { + Fach_speichern(); + } + else + { + MessageBox.Show($"Kein Auftrag erstellt. LEERFACH wird eingegeben. Bitte in BB1 bearbeiten."); + } //WENN kein Kunde gewählt dann Fach mit KundeID 0. + + _monitor.WS_2_Transport = _monitor.WS_1_Transport = false; + } + + //this.ResumeLayout(false); + } //Wenn sich SPSDaten Transport ändert wird Event ausgelöst. (Bis jetzt mit Button ausgelöst) + + + protected override bool ProcessDialogKey(Keys keyData) + { + //TODO: Umbau in Switch. + if (Form.ModifierKeys == Keys.None && keyData == Keys.Escape) + { + this.Close(); + return true; + } + if (Form.ModifierKeys == Keys.None && keyData == Keys.Insert) + { + Open_NeuerAuftrag(); + return true; + } + if (Form.ModifierKeys == Keys.None && keyData == Keys.R) + { + Cursor.Current = Cursors.WaitCursor; + //this.SuspendLayout(); + if (((Maschine)this.maschine).MaschineID == 1) + { + if (this.auftrag == null) MessageBox.Show($"Kein Kunde ausgewählt. Bitte JETZT erledigen.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Warning); + else _monitor.WS_1_Transport = true; + } + if (((Maschine)this.maschine).MaschineID == 2) + { + if (this.auftrag == null) MessageBox.Show($"Kein Kunde ausgewählt. Bitte JETZT erledigen.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Warning); + else _monitor.WS_2_Transport = true; + } + //this.ResumeLayout(); + Cursor.Current = Cursors.Default; + return true; + } + + return base.ProcessDialogKey(keyData); + } + + private void FormWSVerfolgung_KeyDown(object sender, KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.I) // Ctrl+I + { + e.Handled = true; + e.SuppressKeyPress = true; + + + } + } + } +} diff --git a/AA-Forms/FormWSVerfolgung.resx b/AA-Forms/FormWSVerfolgung.resx new file mode 100644 index 0000000..be2c081 --- /dev/null +++ b/AA-Forms/FormWSVerfolgung.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIFSURBVDhPpZLtS1NhGMbPPxJmmlYSgqHiKzGU1EDxg4iK + YKyG2WBogqMYJQOtCEVRFBGdTBCJfRnkS4VaaWNT5sqx1BUxRXxDHYxAJLvkusEeBaPAB+5z4Jzn+t3X + /aLhnEfjo8m+dCoa+7/C3O2Hqe0zDC+8KG+cRZHZhdzaaWTVTCLDMIY0vfM04Nfh77/G/sEhwpEDbO3t + I7TxE8urEVy99fT/AL5gWDLrTB/hnF4XsW0khCu5ln8DmJliT2AXrcNBsU1gj/MH4nMeKwBrPktM28xM + cX79DFKrHHD5d9D26hvicx4pABt2lpg10zYzU0zr7+e3xXGcrkEB2O2TNec9nJFwB3alZn5jZorfeDZh + 6Q3g8s06BeCoKF4MRURoH1+BY2oNCbeb0TIclIYxOhzf8frTOuo7FxCbbVIAzpni0iceEc8vhzEwGkJD + lx83ymxifejdKjRNk/8PWnyIyTQqAJek0jqHwfEVscu31baIu8+90sTE4nY025dQ2/5FIPpnXlzKuK8A + HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb + 1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC + nOccAdABIDXXE1nzAAAAAElFTkSuQmCC + + + \ No newline at end of file diff --git a/AA-Klassen/Fehlermeldungen.cs b/AA-Klassen/Fehlermeldungen.cs index 383aba2..600c84d 100644 --- a/AA-Klassen/Fehlermeldungen.cs +++ b/AA-Klassen/Fehlermeldungen.cs @@ -273,5 +273,18 @@ namespace DatenDB MessageBoxIcon icon = MessageBoxIcon.Error; MessageBox.Show(s, caption, buttons, icon); } + + internal DialogResult MaschinenStart() + { + DialogResult result = DialogResult.Cancel; + + string s = $"Möchtest du den Auftrag des letzten Faches wiederherstellen?"; + string caption = "ACHTUNG"; + MessageBoxButtons buttons = MessageBoxButtons.YesNo; + MessageBoxIcon icon = MessageBoxIcon.Exclamation; + + result = MessageBox.Show(s, caption, buttons, icon); + return result; + } } } diff --git a/AA-Klassen/Funktionen.cs b/AA-Klassen/Funktionen.cs index c82842a..de8dab0 100644 --- a/AA-Klassen/Funktionen.cs +++ b/AA-Klassen/Funktionen.cs @@ -50,6 +50,19 @@ namespace Deckungsbeitrag return headerFormat; } + public static Font Get_Font_Size(Font font, string text, float height) + { + Font f = font; + if (!string.IsNullOrEmpty(text)) + { + while (height > TextRenderer.MeasureText(text, f).Height) + { + f = new Font(font.FontFamily, f.Size + 1); + } + } + return f; + } + public static Font Get_Label_Font(Font font, string text, Size size) { Font f = font; @@ -742,7 +755,7 @@ namespace Deckungsbeitrag Image qrweb = Image.FromFile(ConfigurationManager.AppSettings["QrPfad"]); qrweb.RotateFlip(RotateFlipType.Rotate270FlipNone); - Bitmap bitmap = new Bitmap(1200, 340); + Bitmap bitmap = new Bitmap(1200, 300); //bitmap.SetResolution(100, 100); Graphics g = Graphics.FromImage(bitmap); Font font1 = new Font("Arial", 50, FontStyle.Bold); @@ -1057,5 +1070,30 @@ namespace Deckungsbeitrag return gb; } + /// + /// Bei DataGridView die Größe an Zeilen und Spalten anpassen. + /// + /// + /// + public static DataGridView DGV_Size_Anpassen( DataGridView g) + { + + int totalWidth = g.RowHeadersVisible ? g.RowHeadersWidth : 0; + foreach (DataGridViewColumn col in g.Columns) + { + if (col.Visible) totalWidth += col.Width; + } + + int totalHeight = g.ColumnHeadersVisible ? g.ColumnHeadersHeight : 0; + foreach (DataGridViewRow row in g.Rows) + { + if (row.Visible) totalHeight += row.Height; + } + totalHeight += g.ColumnHeadersHeight; + + g.ClientSize = new Size(totalWidth, totalHeight); + + return g; + } } } diff --git a/AA-Klassen/Kunde.cs b/AA-Klassen/Kunde.cs index 6ce1b85..377a0e4 100644 --- a/AA-Klassen/Kunde.cs +++ b/AA-Klassen/Kunde.cs @@ -36,7 +36,7 @@ namespace DatenDB if (!endsWithSpecial) { if (int.TryParse(text, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{text}'"; - else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{text}'"; + else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{text}' or name1 ~* '{text}'"; } else if (int.TryParse(text, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{text.Substring(0, 6)}'"; //TODO: Testen ob SWS-QRCodes gelesen werden können. Nur notwendig bis alle SWS-QRCodes richtig gedruckt und gelesen werden. diff --git a/AA-Klassen/WSFach.cs b/AA-Klassen/WSFach.cs index c685daa..3138c00 100644 --- a/AA-Klassen/WSFach.cs +++ b/AA-Klassen/WSFach.cs @@ -10,7 +10,7 @@ namespace Deckungsbeitrag.AA_Klassen { public class WSFach { - private const string COLUMNS = "fach_id, auftrag_id, maschine_id, gewaschen, extraauftrag_id, gewicht, wprogramm_id"; + private const string COLUMNS = "fach_id, auftrag_id, maschine_id, gewaschen, extraauftrag_id, gewicht, wprogramm_id, aufgabe_id"; private const string TABLE = "kundenverwaltung.wsfach"; public WSFach() @@ -25,6 +25,7 @@ namespace Deckungsbeitrag.AA_Klassen public int? ExtraAuftragID { get; set; } public double Gewicht { get; set; } = 0; public int? WProgrammID { get; set; } + public int? AufgabeID { get; set; } internal static List GetFachliste(Maschine maschine) { @@ -52,6 +53,7 @@ namespace Deckungsbeitrag.AA_Klassen this.ExtraAuftragID = reader.IsDBNull(4) ? null : (int?)reader.GetInt32(4); this.Gewicht = reader.GetDouble(5); this.WProgrammID = reader.IsDBNull(6) ? null : (int?)reader.GetInt32(6); + this.AufgabeID = reader.IsDBNull(7) ? null : (int?)reader.GetInt32(7); } public int Save() { @@ -61,13 +63,13 @@ namespace Deckungsbeitrag.AA_Klassen if (this.FachID.HasValue & this.FachID != 0) { - command.CommandText = $"update {TABLE} set auftrag_id = :p1, maschine_id = :p2, gewaschen = :p3, extraauftrag_id = :p4, gewicht = :p5, wprogramm_id = :p6 where fach_id = :p0"; + command.CommandText = $"update {TABLE} set auftrag_id = :p1, maschine_id = :p2, gewaschen = :p3, extraauftrag_id = :p4, gewicht = :p5, wprogramm_id = :p6, aufgabe_id = :p7 where fach_id = :p0"; } else { command.CommandText = "select nextval('kundenverwaltung.wsfach_seq')"; this.FachID = (int)(long)command.ExecuteScalar(); - command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6)"; + command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7)"; } command.Parameters.AddWithValue("p0", this.FachID); command.Parameters.AddWithValue("p1", this.AuftragID); @@ -76,6 +78,7 @@ namespace Deckungsbeitrag.AA_Klassen command.Parameters.AddWithValue("p4", this.ExtraAuftragID.HasValue ? this.ExtraAuftragID.Value : (object)DBNull.Value); command.Parameters.AddWithValue("p5", this.Gewicht); command.Parameters.AddWithValue("p6", this.WProgrammID.HasValue ? this.WProgrammID.Value : (object)DBNull.Value); + command.Parameters.AddWithValue("p7", this.AufgabeID.HasValue ? this.AufgabeID.Value : (object)DBNull.Value); int result = command.ExecuteNonQuery(); DatenbankConnection.GetConnection().Close(); diff --git a/App.config b/App.config index e35248a..d26fdb3 100644 --- a/App.config +++ b/App.config @@ -9,7 +9,7 @@ - + diff --git a/Program.cs b/Program.cs index 3987786..86a3aa6 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ using DatenDB; +using Deckungsbeitrag.AA_Forms; using System; using System.Collections.Generic; using System.Configuration; @@ -29,7 +30,7 @@ namespace Deckungsbeitrag //TODO: Wenn mit Anmeldung dann if-Clause entfernen und Switch alleine verwenden. if (userid.StartsWith("ms") | userid.StartsWith("ps")) { - if (userid.Contains("wstrasse")) Application.Run(new FormAusschlager(userid)); + if (userid.Contains("wstrasse")) Application.Run(new FormWSVerfolgung(userid)); else Application.Run(new FormFehlmengeCount(userid)); } else diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 6a3bd63..06a6c2e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.1.1")] -[assembly: AssemblyFileVersion("1.0.1.1")] +[assembly: AssemblyVersion("1.0.1.3")] +[assembly: AssemblyFileVersion("1.0.1.3")] diff --git a/SetupVerwaltung/SetupVerwaltung.vdproj b/SetupVerwaltung/SetupVerwaltung.vdproj index 03a96f6..deb4fa1 100644 --- a/SetupVerwaltung/SetupVerwaltung.vdproj +++ b/SetupVerwaltung/SetupVerwaltung.vdproj @@ -213,6 +213,12 @@ } "Entry" { + "MsmKey" = "8:_52990414836E4CF7BD50C1245D0F9B6F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_5CDE0A18B0E8657CBCF9143673DB464A" "OwnerKey" = "8:_AD2C2F4AADC342899908C708EB4F4A72" "MsmSig" = "8:_UNDEFINED" @@ -363,12 +369,6 @@ } "Entry" { - "MsmKey" = "8:_C9B6A80501F441EF8F136C44B8658363" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_CC6E1B525578AF50C3DD3123399882F3" "OwnerKey" = "8:_14F178F5FD5EFA4C1973A6B30514E332" "MsmSig" = "8:_UNDEFINED" @@ -987,6 +987,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_52990414836E4CF7BD50C1245D0F9B6F" + { + "SourcePath" = "8:..\\wirlneu_transparent (1).ico" + "TargetName" = "8:wirlneu_transparent (1).ico" + "Tag" = "8:" + "Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5CDE0A18B0E8657CBCF9143673DB464A" { "AssemblyRegister" = "3:1" @@ -1421,26 +1441,6 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C9B6A80501F441EF8F136C44B8658363" - { - "SourcePath" = "8:..\\..\\..\\..\\OneDrive - gehgassi GmbH\\Wäscherei Wirl\\Programme\\Verwaltung\\wirlneu_transparent (1).ico" - "TargetName" = "8:wirlneu_transparent (1).ico" - "Tag" = "8:" - "Folder" = "8:_C848DFB5E4D140A7A7F5E1F129613626" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CC6E1B525578AF50C3DD3123399882F3" { "AssemblyRegister" = "3:1" @@ -1595,7 +1595,7 @@ } "{3C67513D-01DD-4637-8A68-80971EB9504F}:_C848DFB5E4D140A7A7F5E1F129613626" { - "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\Verwaltung" "Name" = "8:#1925" "AlwaysCreate" = "11:FALSE" "Condition" = "8:" @@ -1621,15 +1621,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:SetupVerwaltung" - "ProductCode" = "8:{CE862A37-F37D-4715-B78F-AC14E938FCB5}" - "PackageCode" = "8:{DFF6C8EF-A6C5-4718-89BC-8ABB66EE614B}" + "ProductCode" = "8:{9E8C033A-6762-4108-957E-1D834D568DC0}" + "PackageCode" = "8:{B5ED7236-241E-4943-A031-B70E366CC2D5}" "UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}" "AspNetVersion" = "8:" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:FALSE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0.7" + "ProductVersion" = "8:1.0.9" "Manufacturer" = "8:Kilian Wirl GmbH" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -1639,7 +1639,7 @@ "Keywords" = "8:" "ARPCOMMENTS" = "8:" "ARPURLINFOABOUT" = "8:" - "ARPPRODUCTICON" = "8:_C9B6A80501F441EF8F136C44B8658363" + "ARPPRODUCTICON" = "8:_52990414836E4CF7BD50C1245D0F9B6F" "ARPIconIndex" = "3:0" "SearchPath" = "8:" "UseSystemSearchPath" = "11:TRUE" @@ -1742,34 +1742,6 @@ } "Shortcut" { - "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_B7B8A605AC67476DAC62238B39B0AB87" - { - "Name" = "8:wirlneu_transparent (1).ico" - "Arguments" = "8:" - "Description" = "8:" - "ShowCmd" = "3:1" - "IconIndex" = "3:0" - "Transitive" = "11:FALSE" - "Target" = "8:_C9B6A80501F441EF8F136C44B8658363" - "Folder" = "8:_7771382F74F540C291805EF69D4901EA" - "WorkingFolder" = "8:_C848DFB5E4D140A7A7F5E1F129613626" - "Icon" = "8:" - "Feature" = "8:" - } - "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_D94F927914784F6FA176F30378DE1E35" - { - "Name" = "8:wirlneu_transparent (1).ico" - "Arguments" = "8:" - "Description" = "8:" - "ShowCmd" = "3:1" - "IconIndex" = "3:0" - "Transitive" = "11:FALSE" - "Target" = "8:_C9B6A80501F441EF8F136C44B8658363" - "Folder" = "8:_78ADD2548EB14913852C3FD3BBF1389C" - "WorkingFolder" = "8:_C848DFB5E4D140A7A7F5E1F129613626" - "Icon" = "8:" - "Feature" = "8:" - } } "UserInterface" { diff --git a/UCArtikel.Designer.cs b/UCArtikel.Designer.cs deleted file mode 100644 index ea215f4..0000000 --- a/UCArtikel.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -namespace Deckungsbeitrag -{ - partial class UCArtikel - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Komponenten-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - this.tBAnzahl = new System.Windows.Forms.TextBox(); - this.cBArtikel = new System.Windows.Forms.ComboBox(); - this.SuspendLayout(); - // - // tBAnzahl - // - this.tBAnzahl.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tBAnzahl.Location = new System.Drawing.Point(177, 5); - this.tBAnzahl.Name = "tBAnzahl"; - this.tBAnzahl.Size = new System.Drawing.Size(105, 31); - this.tBAnzahl.TabIndex = 0; - // - // cBArtikel - // - this.cBArtikel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cBArtikel.FormattingEnabled = true; - this.cBArtikel.Location = new System.Drawing.Point(3, 3); - this.cBArtikel.Name = "cBArtikel"; - this.cBArtikel.Size = new System.Drawing.Size(168, 33); - this.cBArtikel.TabIndex = 1; - // - // UCArtikel - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.cBArtikel); - this.Controls.Add(this.tBAnzahl); - this.Name = "UCArtikel"; - this.Size = new System.Drawing.Size(287, 40); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox tBAnzahl; - private System.Windows.Forms.ComboBox cBArtikel; - } -} diff --git a/UCArtikel.cs b/UCArtikel.cs deleted file mode 100644 index 83eda3c..0000000 --- a/UCArtikel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Deckungsbeitrag -{ - public partial class UCArtikel : UserControl - { - public UCArtikel() - { - InitializeComponent(); - } - } -} diff --git a/UCFach.Designer.cs b/UCFach.Designer.cs new file mode 100644 index 0000000..b7e207e --- /dev/null +++ b/UCFach.Designer.cs @@ -0,0 +1,125 @@ +namespace Deckungsbeitrag +{ + partial class UCFach + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.labelFach = new System.Windows.Forms.Label(); + this.labelKunde = new System.Windows.Forms.Label(); + this.labelLiefertag = new System.Windows.Forms.Label(); + this.labelAufgabe = new System.Windows.Forms.Label(); + this.tableLayoutPanelUCFach = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanelUCFach.SuspendLayout(); + this.SuspendLayout(); + // + // labelFach + // + this.labelFach.AutoSize = true; + this.labelFach.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelFach.Location = new System.Drawing.Point(3, 0); + this.labelFach.Name = "labelFach"; + this.labelFach.Size = new System.Drawing.Size(189, 50); + this.labelFach.TabIndex = 0; + this.labelFach.Text = "Fach"; + this.labelFach.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // labelKunde + // + this.labelKunde.AutoSize = true; + this.labelKunde.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelKunde.Location = new System.Drawing.Point(198, 0); + this.labelKunde.Name = "labelKunde"; + this.labelKunde.Size = new System.Drawing.Size(189, 50); + this.labelKunde.TabIndex = 1; + this.labelKunde.Text = "Kunde"; + this.labelKunde.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelLiefertag + // + this.labelLiefertag.AutoSize = true; + this.labelLiefertag.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelLiefertag.Location = new System.Drawing.Point(393, 0); + this.labelLiefertag.Name = "labelLiefertag"; + this.labelLiefertag.Size = new System.Drawing.Size(59, 50); + this.labelLiefertag.TabIndex = 2; + this.labelLiefertag.Text = "Liefertag"; + this.labelLiefertag.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelAufgabe + // + this.labelAufgabe.AutoSize = true; + this.labelAufgabe.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelAufgabe.Location = new System.Drawing.Point(458, 0); + this.labelAufgabe.Name = "labelAufgabe"; + this.labelAufgabe.Size = new System.Drawing.Size(190, 50); + this.labelAufgabe.TabIndex = 3; + this.labelAufgabe.Text = "Aufgabe"; + this.labelAufgabe.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanelUCFach + // + this.tableLayoutPanelUCFach.ColumnCount = 4; + this.tableLayoutPanelUCFach.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanelUCFach.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanelUCFach.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanelUCFach.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanelUCFach.Controls.Add(this.labelFach, 0, 0); + this.tableLayoutPanelUCFach.Controls.Add(this.labelAufgabe, 3, 0); + this.tableLayoutPanelUCFach.Controls.Add(this.labelKunde, 1, 0); + this.tableLayoutPanelUCFach.Controls.Add(this.labelLiefertag, 2, 0); + this.tableLayoutPanelUCFach.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanelUCFach.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanelUCFach.Name = "tableLayoutPanelUCFach"; + this.tableLayoutPanelUCFach.RowCount = 1; + this.tableLayoutPanelUCFach.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanelUCFach.Size = new System.Drawing.Size(651, 50); + this.tableLayoutPanelUCFach.TabIndex = 4; + // + // UCFach + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Transparent; + this.Controls.Add(this.tableLayoutPanelUCFach); + this.Name = "UCFach"; + this.Size = new System.Drawing.Size(651, 50); + this.Load += new System.EventHandler(this.UCFach_Load); + this.tableLayoutPanelUCFach.ResumeLayout(false); + this.tableLayoutPanelUCFach.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelFach; + private System.Windows.Forms.Label labelKunde; + private System.Windows.Forms.Label labelLiefertag; + private System.Windows.Forms.Label labelAufgabe; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanelUCFach; + } +} diff --git a/UCFach.cs b/UCFach.cs new file mode 100644 index 0000000..88d8704 --- /dev/null +++ b/UCFach.cs @@ -0,0 +1,67 @@ +using DatenDB; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Deckungsbeitrag +{ + public partial class UCFach : UserControl + { + public string FachName + { + get => labelFach.Text; + set => labelFach.Text = value; + } + public string KundeName + { + get => labelKunde.Text; + set => labelKunde.Text = value; + } + public string LieferTag + { + get => labelLiefertag.Text; + set => labelLiefertag.Text = value; + } + public string Aufgabe + { + get => labelAufgabe.Text; + set => labelAufgabe.Text = value; + } + public UCFach() + { + InitializeComponent(); + } + + private void UCFach_Load(object sender, EventArgs e) + { + foreach(Label lbl in this.tableLayoutPanelUCFach.Controls) + { + lbl.Font = Funktionen.Get_Font_Size(lbl.Font, lbl.Text, GetCellSizeInPixels(tableLayoutPanelUCFach, 4, 1).Height); + } + } + /// + /// Umrechnen der Prozentgröße der Zeile in Pixelhöhe (int). + /// + /// + /// + /// + /// + public static Size GetCellSizeInPixels(TableLayoutPanel tlp, int column, int row) + { + float colPercent = 0; + float rowPercent = tlp.RowStyles[0].Height; + + int pixelWidth = (int)colPercent; + int pixelHeight = rowPercent == 0 ? 0 : (int)(tlp.Height * (rowPercent / 100f)); + + return new Size(pixelWidth, pixelHeight); + } + + } +} diff --git a/UCArtikel.resx b/UCFach.resx similarity index 100% rename from UCArtikel.resx rename to UCFach.resx diff --git a/Verwaltung.csproj b/Verwaltung.csproj index 9202fb9..30c82e5 100644 --- a/Verwaltung.csproj +++ b/Verwaltung.csproj @@ -158,6 +158,12 @@ FormNeuerBenutzer.cs + + Form + + + FormWSVerfolgung.cs + @@ -343,12 +349,6 @@ - - UserControl - - - UCArtikel.cs - UserControl @@ -358,6 +358,12 @@ + + UserControl + + + UCFach.cs + FormArtikelVW.cs @@ -436,6 +442,9 @@ FormImport.cs + + FormWSVerfolgung.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -449,12 +458,12 @@ FormKundeVW.cs - - UCArtikel.cs - UCAuftrag.cs + + UCFach.cs + SettingsSingleFileGenerator diff --git a/wirlneu_transparent (1).ico b/wirlneu_transparent (1).ico new file mode 100644 index 0000000..4ed4664 Binary files /dev/null and b/wirlneu_transparent (1).ico differ