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

@ -28,137 +28,138 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCInventur));
this.groupBoxInventur = new System.Windows.Forms.GroupBox();
this.labelLieferDat = new System.Windows.Forms.Label();
this.dTPLieferDat = new System.Windows.Forms.DateTimePicker();
this.labelInvDat = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.pictureBoxClose = new System.Windows.Forms.PictureBox();
this.dTPInvDatum = new System.Windows.Forms.DateTimePicker();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.dGArtikel = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonFreigeben = new System.Windows.Forms.Button();
this.panelButtons = new System.Windows.Forms.Panel();
this.buttonSpeichern = new System.Windows.Forms.Button();
this.labelInvText = new System.Windows.Forms.Label();
this.groupBoxInventur.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
this.panelButtons.SuspendLayout();
this.SuspendLayout();
//
// groupBoxInventur
//
this.groupBoxInventur.Controls.Add(this.labelLieferDat);
this.groupBoxInventur.Controls.Add(this.dTPLieferDat);
this.groupBoxInventur.Controls.Add(this.labelInvDat);
this.groupBoxInventur.Controls.Add(this.label1);
this.groupBoxInventur.Controls.Add(this.pictureBoxClose);
this.groupBoxInventur.Controls.Add(this.dTPInvDatum);
this.groupBoxInventur.Controls.Add(this.pictureBoxPlus);
this.groupBoxInventur.Controls.Add(this.dGArtikel);
this.groupBoxInventur.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBoxInventur.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBoxInventur.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxInventur.Location = new System.Drawing.Point(3, 3);
this.groupBoxInventur.Name = "groupBoxInventur";
this.groupBoxInventur.Padding = new System.Windows.Forms.Padding(5);
this.groupBoxInventur.Size = new System.Drawing.Size(983, 485);
this.groupBoxInventur.TabIndex = 0;
this.groupBoxInventur.TabStop = false;
this.groupBoxInventur.Text = "Inventur 000000 Kundename";
this.groupBoxInventur.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBoxInventur_Paint);
//
// labelLieferDat
//
this.labelLieferDat.AutoSize = true;
this.labelLieferDat.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelLieferDat.Location = new System.Drawing.Point(319, 46);
this.labelLieferDat.Name = "labelLieferDat";
this.labelLieferDat.Size = new System.Drawing.Size(115, 20);
this.labelLieferDat.TabIndex = 46;
this.labelLieferDat.Text = "Lieferdatum:";
this.labelLieferDat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// dTPLieferDat
//
this.dTPLieferDat.CalendarForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dTPLieferDat.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dTPLieferDat.Location = new System.Drawing.Point(440, 37);
this.dTPLieferDat.Name = "dTPLieferDat";
this.dTPLieferDat.Size = new System.Drawing.Size(161, 30);
this.dTPLieferDat.TabIndex = 45;
//
// labelInvDat
//
this.labelInvDat.AutoSize = true;
this.labelInvDat.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvDat.Location = new System.Drawing.Point(3, 46);
this.labelInvDat.Name = "labelInvDat";
this.labelInvDat.Size = new System.Drawing.Size(133, 20);
this.labelInvDat.TabIndex = 44;
this.labelInvDat.Text = "Inventurdatum:";
this.labelInvDat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(697, 46);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(245, 20);
this.label1.TabIndex = 43;
this.label1.Text = "Lager/Lieferung hinzufügen:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pictureBoxClose
//
this.pictureBoxClose.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.ErrorImage")));
this.pictureBoxClose.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.Image")));
this.pictureBoxClose.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.InitialImage")));
this.pictureBoxClose.Location = new System.Drawing.Point(948, 7);
this.pictureBoxClose.Name = "pictureBoxClose";
this.pictureBoxClose.Size = new System.Drawing.Size(25, 25);
this.pictureBoxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxClose.TabIndex = 42;
this.pictureBoxClose.TabStop = false;
this.pictureBoxClose.Click += new System.EventHandler(this.pictureBoxClose_Click);
//
// dTPInvDatum
//
this.dTPInvDatum.CalendarForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dTPInvDatum.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dTPInvDatum.Location = new System.Drawing.Point(142, 37);
this.dTPInvDatum.Name = "dTPInvDatum";
this.dTPInvDatum.Size = new System.Drawing.Size(161, 30);
this.dTPInvDatum.TabIndex = 41;
//
// pictureBoxPlus
//
this.pictureBoxPlus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxPlus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlus.Image")));
this.pictureBoxPlus.Location = new System.Drawing.Point(948, 37);
this.pictureBoxPlus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBoxPlus.Name = "pictureBoxPlus";
this.pictureBoxPlus.Size = new System.Drawing.Size(30, 30);
this.pictureBoxPlus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxPlus.TabIndex = 40;
this.pictureBoxPlus.TabStop = false;
this.pictureBoxPlus.Click += new System.EventHandler(this.pictureBoxPlus_Click);
//
// dGArtikel
//
this.dGArtikel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dGArtikel.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCInventur));
this.groupBoxInventur = new System.Windows.Forms.GroupBox();
this.labelLieferDat = new System.Windows.Forms.Label();
this.dTPLieferDat = new System.Windows.Forms.DateTimePicker();
this.labelInvDat = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.pictureBoxClose = new System.Windows.Forms.PictureBox();
this.dTPInvDatum = new System.Windows.Forms.DateTimePicker();
this.pictureBoxPlus = new System.Windows.Forms.PictureBox();
this.dGArtikel = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonFreigeben = new System.Windows.Forms.Button();
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();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).BeginInit();
this.panelButtons.SuspendLayout();
this.SuspendLayout();
//
// groupBoxInventur
//
this.groupBoxInventur.Controls.Add(this.labelLieferDat);
this.groupBoxInventur.Controls.Add(this.dTPLieferDat);
this.groupBoxInventur.Controls.Add(this.labelInvDat);
this.groupBoxInventur.Controls.Add(this.label1);
this.groupBoxInventur.Controls.Add(this.pictureBoxClose);
this.groupBoxInventur.Controls.Add(this.dTPInvDatum);
this.groupBoxInventur.Controls.Add(this.pictureBoxPlus);
this.groupBoxInventur.Controls.Add(this.dGArtikel);
this.groupBoxInventur.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBoxInventur.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBoxInventur.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.groupBoxInventur.Location = new System.Drawing.Point(3, 3);
this.groupBoxInventur.Name = "groupBoxInventur";
this.groupBoxInventur.Padding = new System.Windows.Forms.Padding(5);
this.groupBoxInventur.Size = new System.Drawing.Size(983, 485);
this.groupBoxInventur.TabIndex = 0;
this.groupBoxInventur.TabStop = false;
this.groupBoxInventur.Text = "Inventur 000000 Kundename";
this.groupBoxInventur.Paint += new System.Windows.Forms.PaintEventHandler(this.groupBoxInventur_Paint);
//
// labelLieferDat
//
this.labelLieferDat.AutoSize = true;
this.labelLieferDat.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelLieferDat.Location = new System.Drawing.Point(319, 46);
this.labelLieferDat.Name = "labelLieferDat";
this.labelLieferDat.Size = new System.Drawing.Size(115, 20);
this.labelLieferDat.TabIndex = 46;
this.labelLieferDat.Text = "Lieferdatum:";
this.labelLieferDat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// dTPLieferDat
//
this.dTPLieferDat.CalendarForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dTPLieferDat.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dTPLieferDat.Location = new System.Drawing.Point(440, 37);
this.dTPLieferDat.Name = "dTPLieferDat";
this.dTPLieferDat.Size = new System.Drawing.Size(161, 30);
this.dTPLieferDat.TabIndex = 45;
//
// labelInvDat
//
this.labelInvDat.AutoSize = true;
this.labelInvDat.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvDat.Location = new System.Drawing.Point(3, 46);
this.labelInvDat.Name = "labelInvDat";
this.labelInvDat.Size = new System.Drawing.Size(133, 20);
this.labelInvDat.TabIndex = 44;
this.labelInvDat.Text = "Inventurdatum:";
this.labelInvDat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(697, 46);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(245, 20);
this.label1.TabIndex = 43;
this.label1.Text = "Lager/Lieferung hinzufügen:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pictureBoxClose
//
this.pictureBoxClose.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.ErrorImage")));
this.pictureBoxClose.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.Image")));
this.pictureBoxClose.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxClose.InitialImage")));
this.pictureBoxClose.Location = new System.Drawing.Point(948, 7);
this.pictureBoxClose.Name = "pictureBoxClose";
this.pictureBoxClose.Size = new System.Drawing.Size(25, 25);
this.pictureBoxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxClose.TabIndex = 42;
this.pictureBoxClose.TabStop = false;
this.pictureBoxClose.Click += new System.EventHandler(this.pictureBoxClose_Click);
//
// dTPInvDatum
//
this.dTPInvDatum.CalendarForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dTPInvDatum.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dTPInvDatum.Location = new System.Drawing.Point(142, 37);
this.dTPInvDatum.Name = "dTPInvDatum";
this.dTPInvDatum.Size = new System.Drawing.Size(161, 30);
this.dTPInvDatum.TabIndex = 41;
//
// pictureBoxPlus
//
this.pictureBoxPlus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.pictureBoxPlus.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlus.Image")));
this.pictureBoxPlus.Location = new System.Drawing.Point(948, 37);
this.pictureBoxPlus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBoxPlus.Name = "pictureBoxPlus";
this.pictureBoxPlus.Size = new System.Drawing.Size(30, 30);
this.pictureBoxPlus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxPlus.TabIndex = 40;
this.pictureBoxPlus.TabStop = false;
this.pictureBoxPlus.Click += new System.EventHandler(this.pictureBoxPlus_Click);
//
// dGArtikel
//
this.dGArtikel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dGArtikel.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2,
this.Column3,
@ -166,174 +167,192 @@
this.Column5,
this.Column6,
this.Column7});
this.dGArtikel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dGArtikel.Location = new System.Drawing.Point(5, 96);
this.dGArtikel.Margin = new System.Windows.Forms.Padding(4);
this.dGArtikel.MinimumSize = new System.Drawing.Size(0, 350);
this.dGArtikel.Name = "dGArtikel";
this.dGArtikel.RowHeadersVisible = false;
this.dGArtikel.RowHeadersWidth = 51;
this.dGArtikel.Size = new System.Drawing.Size(973, 384);
this.dGArtikel.TabIndex = 34;
this.dGArtikel.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellEndEdit);
this.dGArtikel.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellLeave);
this.dGArtikel.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dGArtikel_CellMouseDoubleClick);
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellValueChanged);
this.dGArtikel.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dGArtikel_DataBindingComplete);
this.dGArtikel.Leave += new System.EventHandler(this.dGArtikel_Leave);
//
// Column1
//
this.Column1.DataPropertyName = "ArtikelNR";
this.Column1.HeaderText = "Art.Nr.";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 103;
//
// Column2
//
this.Column2.DataPropertyName = "ArtikelName";
this.Column2.HeaderText = "Art.Name";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 131;
//
// Column3
//
this.Column3.DataPropertyName = "Stand";
this.Column3.HeaderText = "Ist-Stand";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 129;
//
// Column4
//
this.Column4.DataPropertyName = "Reklamation";
this.Column4.HeaderText = "Rekl.";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 89;
//
// Column5
//
this.Column5.DataPropertyName = "Fehlmenge";
this.Column5.HeaderText = "NW";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 77;
//
// Column6
//
this.Column6.HeaderText = "Schwund";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 130;
//
// Column7
//
this.Column7.DataPropertyName = "Korrektur";
this.Column7.HeaderText = "Inv.Ausgleich";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.Width = 125;
//
// buttonFreigeben
//
this.buttonFreigeben.AutoSize = true;
this.buttonFreigeben.BackColor = System.Drawing.Color.Gray;
this.buttonFreigeben.CausesValidation = false;
this.buttonFreigeben.Dock = System.Windows.Forms.DockStyle.Right;
this.buttonFreigeben.Enabled = false;
this.buttonFreigeben.FlatAppearance.BorderSize = 0;
this.buttonFreigeben.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFreigeben.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFreigeben.ForeColor = System.Drawing.Color.Black;
this.buttonFreigeben.Location = new System.Drawing.Point(776, 0);
this.buttonFreigeben.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonFreigeben.Name = "buttonFreigeben";
this.buttonFreigeben.Size = new System.Drawing.Size(200, 48);
this.buttonFreigeben.TabIndex = 38;
this.buttonFreigeben.Text = "Inventur freigeben";
this.buttonFreigeben.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonFreigeben.UseVisualStyleBackColor = false;
this.buttonFreigeben.Click += new System.EventHandler(this.buttonFreigeben_Click);
//
// panelButtons
//
this.panelButtons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelButtons.Controls.Add(this.buttonSpeichern);
this.panelButtons.Controls.Add(this.labelInvText);
this.panelButtons.Controls.Add(this.buttonFreigeben);
this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtons.Location = new System.Drawing.Point(3, 488);
this.panelButtons.Name = "panelButtons";
this.panelButtons.Padding = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.panelButtons.Size = new System.Drawing.Size(983, 50);
this.panelButtons.TabIndex = 43;
//
// buttonSpeichern
//
this.buttonSpeichern.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.buttonSpeichern.BackColor = System.Drawing.Color.Gray;
this.buttonSpeichern.CausesValidation = false;
this.buttonSpeichern.Enabled = false;
this.buttonSpeichern.FlatAppearance.BorderSize = 0;
this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSpeichern.ForeColor = System.Drawing.Color.Black;
this.buttonSpeichern.Location = new System.Drawing.Point(569, 0);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(5, 2, 5, 2);
this.buttonSpeichern.MinimumSize = new System.Drawing.Size(150, 50);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(200, 50);
this.buttonSpeichern.TabIndex = 40;
this.buttonSpeichern.Text = "Speichern";
this.buttonSpeichern.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonSpeichern.UseVisualStyleBackColor = false;
this.buttonSpeichern.Click += new System.EventHandler(this.buttonSpeichern_Click);
//
// labelInvText
//
this.labelInvText.AutoSize = true;
this.labelInvText.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.labelInvText.Location = new System.Drawing.Point(8, 12);
this.labelInvText.Name = "labelInvText";
this.labelInvText.Size = new System.Drawing.Size(70, 25);
this.labelInvText.TabIndex = 39;
this.labelInvText.Text = "label1";
this.labelInvText.Visible = false;
this.labelInvText.Click += new System.EventHandler(this.labelInvText_Click);
//
// UCInventur
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.panelButtons);
this.Controls.Add(this.groupBoxInventur);
this.Margin = new System.Windows.Forms.Padding(5);
this.Name = "UCInventur";
this.Padding = new System.Windows.Forms.Padding(3);
this.Size = new System.Drawing.Size(989, 541);
this.Load += new System.EventHandler(this.UCInventur_Load);
this.SizeChanged += new System.EventHandler(this.UCInventur_SizeChanged);
this.groupBoxInventur.ResumeLayout(false);
this.groupBoxInventur.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
this.panelButtons.ResumeLayout(false);
this.panelButtons.PerformLayout();
this.ResumeLayout(false);
this.dGArtikel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dGArtikel.Location = new System.Drawing.Point(5, 96);
this.dGArtikel.Margin = new System.Windows.Forms.Padding(4);
this.dGArtikel.MinimumSize = new System.Drawing.Size(0, 350);
this.dGArtikel.Name = "dGArtikel";
this.dGArtikel.RowHeadersVisible = false;
this.dGArtikel.RowHeadersWidth = 51;
this.dGArtikel.Size = new System.Drawing.Size(973, 384);
this.dGArtikel.TabIndex = 34;
this.dGArtikel.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellEndEdit);
this.dGArtikel.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellLeave);
this.dGArtikel.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dGArtikel_CellMouseDoubleClick);
this.dGArtikel.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGArtikel_CellValueChanged);
this.dGArtikel.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dGArtikel_DataBindingComplete);
this.dGArtikel.Leave += new System.EventHandler(this.dGArtikel_Leave);
//
// Column1
//
this.Column1.DataPropertyName = "ArtikelNR";
this.Column1.HeaderText = "Art.Nr.";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 103;
//
// Column2
//
this.Column2.DataPropertyName = "ArtikelName";
this.Column2.HeaderText = "Art.Name";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 131;
//
// Column3
//
this.Column3.DataPropertyName = "Stand";
this.Column3.HeaderText = "Ist-Stand";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 129;
//
// Column4
//
this.Column4.DataPropertyName = "Reklamation";
this.Column4.HeaderText = "Rekl.";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 89;
//
// Column5
//
this.Column5.DataPropertyName = "Fehlmenge";
this.Column5.HeaderText = "NW";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 77;
//
// Column6
//
this.Column6.HeaderText = "Schwund";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 130;
//
// Column7
//
this.Column7.DataPropertyName = "Korrektur";
this.Column7.HeaderText = "Inv.Ausgleich";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.Width = 125;
//
// buttonFreigeben
//
this.buttonFreigeben.AutoSize = true;
this.buttonFreigeben.BackColor = System.Drawing.Color.Gray;
this.buttonFreigeben.CausesValidation = false;
this.buttonFreigeben.Dock = System.Windows.Forms.DockStyle.Right;
this.buttonFreigeben.Enabled = false;
this.buttonFreigeben.FlatAppearance.BorderSize = 0;
this.buttonFreigeben.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFreigeben.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFreigeben.ForeColor = System.Drawing.Color.Black;
this.buttonFreigeben.Location = new System.Drawing.Point(776, 0);
this.buttonFreigeben.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonFreigeben.Name = "buttonFreigeben";
this.buttonFreigeben.Size = new System.Drawing.Size(200, 48);
this.buttonFreigeben.TabIndex = 38;
this.buttonFreigeben.Text = "Inventur freigeben";
this.buttonFreigeben.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonFreigeben.UseVisualStyleBackColor = false;
this.buttonFreigeben.Click += new System.EventHandler(this.buttonFreigeben_Click);
//
// 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);
this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelButtons.Location = new System.Drawing.Point(3, 488);
this.panelButtons.Name = "panelButtons";
this.panelButtons.Padding = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.panelButtons.Size = new System.Drawing.Size(983, 50);
this.panelButtons.TabIndex = 43;
//
// buttonSpeichern
//
this.buttonSpeichern.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.buttonSpeichern.BackColor = System.Drawing.Color.Gray;
this.buttonSpeichern.CausesValidation = false;
this.buttonSpeichern.Enabled = false;
this.buttonSpeichern.FlatAppearance.BorderSize = 0;
this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonSpeichern.ForeColor = System.Drawing.Color.Black;
this.buttonSpeichern.Location = new System.Drawing.Point(569, 0);
this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(5, 2, 5, 2);
this.buttonSpeichern.MinimumSize = new System.Drawing.Size(150, 50);
this.buttonSpeichern.Name = "buttonSpeichern";
this.buttonSpeichern.Size = new System.Drawing.Size(200, 50);
this.buttonSpeichern.TabIndex = 40;
this.buttonSpeichern.Text = "Speichern";
this.buttonSpeichern.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.buttonSpeichern.UseVisualStyleBackColor = false;
this.buttonSpeichern.Click += new System.EventHandler(this.buttonSpeichern_Click);
//
// labelInvText
//
this.labelInvText.AutoSize = true;
this.labelInvText.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelInvText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.labelInvText.Location = new System.Drawing.Point(8, 12);
this.labelInvText.Name = "labelInvText";
this.labelInvText.Size = new System.Drawing.Size(70, 25);
this.labelInvText.TabIndex = 39;
this.labelInvText.Text = "label1";
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);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.panelButtons);
this.Controls.Add(this.groupBoxInventur);
this.Margin = new System.Windows.Forms.Padding(5);
this.Name = "UCInventur";
this.Padding = new System.Windows.Forms.Padding(3);
this.Size = new System.Drawing.Size(989, 541);
this.Load += new System.EventHandler(this.UCInventur_Load);
this.SizeChanged += new System.EventHandler(this.UCInventur_SizeChanged);
this.groupBoxInventur.ResumeLayout(false);
this.groupBoxInventur.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxClose)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dGArtikel)).EndInit();
this.panelButtons.ResumeLayout(false);
this.panelButtons.PerformLayout();
this.ResumeLayout(false);
}
@ -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}";
@ -208,7 +212,7 @@ namespace Deckungsbeitrag.UserControls
{
// KundeArtikel updaten. Neuen Stand eintragen, Reklamation & Fehlmenge auf Null setzten und Korrektur als InventruAusgleich speichern.
KundeArtikel art = (KundeArtikel)artikelListe[row.Index];
art.Reklamation = 0;
art.Fehlmenge = 0;
art.StandBearbeitet = this.user.BenutzerName + " am " + DateTime.Now;
@ -262,7 +266,7 @@ namespace Deckungsbeitrag.UserControls
if (File.Exists(delPath)) File.Delete(delPath);
}
string artikel = string.Empty;
string cols = string.Empty;
@ -272,17 +276,17 @@ namespace Deckungsbeitrag.UserControls
// Prüfen ob Header schon existiert
bool headerExists = File.Exists(csvPath);
// Artikelbezeichnungen in string convertieren
foreach (KundeArtikel art in _artikelliste) artikel += art.ArtikelName + ";";
foreach (var col in dGArtikel.Columns.Cast<DataGridViewColumn>().Where(c => c.Visible).OrderBy(c => c.DisplayIndex))
{
if (col.Visible) cols += col.HeaderText + ";";
}
// Prüfen ob Inventur neu ist
if (headerExists) neueinventur = NeueInventur(csvPath, cols);
// Nur Header bei NEUER Datei
var csv = new StringBuilder();
if (!headerExists || !neueinventur)
@ -371,7 +375,7 @@ namespace Deckungsbeitrag.UserControls
this.ClientSize = new Size(this.groupBoxInventur.ClientSize.Width + 10, this.groupBoxInventur.Height + panelButtons.Height + 10);
}
/// <summary>
/// Größe des UserControls wird verringert.
/// </summary>
@ -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;
@ -419,7 +424,7 @@ namespace Deckungsbeitrag.UserControls
return result;
}
/// <summary>
/// Location der Controls im UserControl wird berechnet.
/// </summary>
@ -533,7 +538,7 @@ namespace Deckungsbeitrag.UserControls
private void dGArtikel_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
DataGridView dgv = (DataGridView)sender;
if (e.ColumnIndex == 2)
{
if (MessageBox.Show("Möchtest du den Stand wirklich verändern?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
@ -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
=====================================