WSFAch vorbereitet und Ausschlager Umbau

This commit is contained in:
Kilian Wirl 2025-12-05 11:50:10 +01:00
parent 85eb1dba23
commit f77b89f844
12 changed files with 433 additions and 96 deletions

View File

@ -28,15 +28,32 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.tableLayoutPanelWS = new System.Windows.Forms.TableLayoutPanel();
this.SuspendLayout(); this.SuspendLayout();
// //
// tableLayoutPanelWS
//
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.TabIndex = 0;
//
// FormAusschlager // FormAusschlager
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(600, 366);
this.Controls.Add(this.tableLayoutPanelWS);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FormAusschlager"; this.Name = "FormAusschlager";
@ -52,5 +69,7 @@
} }
#endregion #endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelWS;
} }
} }

View File

@ -1,4 +1,5 @@
using DatenDB; using DatenDB;
using Deckungsbeitrag.AA_Klassen;
using Deckungsbeitrag.Properties; using Deckungsbeitrag.Properties;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,120 +12,284 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace Deckungsbeitrag namespace Deckungsbeitrag
{ {
public partial class FormAusschlager : Form public partial class FormAusschlager : Form
{ {
private Fehlermeldungen meldung = new Fehlermeldungen();
private Auftrag auftrag;
public Maschine maschine; public Maschine maschine;
public List<Fach> fachliste; public List<Fach> fachliste;
bool maximised = false; bool maximised = false;
int height; int height;
Point loc; Point loc;
public bool ws1transport = false; public bool ws1transport = false;
public bool ws2transport = false; public bool ws2transport = false;
public FormAusschlager(Maschine ms) private string Userid { get; }
public FormAusschlager()
{ {
maschine = ms;
InitializeComponent(); InitializeComponent();
} }
public FormAusschlager(Maschine ms, Screen[] screens) :this(ms) public FormAusschlager(string userid) : this()
{ {
//maschine = ms; this.Userid = userid;
if (maschine.TrocknerKaputt == true) maschine.Faecher = maschine.Faecher - 1; //Wenn Trockner kaputt wird Fachanzahl um 1 reduziert. if (userid.Contains("01")) this.maschine = Maschine.GetMaschine(null, "Waschstrasse 1");
if (screens.Length > 1) if (userid.Contains("02")) this.maschine = Maschine.GetMaschine(null, "Waschstrasse 2");
{
if (WindowState == FormWindowState.Maximized)
{
WindowState = FormWindowState.Normal;
maximised = true;
}
foreach (Screen screen in screens) if (screen.Primary == false) { this.Location = screen.WorkingArea.Location; }
if (maximised)
{
WindowState = FormWindowState.Maximized;
}
} //Wenn nur ein Screen vorhanden wird alles auf eine Screen gelegt. Wenn mehrere Screens muss Zuordnung getroffen werden.
} }
private void FormAusschlager_Load(object sender, EventArgs e) private void FormAusschlager_Load(object sender, EventArgs e)
{ {
height = (this.Height / maschine.Faecher) - 1; //Label Height wird berechnet anhand Screen Height und Mschinenfächer. // WaitCursor und Controls ausblenden.
loc = new Point(this.Width / 2 - 250, 10); //Die Location des ersten KundenLabels wird berechnet. this.Cursor = Cursors.WaitCursor;
Funktionen.HideControls(this.Controls);
for (int i = 1; i <= maschine.Faecher; i++)
{ this.BackColor = Properties.Settings.Default.Wirlblau;
Funktionen funk = new Funktionen(); this.WindowState = FormWindowState.Maximized;
this.Controls.AddRange(funk.GetFachLabels(i, maschine, height, loc, this.Width, "Ausschlager")); this.FormBorderStyle = FormBorderStyle.None;
} //Label für neuen Screen von Funktionen holen.
if (maschine.TrocknerKaputt) this.tableLayoutPanelWS.RowCount = maschine.Faecher - 1;
else this.tableLayoutPanelWS.RowCount = maschine.Faecher;
this.tableLayoutPanelWS.ColumnCount = 4;
Get_TableLayoutPanel(this.tableLayoutPanelWS);
Load_TableLayoutPanel(this.tableLayoutPanelWS);
//DefaultCursor und Controls einblenden.
Funktionen.ShowControls(this.Controls);
this.Cursor = Cursors.Default;
} }
public void Form_Refresh(Maschine ms, SPSDaten spsdaten)
private void Load_TableLayoutPanel(TableLayoutPanel tlp)
{ {
this.SuspendLayout(); // Fachliste für Maschine holen.
List<WSFach> fachliste = WSFach.GetFachliste(this.maschine);
foreach (Label lbl in this.Controls) if (fachliste.Count > 0)
{ {
if (spsdaten.WS_1_Transport || spsdaten.WS_2_Transport) // Alle Zellen einer Spalte durchlaufen
int columnIndex = 1;
for (int row = 0; row < tlp.RowCount; row++)
{ {
Call_Funktionen(lbl, ms, spsdaten); Control cellControl = tlp.GetControlFromPosition(columnIndex, row);
}
else
{
if (ms.Bezeichnung == "Waschstrasse 1")
{
if (spsdaten.Presse1_Leer)
{
if (lbl.Name.Contains("14") || lbl.Name.Contains("15")) Call_Funktionen(lbl, maschine, spsdaten);
} //SPS Steuerung hat Presse 1 entladen und auf true geschaltet.
if (spsdaten.Trockner11_Beladen || spsdaten.Trockner12_Beladen)
{
if (lbl.Name.Contains("15") || lbl.Name.Contains("16") || lbl.Name.Contains("17")) Call_Funktionen(lbl, maschine, spsdaten);
} //SPS Steuerung hat Trockner beladen und auf true geschaltet.
if (spsdaten.Trockner11_Entladen || spsdaten.Trockner12_Entladen)
{
if (lbl.Name.Contains("18") || lbl.Name.Contains("16") || lbl.Name.Contains("17")) Call_Funktionen(lbl, maschine, spsdaten);
} //SPS Steuerung hat Trockner entladen und auf true geschaltet.
}
if (ms.Bezeichnung == "Waschstrasse 2") if (cellControl != null && cellControl is Label lbl)
{ {
if (spsdaten.Presse2_Leer) // Label in Zelle (col=2, row) bearbeiten
{ lbl.BackColor = Color.LightBlue;
if (lbl.Name.Contains("17") || lbl.Name.Contains("18")) Call_Funktionen(lbl, maschine, spsdaten); lbl.Text = $"Col {columnIndex} Row {row}";
} //SPS Steuerung hat Presse 2 entladen und auf true geschaltet.
if (spsdaten.Trockner21_Beladen || spsdaten.Trockner22_Beladen)
{
if (lbl.Name.Contains("18") || lbl.Name.Contains("19") || lbl.Name.Contains("20")) Call_Funktionen(lbl, maschine, spsdaten);
} //SPS Steuerung hat Trockner beladen und auf true geschaltet.
if (spsdaten.Trockner21_Entladen || spsdaten.Trockner22_Entladen)
{
if (lbl.Name.Contains("21") || lbl.Name.Contains("19") || lbl.Name.Contains("20")) Call_Funktionen(lbl, maschine, spsdaten);
} //SPS Steuerung hat Trockner entladen und auf true geschalltet.
} }
} }
} }
//this.Refresh(); else { meldung.MaschineIstLeer(null); }
this.ResumeLayout();
} }
private void Call_Funktionen(Label lbl, Maschine maschine, SPSDaten spsdaten)
/// <summary>
/// Label in jede Zelle des Panels einfügen und mit Schriftfarben aus den Settings versehen. Fach Label hat auch Text erhalten.
/// </summary>
/// <param name="tlp"></param>
private void Get_TableLayoutPanel(TableLayoutPanel tlp)
{
int rows = tlp.RowCount;
int cols = tlp.ColumnCount;
// Alle Spalten und Zeilen Styles entfernen.
tlp.ColumnStyles.Clear();
tlp.RowStyles.Clear();
// Labels in jeder Zelle erstellen
for (int row = 0; row < rows; row++)
{
// Reihen gleichmäßig am Screen verteilen.
tlp.RowStyles.Add(new RowStyle(SizeType.Percent, 100F / rows));
for (int col = 0; col < cols; col++)
{
tlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute));
Label lbl = new Label();
lbl.Name = $"Zeile {row}, Spalte {col}";
lbl.Dock = DockStyle.Fill;
lbl.Tag = Tuple.Create(row, col);
lbl.BackColor = Color.Transparent;
// Content Alignment pro Spalte festlegen.
switch (col)
{
case 0:
lbl.TextAlign = ContentAlignment.MiddleRight;
lbl.Text = "Fach";
break;
case 1:
lbl.TextAlign = ContentAlignment.MiddleCenter;
lbl.Text = "Kunde";
break;
case 2:
lbl.TextAlign = ContentAlignment.MiddleLeft;
lbl.Text = "Liefertag";
break;
case 3:
lbl.TextAlign = ContentAlignment.MiddleLeft;
lbl.Text = "Aufgabe";
break;
default:
break;
}
// Schriftfarbe nach Fachzahl zuordnen.
if(this.maschine.Bezeichnung == "Waschstrasse 1")
{
switch (row)
{
case int n when (n <= 4):
lbl.ForeColor = Config.FarbenConfig.Farben["Beladeband"];
if (lbl.Text == "Fach") lbl.Text = $"F";
break;
case int n when (n >= 5 && n <= 13):
lbl.ForeColor = Config.FarbenConfig.Farben["Waschstrasse"];
if (lbl.Text == "Fach") lbl.Text = $"W";
break;
case int n when (n == 14):
lbl.ForeColor = Config.FarbenConfig.Farben["Presse"];
if (lbl.Text == "Fach") lbl.Text = $"P";
break;
case int n when (n == 15):
lbl.ForeColor = Config.FarbenConfig.Farben["Hubband"];
if (lbl.Text == "Fach") lbl.Text = $"H";
break;
case int n when (n == 16):
lbl.ForeColor = Config.FarbenConfig.Farben["Trockner"];
if (lbl.Text == "Fach") lbl.Text = $"T";
break;
case int n when (n == 17):
if (maschine.TrocknerKaputt) { lbl.ForeColor = Config.FarbenConfig.Farben["Entladeband"]; if (lbl.Text == "Fach") lbl.Text = $"E"; }
else { lbl.ForeColor = Config.FarbenConfig.Farben["Trockner"]; if (lbl.Text == "Fach") lbl.Text = $"T"; }
break;
case int n when (n == 18):
lbl.ForeColor = Config.FarbenConfig.Farben["Entladeband"];
if (lbl.Text == "Fach") lbl.Text = $"E";
break;
default:
break;
}
}
if(this.maschine.Bezeichnung == "Waschstrasse 2")
{
switch (row)
{
case int n when (n <= 5):
lbl.ForeColor = Config.FarbenConfig.Farben["Beladeband"];
if (lbl.Text == "Fach") lbl.Text = $"F";
break;
case int n when (n >= 6 && n <= 17):
lbl.ForeColor = Config.FarbenConfig.Farben["Waschstrasse"];
if (lbl.Text == "Fach") lbl.Text = $"W";
break;
case int n when (n == 18):
lbl.ForeColor = Config.FarbenConfig.Farben["Presse"];
if (lbl.Text == "Fach") lbl.Text = $"P";
break;
case int n when (n == 19):
lbl.ForeColor = Config.FarbenConfig.Farben["Hubband"];
if (lbl.Text == "Fach") lbl.Text = $"H";
break;
case int n when (n == 20):
lbl.ForeColor = Config.FarbenConfig.Farben["Trockner"];
if (lbl.Text == "Fach") lbl.Text = $"T";
break;
case int n when (n == 21):
if (maschine.TrocknerKaputt) { lbl.ForeColor = Config.FarbenConfig.Farben["Entladeband"]; if (lbl.Text == "Fach") lbl.Text = $"E"; }
else { lbl.ForeColor = Config.FarbenConfig.Farben["Trockner"]; if (lbl.Text == "Fach") lbl.Text = $"T"; }
break;
case int n when (n == 22):
lbl.ForeColor = Config.FarbenConfig.Farben["Entladeband"];
if (lbl.Text == "Fach") lbl.Text = $"E";
break;
default:
break;
}
}
// Schriftgröße an Zellenhöhe anpassen.
lbl.Font = Funktionen.Get_Label_Font(lbl.Font, lbl.Text, GetCellSizeInPixels(tlp, cols, rows));
tlp.Controls.Add(lbl, col, row);
}
}
}
public void Form_Refresh(Maschine ms, SPSDaten spsdaten)
{ {
Funktionen.Label_Refresh(lbl, maschine, spsdaten, "Ausschlager");
} }
private void FormAusschlager_SizeChanged(object sender, EventArgs e) private void FormAusschlager_SizeChanged(object sender, EventArgs e)
{ {
if(WindowState == FormWindowState.Maximized)
{
this.Controls.Clear();
FormAusschlager_Load(this, null);
}
} }
private void FormAusschlager_ResizeEnd(object sender, EventArgs e) private void FormAusschlager_ResizeEnd(object sender, EventArgs e)
{ {
this.Controls.Clear();
FormAusschlager_Load(this, null);
} }
/// <summary>
/// Umrechnen der Prozentgröße der Zeile in Pixelhöhe (int).
/// </summary>
/// <param name="tlp"></param>
/// <param name="column"></param>
/// <param name="row"></param>
/// <returns></returns>
public static Size GetCellSizeInPixels(TableLayoutPanel tlp, int column, int row)
{
float colPercent = 0;
float rowPercent = tlp.RowStyles[0].Height;
int pixelWidth = colPercent == 0 ? 0 : (int)(tlp.Width * (colPercent / 100f));
int pixelHeight = rowPercent == 0 ? 0 : (int)(tlp.Height * (rowPercent / 100f));
return new Size(pixelWidth, pixelHeight);
}
/// <summary>
/// KEIN VERWEIS NOTWENDIG
/// Wenn ESC gedrückt wird schließt sich das Fenster.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected override bool ProcessDialogKey(Keys keyData)
{
if (Form.ModifierKeys == Keys.None && keyData == Keys.Escape)
{
this.Close();
return true;
}
if (Form.ModifierKeys == Keys.None && keyData == Keys.Insert)
{
Open_NeuerAuftrag();
return true;
}
return base.ProcessDialogKey(keyData);
}
private void Open_NeuerAuftrag()
{
FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(this.Userid);
if (neuerAuftrag.ShowDialog() == DialogResult.OK)
{
this.auftrag = neuerAuftrag.Auftrag;
}
}
//TODO: Wenn NeuerAuftrag gewählt wie gehts weiter?
//TODO: Bei Transport wir ein Fach mit Aktuellem Auftrag erstellt. Das Alte wird bei Transport gespeichert.
//TODO: Wenn NeuerAuftrag gewählt Fach ändern nicht vergessen.
//TODO: Eventuell einen "Nächsten Auftrag" erstellen damit im Vorraus erstellt werden kann?
} }
} }

View File

@ -33,6 +33,7 @@ namespace Deckungsbeitrag
public DateTime? letzterLiefertag; public DateTime? letzterLiefertag;
private Kunde knd; private Kunde knd;
public DataGridViewCell aktivCell; public DataGridViewCell aktivCell;
private string userid;
public FormNeuerAuftrag() public FormNeuerAuftrag()
{ {
@ -48,6 +49,13 @@ namespace Deckungsbeitrag
this.letzterLiefertag = letzterLiefertag; this.letzterLiefertag = letzterLiefertag;
} }
public FormNeuerAuftrag(string userid) : this()
{
this.userid = userid;
if (userid.Contains("wstrasse01")) this.benutzer = Benutzer.GetBenutzer("ws1", null);
if (userid.Contains("wstrasse02")) this.benutzer = Benutzer.GetBenutzer("ws2", null);
}
private void FormNeuerAuftrag_Load(object sender, EventArgs e) private void FormNeuerAuftrag_Load(object sender, EventArgs e)
{ {
// SortimentListe holen // SortimentListe holen
@ -61,8 +69,10 @@ namespace Deckungsbeitrag
else else
{ {
// Wenn NICHT Waschstrasse dann Fenster schließen. // Wenn NICHT Waschstrasse dann Fenster schließen.
if (benutzer.Rolle == BenutzerRolle.Waschstrasse) FormNeuerAuftrag_Load(this, e); //if (this.userid.Contains("wstrasse")) FormNeuerAuftrag_Load(this, e);
else this.Close(); //else this.Close();
this.DialogResult = DialogResult.Cancel;
this.Close();
} }
this.dGArtikel.ForeColor = Color.Black; this.dGArtikel.ForeColor = Color.Black;
@ -75,10 +85,21 @@ namespace Deckungsbeitrag
comboBox_Load(); comboBox_Load();
//Unterscheidung zwischen BenutzerRollen. Verschiedene Controls werden gesperrt, angezeigt oder verändert //Unterscheidung zwischen BenutzerRollen. Verschiedene Controls werden gesperrt, angezeigt oder verändert
if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Master) if (this.benutzer != null)
{ {
this.comboBoxTyp.Enabled = true; if (this.benutzer.Rolle == BenutzerRolle.Verwaltung || this.benutzer.Rolle == BenutzerRolle.Admin || this.benutzer.Rolle == BenutzerRolle.Master)
this.comboBoxTyp.SelectedIndex = 1; {
this.comboBoxTyp.Enabled = true;
this.comboBoxTyp.SelectedIndex = 1;
}
else
{
this.comboBoxTyp.Enabled = false;
this.dGArtikel.Enabled = this.dGArtikel.Visible = false;
this.Width = textBoxKundeName.Right + 10;
this.Height = 405;
this.comboBoxTyp.SelectedIndex = 1;
}
} }
else else
{ {
@ -88,6 +109,7 @@ namespace Deckungsbeitrag
this.Height = 405; this.Height = 405;
this.comboBoxTyp.SelectedIndex = 1; this.comboBoxTyp.SelectedIndex = 1;
} }
} }
/// <summary> /// <summary>

View File

@ -264,5 +264,14 @@ namespace DatenDB
return result; return result;
} }
internal void MaschineIstLeer(string s)
{
if (s == null) s = $"Die Maschine ist leer. Es konnten keine Fächer gefunden werden.";
string caption = "FEHLER";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBoxIcon icon = MessageBoxIcon.Error;
MessageBox.Show(s, caption, buttons, icon);
}
} }
} }

View File

@ -37,6 +37,7 @@ namespace Deckungsbeitrag
public Funktionen() public Funktionen()
{ {
} }
public static HeaderFormatStyle GetHeader() public static HeaderFormatStyle GetHeader()
{ {
HeaderFormatStyle headerFormat = new HeaderFormatStyle(); HeaderFormatStyle headerFormat = new HeaderFormatStyle();

86
AA-Klassen/WSFach.cs Normal file
View File

@ -0,0 +1,86 @@
using DatenDB;
using Npgsql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 TABLE = "kundenverwaltung.wsfach";
public WSFach()
{
}
public int? FachID { get; set; }
public int AuftragID { get; set; }
public int MaschineID { get; set; }
public DateTime Gewaschen { get; set; }
public int? ExtraAuftragID { get; set; }
public double Gewicht { get; set; } = 0;
public int? WProgrammID { get; set; }
internal static List<WSFach> GetFachliste(Maschine maschine)
{
int faecher = 0;
if (maschine.TrocknerKaputt) faecher = maschine.Faecher - 1;
else faecher = maschine.Faecher;
DatenbankConnection.GetConnection().Open();
List<WSFach> resultlist = new List<WSFach>();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
command.CommandText = $"select {COLUMNS} from {TABLE} where maschine_id = {maschine.MaschineID} order by fach_id desc limit {faecher}";
NpgsqlDataReader reader = command.ExecuteReader();
while (reader.Read()) resultlist.Add(new WSFach(reader));
reader.Close();
DatenbankConnection.GetConnection().Close();
return resultlist;
}
public WSFach(NpgsqlDataReader reader)
{
this.FachID = reader.GetInt32(0);
this.AuftragID = reader.GetInt32(1);
this.MaschineID = reader.GetInt32(2);
this.Gewaschen = reader.GetDateTime(3);
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);
}
public int Save()
{
DatenbankConnection.GetConnection().Open();
NpgsqlCommand command = new NpgsqlCommand();
command.Connection = DatenbankConnection.GetConnection();
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";
}
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.Parameters.AddWithValue("p0", this.FachID);
command.Parameters.AddWithValue("p1", this.AuftragID);
command.Parameters.AddWithValue("p2", this.MaschineID);
command.Parameters.AddWithValue("p3", this.Gewaschen);
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);
int result = command.ExecuteNonQuery();
DatenbankConnection.GetConnection().Close();
return result;
}
}
}

View File

@ -9,7 +9,7 @@
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<appSettings> <appSettings>
<add key="ConnectionString" value="user id=postgres;password=Ki985941Wi;host=10.10.10.1;port=5432;database=Wirl_DB_17012023;Timeout=5" /> <add key="ConnectionString" value="user id=mswstrasse01;password=NGp5Y8Nfs2;host=10.10.10.1;port=5432;database=Wirl_DB_17012023;Timeout=5" />
<add key="SortimentPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\Kundensortiment.txt" /> <add key="SortimentPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\Kundensortiment.txt" />
<add key="BildPfad" value="C:\\Users\\KilianWirl\\OneDrive - gehgassi GmbH\\Wäscherei Wirl\\Programme\\Deckungsbeitrag\\Deckungsbeitrag\\Star.png" /> <add key="BildPfad" value="C:\\Users\\KilianWirl\\OneDrive - gehgassi GmbH\\Wäscherei Wirl\\Programme\\Deckungsbeitrag\\Deckungsbeitrag\\Star.png" />
<add key="QrPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\qrweb.png" /> <add key="QrPfad" value="N:\\BÜRO\\SOCOM\\Zaehlscheine\\qrweb.png" />
@ -113,22 +113,22 @@
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="Beladeband" serializeAs="String"> <setting name="Beladeband" serializeAs="String">
<value /> <value>Yellow</value>
</setting> </setting>
<setting name="Waschstrasse" serializeAs="String"> <setting name="Waschstrasse" serializeAs="String">
<value /> <value>White</value>
</setting> </setting>
<setting name="Presse" serializeAs="String"> <setting name="Presse" serializeAs="String">
<value /> <value>Red</value>
</setting> </setting>
<setting name="Hubband" serializeAs="String"> <setting name="Hubband" serializeAs="String">
<value /> <value>LightBlue</value>
</setting> </setting>
<setting name="Trockner" serializeAs="String"> <setting name="Trockner" serializeAs="String">
<value /> <value>Green</value>
</setting> </setting>
<setting name="Entladeband" serializeAs="String"> <setting name="Entladeband" serializeAs="String">
<value /> <value>Violet</value>
</setting> </setting>
<setting name="AuftAbgel" serializeAs="String"> <setting name="AuftAbgel" serializeAs="String">
<value /> <value />

27
Config.cs Normal file
View File

@ -0,0 +1,27 @@
using Deckungsbeitrag.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deckungsbeitrag
{
public static class Config
{
public static class FarbenConfig
{
public static readonly IReadOnlyDictionary<string, Color> Farben = new Dictionary<string, Color>
{
["Beladeband"] = Settings.Default.Beladeband,
["Waschstrasse"] = Settings.Default.Waschstrasse,
["Presse"] = Settings.Default.Presse,
["Trockner"] = Settings.Default.Trockner,
["Entladeband"] = Settings.Default.Entladeband,
["Hubband"] = Settings.Default.Hubband
};
}
}
}

View File

@ -29,8 +29,8 @@ namespace Deckungsbeitrag
//TODO: Wenn mit Anmeldung dann if-Clause entfernen und Switch alleine verwenden. //TODO: Wenn mit Anmeldung dann if-Clause entfernen und Switch alleine verwenden.
if (userid.StartsWith("ms") | userid.StartsWith("ps")) if (userid.StartsWith("ms") | userid.StartsWith("ps"))
{ {
// Maschinen Einstiegspunkt. Keine Anmeldung notwendig. if (userid.Contains("wstrasse")) Application.Run(new FormAusschlager(userid));
Application.Run(new FormFehlmengeCount(userid)); else Application.Run(new FormFehlmengeCount(userid));
} }
else else
{ {

View File

@ -139,6 +139,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Yellow")]
public global::System.Drawing.Color Beladeband { public global::System.Drawing.Color Beladeband {
get { get {
return ((global::System.Drawing.Color)(this["Beladeband"])); return ((global::System.Drawing.Color)(this["Beladeband"]));
@ -150,6 +151,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("White")]
public global::System.Drawing.Color Waschstrasse { public global::System.Drawing.Color Waschstrasse {
get { get {
return ((global::System.Drawing.Color)(this["Waschstrasse"])); return ((global::System.Drawing.Color)(this["Waschstrasse"]));
@ -161,6 +163,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Red")]
public global::System.Drawing.Color Presse { public global::System.Drawing.Color Presse {
get { get {
return ((global::System.Drawing.Color)(this["Presse"])); return ((global::System.Drawing.Color)(this["Presse"]));
@ -172,6 +175,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("LightBlue")]
public global::System.Drawing.Color Hubband { public global::System.Drawing.Color Hubband {
get { get {
return ((global::System.Drawing.Color)(this["Hubband"])); return ((global::System.Drawing.Color)(this["Hubband"]));
@ -183,6 +187,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Green")]
public global::System.Drawing.Color Trockner { public global::System.Drawing.Color Trockner {
get { get {
return ((global::System.Drawing.Color)(this["Trockner"])); return ((global::System.Drawing.Color)(this["Trockner"]));
@ -194,6 +199,7 @@ namespace Deckungsbeitrag.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Violet")]
public global::System.Drawing.Color Entladeband { public global::System.Drawing.Color Entladeband {
get { get {
return ((global::System.Drawing.Color)(this["Entladeband"])); return ((global::System.Drawing.Color)(this["Entladeband"]));

View File

@ -33,22 +33,22 @@
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="Beladeband" Type="System.Drawing.Color" Scope="User"> <Setting Name="Beladeband" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">Yellow</Value>
</Setting> </Setting>
<Setting Name="Waschstrasse" Type="System.Drawing.Color" Scope="User"> <Setting Name="Waschstrasse" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">White</Value>
</Setting> </Setting>
<Setting Name="Presse" Type="System.Drawing.Color" Scope="User"> <Setting Name="Presse" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">Red</Value>
</Setting> </Setting>
<Setting Name="Hubband" Type="System.Drawing.Color" Scope="User"> <Setting Name="Hubband" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">LightBlue</Value>
</Setting> </Setting>
<Setting Name="Trockner" Type="System.Drawing.Color" Scope="User"> <Setting Name="Trockner" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">Green</Value>
</Setting> </Setting>
<Setting Name="Entladeband" Type="System.Drawing.Color" Scope="User"> <Setting Name="Entladeband" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)">Violet</Value>
</Setting> </Setting>
<Setting Name="AuftAbgel" Type="System.Drawing.Color" Scope="User"> <Setting Name="AuftAbgel" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />

View File

@ -330,6 +330,8 @@
<Compile Include="AA-Klassen\ListViewColumnSorter.cs" /> <Compile Include="AA-Klassen\ListViewColumnSorter.cs" />
<Compile Include="AA-Klassen\OLVBewertung.cs" /> <Compile Include="AA-Klassen\OLVBewertung.cs" />
<Compile Include="AA-Klassen\OLVKundenumsatz.cs" /> <Compile Include="AA-Klassen\OLVKundenumsatz.cs" />
<Compile Include="AA-Klassen\WSFach.cs" />
<Compile Include="Config.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="AA-Forms\FormKundeVW.cs"> <Compile Include="AA-Forms\FormKundeVW.cs">