This commit is contained in:
Kilian Wirl 2026-04-02 10:19:25 +02:00
parent 3c9fa8d411
commit bad40e8b71
5 changed files with 356 additions and 317 deletions

View File

@ -37,8 +37,8 @@ namespace Deckungsbeitrag
#region Properties
private Benutzer benutzer = null;
Meldungen meldung = new Meldungen();
bool open = false;
private Meldungen meldung = new Meldungen();
private bool open = false;
private bool isDragging = false;
private Point dragStartPoint;
private Point newLocation;
@ -1079,11 +1079,18 @@ namespace Deckungsbeitrag
uCInventur.Visible = false;
uCInventur.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.
@ -1447,6 +1454,7 @@ namespace Deckungsbeitrag
kunde = liste.kunde;
uCInventur = new UCInventur(kunde, this.benutzer);
uCInventur.UCInventur_Update += () => { this.GetInventuren(); };
uCInventur.UCInventur_Delete += Do_UCInventur_Delete;
this.panelMain.Controls.Add(uCInventur);
uCInventur.Location = new Point(100, 100);
uCInventur.BringToFront();

View File

@ -49,6 +49,7 @@
this.panelButtons = new System.Windows.Forms.Panel();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.labelInvText = new System.Windows.Forms.Label();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.groupBoxInventur.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
@ -268,6 +269,7 @@
// panelButtons
//
this.panelButtons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelButtons.Controls.Add(this.buttonAbbrechen);
this.panelButtons.Controls.Add(this.buttonSpeichern);
this.panelButtons.Controls.Add(this.labelInvText);
this.panelButtons.Controls.Add(this.buttonFreigeben);
@ -312,6 +314,23 @@
this.labelInvText.Visible = false;
this.labelInvText.Click += new System.EventHandler(this.labelInvText_Click);
//
// buttonAbbrechen
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.Black;
this.buttonAbbrechen.Location = new System.Drawing.Point(361, -1);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(200, 50);
this.buttonAbbrechen.TabIndex = 41;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.buttonAbbrechen_Click);
//
// UCInventur
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@ -359,5 +378,6 @@
private System.Windows.Forms.Label labelLieferDat;
private System.Windows.Forms.DateTimePicker dTPLieferDat;
private System.Windows.Forms.Label labelInvDat;
private System.Windows.Forms.Button buttonAbbrechen;
}
}

View File

@ -32,6 +32,7 @@ namespace Deckungsbeitrag.UserControls
private bool _tosave = false;
public event Action SizeChangedForParent;
public event Action UCInventur_Update;
public event Action UCInventur_Delete;
private Point uci_loc;
public bool tosave
{
@ -43,11 +44,14 @@ namespace Deckungsbeitrag.UserControls
{
buttonSpeichern.Enabled = true;
buttonSpeichern.BackColor = Color.FromArgb(0, 192, 0);
if ((this.user.Rolle == BenutzerRolle.Verwaltung) || (this.user.Rolle == BenutzerRolle.Admin)) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
}
else
{
buttonSpeichern.Enabled = false;
buttonSpeichern.BackColor = Color.Gray;
buttonFreigeben.Enabled = false;
buttonFreigeben.BackColor = Color.Gray;
}
}
}
@ -75,7 +79,7 @@ namespace Deckungsbeitrag.UserControls
private void UCInventur_Load(object sender, EventArgs e)
{
if (this.user.Rolle == BenutzerRolle.Verwaltung || this.user.Rolle == BenutzerRolle.Admin) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
if ((this.user.Rolle == BenutzerRolle.Verwaltung & tosave) || (this.user.Rolle == BenutzerRolle.Admin & tosave)) { this.buttonFreigeben.Enabled = true; this.buttonFreigeben.BackColor = Color.Turquoise; }
string kundeName = this.kunde.Suchtext == null ? this.kunde.KundeName : this.kunde.Suchtext;
this.groupBoxInventur.Text = $"Inventur-{this.kunde.KundeNummer} {kundeName}";
@ -380,6 +384,7 @@ namespace Deckungsbeitrag.UserControls
private void pictureBoxClose_Click(object sender, EventArgs e)
{
if (tosave) if (MessageBox.Show("Du hast die Zahlen geändert. Möchtest du die Inventur so speichern?", "INVENTUR SPEICHERN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) buttonSpeichern_Click(this.buttonSpeichern, null);
if (groupBoxInventur.Visible)
{
this.buttonFreigeben.Visible = false;
@ -543,8 +548,14 @@ namespace Deckungsbeitrag.UserControls
}
}
}
private void buttonAbbrechen_Click(object sender, EventArgs e)
{
if (tosave) { if (MessageBox.Show("Möchtest du wirklich Abbrechen und die Inventur verwerfen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) UCInventur_Delete(); }
else UCInventur_Delete();
}
}
}
//TODO: CLick auf Inventur freigeben Dateiname von "Warten" auf "Herrichten" ändern.
//TODO: Inventur freigeben nur für Admin oder Verwaltung.
//TODO: Inventur für Expedit zugänglich machen.
//DONE: Inventur freigeben nur für Admin oder Verwaltung.
//DONE: Inventur für Expedit zugänglich machen.

View File

@ -121,7 +121,7 @@
<data name="pictureBoxClose.ErrorImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAALtJREFUOE/tkTEKAjEQRdNbCJ7Eq+h2gngd9QwWyp5it/IoabRYQaKwvx35iyOT
wAAADsABataJCQAAALtJREFUOE/tkTEKAjEQRdNbCJ7Eq+h2gngd9QwWyp5it/IoabRYQaKwvx35iyOT
mE1p5cAnw8z/j5A4EXFUWgDO3f0pFPt0/8mVANP1Sag/4FcAAHMAnucYwHoiAAd9j7DctXLpwuNtjACc
cVftW6FXIQrwi20jrjrIbFMrxBuA54w7eujlLLqBNfC83sIQptjbnd7y6w1SyGR1HDQWjgD6SBZiZcPZ
X9DKQdJwEZBCcmFWEcBSSC7M0twLBeEEF8s9ZFEAAAAASUVORK5CYII=
@ -130,7 +130,7 @@
<data name="pictureBoxClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAKxJREFUOE9j+P//PwM2/O3bN4Nv3759gGIDdHkYxhBA1hwzYd9/EMZnCIYAsmaG
wAAADsABataJCQAAAKxJREFUOE9j+P//PwM2/O3bN4Nv3759gGIDdHkYxhBA1hwzYd9/EMZnCIYAsmaG
4DlgjM8QgpoJGUKUZnyG4NSMj41sCE7N3759g/NBbCzyYENABky4/uj1f77YheiSKAYgWwJSC9ID0gvz
woIT15/+z551GG4yFgPALgWpAakF6UEPxAXIfkM3ADmsYJpRDIAqUEBiYxiArgbDADTDsBqAjjEEhpkB
yBhdHoYBkN/zh5bcpfIAAAAASUVORK5CYII=
@ -139,7 +139,7 @@
<data name="pictureBoxClose.InitialImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAKxJREFUOE9j+P//PwM2/O3bN4Nv3759gGIDdHkYxhBA1hwzYd9/EMZnCIYAsmaG
wAAADsABataJCQAAAKxJREFUOE9j+P//PwM2/O3bN4Nv3759gGIDdHkYxhBA1hwzYd9/EMZnCIYAsmaG
4DlgjM8QgpoJGUKUZnyG4NSMj41sCE7N3759g/NBbCzyYENABky4/uj1f77YheiSKAYgWwJSC9ID0gvz
woIT15/+z551GG4yFgPALgWpAakF6UEPxAXIfkM3ADmsYJpRDIAqUEBiYxiArgbDADTDsBqAjjEEhpkB
yBhdHoYBkN/zh5bcpfIAAAAASUVORK5CYII=

View File

@ -101,5 +101,5 @@ Build-Info:
- 🔄 Wenn Nachwäsche oder Müllwäsche alle Artikel anzeigen. [FormFehlmengeCount.cs]
- 🔄 Zuweisung zu Fahrer muss geklärt werden. [Funktionen.cs]
Installation: 01.04.2026 15:54
Installation: 02.04.2026 09:58
=====================================