diff --git a/AA-Forms/FormAuftragDetail.cs b/AA-Forms/FormAuftragDetail.cs index e325f2a..d64e175 100644 --- a/AA-Forms/FormAuftragDetail.cs +++ b/AA-Forms/FormAuftragDetail.cs @@ -81,7 +81,7 @@ namespace Deckungsbeitrag //this.textBoxZusatz.Text = auftrag.ZusatzInfo; //WENN STATUS 3(HERRICHTEN) oder HÖHER(FERTIG, AUSGELIEFERT) DANN KEINE VORHER NACHHER LISTEN - if (auftrag.Status <= AuftragStatus.Finisching) + if (auftrag.Status <= AuftragStatus.Gewaschen) { List davor = Auftrag.GetAuftragList("davor", auftrag); List danach = Auftrag.GetAuftragList("danach", auftrag); diff --git a/AA-Forms/FormExpedit.Designer.cs b/AA-Forms/FormExpedit.Designer.cs index 0c48649..14919f2 100644 --- a/AA-Forms/FormExpedit.Designer.cs +++ b/AA-Forms/FormExpedit.Designer.cs @@ -29,8 +29,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormExpedit)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.label10 = new System.Windows.Forms.Label(); this.buttonDrucken = new System.Windows.Forms.Button(); this.groupBoxEtikett = new System.Windows.Forms.GroupBox(); @@ -48,7 +48,6 @@ this.pictureBoxPlus = new System.Windows.Forms.PictureBox(); this.pictureBoxEntwurf = new System.Windows.Forms.PictureBox(); this.buttonKundeNr = new System.Windows.Forms.Button(); - this.buttonSWS_Drucken = new System.Windows.Forms.Button(); this.buttonNeuerAuftrag = new System.Windows.Forms.Button(); this.dGArtikel = new System.Windows.Forms.DataGridView(); this.KundeArtikelID = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -66,8 +65,8 @@ this.tabPageAll = new System.Windows.Forms.TabPage(); this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView(); this.tabControlAuftragList = new System.Windows.Forms.TabControl(); - this.buttonStats = new System.Windows.Forms.Button(); - this.buttonEinstellung = new System.Windows.Forms.Button(); + this.tabPageGeschaeft = new System.Windows.Forms.TabPage(); + this.objectListViewGeschaeft = new BrightIdeasSoftware.ObjectListView(); this.groupBoxStatistik = new System.Windows.Forms.GroupBox(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.tableLayoutPanelStatistik = new System.Windows.Forms.TableLayoutPanel(); @@ -83,6 +82,11 @@ this.labelStatistik2 = new System.Windows.Forms.Label(); this.labelZahl1 = new System.Windows.Forms.Label(); this.labelStatistik1 = new System.Windows.Forms.Label(); + this.buttonStats = new System.Windows.Forms.Button(); + this.buttonEinstellung = new System.Windows.Forms.Button(); + this.buttonSWS_Drucken = new System.Windows.Forms.Button(); + this.buttonSuchen = new System.Windows.Forms.Button(); + this.buttonNW = new System.Windows.Forms.Button(); this.groupBoxEtikett.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxMinus)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlus)).BeginInit(); @@ -93,6 +97,8 @@ this.tabPageAll.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.objectListViewAuftrag)).BeginInit(); this.tabControlAuftragList.SuspendLayout(); + this.tabPageGeschaeft.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.objectListViewGeschaeft)).BeginInit(); this.groupBoxStatistik.SuspendLayout(); this.tableLayoutPanelStatistik.SuspendLayout(); this.SuspendLayout(); @@ -388,22 +394,6 @@ this.buttonKundeNr.Text = "Auftrag in der Liste wählen"; this.buttonKundeNr.UseVisualStyleBackColor = false; // - // buttonSWS_Drucken - // - this.buttonSWS_Drucken.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSWS_Drucken.BackColor = System.Drawing.Color.Yellow; - this.buttonSWS_Drucken.FlatAppearance.BorderSize = 0; - this.buttonSWS_Drucken.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonSWS_Drucken.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonSWS_Drucken.Location = new System.Drawing.Point(916, 650); - this.buttonSWS_Drucken.Margin = new System.Windows.Forms.Padding(2); - this.buttonSWS_Drucken.Name = "buttonSWS_Drucken"; - this.buttonSWS_Drucken.Size = new System.Drawing.Size(200, 41); - this.buttonSWS_Drucken.TabIndex = 35; - this.buttonSWS_Drucken.Text = "SWS-Drucken"; - this.buttonSWS_Drucken.UseVisualStyleBackColor = false; - this.buttonSWS_Drucken.Click += new System.EventHandler(this.buttonSWS_Drucken_Click); - // // buttonNeuerAuftrag // this.buttonNeuerAuftrag.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -425,14 +415,14 @@ // dGArtikel // this.dGArtikel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dGArtikel.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dGArtikel.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dGArtikel.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dGArtikel.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.KundeArtikelID, @@ -445,14 +435,14 @@ this.StandBearbeitet, this.FehlmengeBearbeitet, this.KorrekturBearbeitet}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dGArtikel.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dGArtikel.DefaultCellStyle = dataGridViewCellStyle4; this.dGArtikel.Location = new System.Drawing.Point(576, 42); this.dGArtikel.Name = "dGArtikel"; this.dGArtikel.RowHeadersWidth = 62; @@ -462,6 +452,7 @@ 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); + this.dGArtikel.VisibleChanged += new System.EventHandler(this.dGArtikel_VisibleChanged); // // KundeArtikelID // @@ -507,14 +498,14 @@ // // Fehlmenge // - this.Fehlmenge.HeaderText = "Fehlmenge"; + this.Fehlmenge.HeaderText = "NW"; this.Fehlmenge.MinimumWidth = 8; this.Fehlmenge.Name = "Fehlmenge"; this.Fehlmenge.Width = 150; // // Korrektur // - this.Korrektur.HeaderText = "Korrektur"; + this.Korrektur.HeaderText = "Korr"; this.Korrektur.MinimumWidth = 8; this.Korrektur.Name = "Korrektur"; this.Korrektur.Width = 150; @@ -546,7 +537,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(890, 587); + this.tabPageSonder.Size = new System.Drawing.Size(1205, 587); this.tabPageSonder.TabIndex = 1; this.tabPageSonder.Text = "Sonderaufträge"; this.tabPageSonder.UseVisualStyleBackColor = true; @@ -561,7 +552,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(884, 581); + this.objectListViewSonder.Size = new System.Drawing.Size(1199, 581); this.objectListViewSonder.TabIndex = 2; this.objectListViewSonder.UseCompatibleStateImageBehavior = false; this.objectListViewSonder.UseHotControls = false; @@ -575,14 +566,16 @@ 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(890, 587); + this.tabPageAll.Size = new System.Drawing.Size(1205, 587); this.tabPageAll.TabIndex = 0; this.tabPageAll.Text = "Aufträge heute"; this.tabPageAll.UseVisualStyleBackColor = true; // // objectListViewAuftrag // + this.objectListViewAuftrag.AllowColumnReorder = true; this.objectListViewAuftrag.AlternateRowBackColor = System.Drawing.Color.LightBlue; + this.objectListViewAuftrag.CellEditActivation = BrightIdeasSoftware.ObjectListView.CellEditActivateMode.DoubleClick; this.objectListViewAuftrag.CellEditUseWholeCell = false; this.objectListViewAuftrag.Cursor = System.Windows.Forms.Cursors.Default; this.objectListViewAuftrag.Dock = System.Windows.Forms.DockStyle.Fill; @@ -591,14 +584,23 @@ this.objectListViewAuftrag.HideSelection = false; this.objectListViewAuftrag.Location = new System.Drawing.Point(3, 3); this.objectListViewAuftrag.Name = "objectListViewAuftrag"; - this.objectListViewAuftrag.Size = new System.Drawing.Size(884, 581); + this.objectListViewAuftrag.SelectColumnsOnRightClickBehaviour = BrightIdeasSoftware.ObjectListView.ColumnSelectBehaviour.Submenu; + this.objectListViewAuftrag.Size = new System.Drawing.Size(1199, 581); + this.objectListViewAuftrag.Sorting = System.Windows.Forms.SortOrder.Ascending; this.objectListViewAuftrag.TabIndex = 1; + this.objectListViewAuftrag.TintSortColumn = true; + this.objectListViewAuftrag.UnfocusedSelectedBackColor = System.Drawing.SystemColors.Highlight; + this.objectListViewAuftrag.UnfocusedSelectedForeColor = System.Drawing.SystemColors.HighlightText; this.objectListViewAuftrag.UseAlternatingBackColors = true; this.objectListViewAuftrag.UseCellFormatEvents = true; this.objectListViewAuftrag.UseCompatibleStateImageBehavior = false; + this.objectListViewAuftrag.UseFiltering = true; this.objectListViewAuftrag.UseHotControls = false; + this.objectListViewAuftrag.UseHyperlinks = true; this.objectListViewAuftrag.View = System.Windows.Forms.View.Details; this.objectListViewAuftrag.ButtonClick += new System.EventHandler(this.objectListViewAuftrag_ButtonClick); + this.objectListViewAuftrag.CellEditFinished += new BrightIdeasSoftware.CellEditEventHandler(this.objectListViewAuftrag_CellEditFinished); + this.objectListViewAuftrag.CellEditStarting += new BrightIdeasSoftware.CellEditEventHandler(this.objectListViewAuftrag_CellEditStarting); this.objectListViewAuftrag.CellClick += new System.EventHandler(this.objectListViewAuftrag_CellClick); this.objectListViewAuftrag.CellRightClick += new System.EventHandler(this.objectListViewAuftrag_CellRightClick); this.objectListViewAuftrag.FormatCell += new System.EventHandler(this.objectListViewAuftrag_FormatCell); @@ -610,43 +612,61 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tabControlAuftragList.Controls.Add(this.tabPageAll); this.tabControlAuftragList.Controls.Add(this.tabPageSonder); + this.tabControlAuftragList.Controls.Add(this.tabPageGeschaeft); this.tabControlAuftragList.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabControlAuftragList.Location = new System.Drawing.Point(4, 9); this.tabControlAuftragList.Name = "tabControlAuftragList"; this.tabControlAuftragList.SelectedIndex = 0; - this.tabControlAuftragList.Size = new System.Drawing.Size(898, 625); + this.tabControlAuftragList.Size = new System.Drawing.Size(1213, 625); this.tabControlAuftragList.TabIndex = 0; this.tabControlAuftragList.Visible = false; this.tabControlAuftragList.SelectedIndexChanged += new System.EventHandler(this.tabControlAuftragList_SelectedIndexChanged); this.tabControlAuftragList.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabControlAuftragList_Selected); // - // buttonStats + // tabPageGeschaeft // - this.buttonStats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStats.FlatAppearance.BorderColor = System.Drawing.Color.White; - this.buttonStats.FlatAppearance.BorderSize = 3; - this.buttonStats.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonStats.Image = global::Deckungsbeitrag.Properties.Resources.StatisticsWarning_16x; - this.buttonStats.Location = new System.Drawing.Point(1121, 650); - this.buttonStats.Name = "buttonStats"; - this.buttonStats.Size = new System.Drawing.Size(41, 41); - this.buttonStats.TabIndex = 46; - this.buttonStats.UseVisualStyleBackColor = true; - this.buttonStats.Click += new System.EventHandler(this.buttonStats_Click); + this.tabPageGeschaeft.Controls.Add(this.objectListViewGeschaeft); + this.tabPageGeschaeft.Location = new System.Drawing.Point(4, 34); + this.tabPageGeschaeft.Name = "tabPageGeschaeft"; + this.tabPageGeschaeft.Padding = new System.Windows.Forms.Padding(3); + this.tabPageGeschaeft.Size = new System.Drawing.Size(1205, 587); + this.tabPageGeschaeft.TabIndex = 2; + this.tabPageGeschaeft.Text = "Geschäft"; + this.tabPageGeschaeft.UseVisualStyleBackColor = true; // - // buttonEinstellung + // objectListViewGeschaeft // - this.buttonEinstellung.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEinstellung.FlatAppearance.BorderColor = System.Drawing.Color.White; - this.buttonEinstellung.FlatAppearance.BorderSize = 3; - this.buttonEinstellung.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonEinstellung.Image = global::Deckungsbeitrag.Properties.Resources.Monaco_Settings_16x; - this.buttonEinstellung.Location = new System.Drawing.Point(1168, 650); - this.buttonEinstellung.Name = "buttonEinstellung"; - this.buttonEinstellung.Size = new System.Drawing.Size(41, 41); - this.buttonEinstellung.TabIndex = 45; - this.buttonEinstellung.UseVisualStyleBackColor = true; - this.buttonEinstellung.Click += new System.EventHandler(this.buttonEinstellung_Click); + this.objectListViewGeschaeft.AllowColumnReorder = true; + this.objectListViewGeschaeft.AlternateRowBackColor = System.Drawing.Color.LightBlue; + this.objectListViewGeschaeft.CellEditActivation = BrightIdeasSoftware.ObjectListView.CellEditActivateMode.DoubleClick; + this.objectListViewGeschaeft.CellEditUseWholeCell = false; + this.objectListViewGeschaeft.Cursor = System.Windows.Forms.Cursors.Default; + this.objectListViewGeschaeft.Dock = System.Windows.Forms.DockStyle.Fill; + this.objectListViewGeschaeft.FullRowSelect = true; + this.objectListViewGeschaeft.GridLines = true; + this.objectListViewGeschaeft.HideSelection = false; + this.objectListViewGeschaeft.Location = new System.Drawing.Point(3, 3); + this.objectListViewGeschaeft.Name = "objectListViewGeschaeft"; + this.objectListViewGeschaeft.SelectColumnsOnRightClickBehaviour = BrightIdeasSoftware.ObjectListView.ColumnSelectBehaviour.Submenu; + this.objectListViewGeschaeft.Size = new System.Drawing.Size(1199, 581); + this.objectListViewGeschaeft.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.objectListViewGeschaeft.TabIndex = 2; + this.objectListViewGeschaeft.TintSortColumn = true; + this.objectListViewGeschaeft.UnfocusedSelectedBackColor = System.Drawing.SystemColors.Highlight; + this.objectListViewGeschaeft.UnfocusedSelectedForeColor = System.Drawing.SystemColors.HighlightText; + this.objectListViewGeschaeft.UseAlternatingBackColors = true; + this.objectListViewGeschaeft.UseCellFormatEvents = true; + this.objectListViewGeschaeft.UseCompatibleStateImageBehavior = false; + this.objectListViewGeschaeft.UseFiltering = true; + this.objectListViewGeschaeft.UseHotControls = false; + this.objectListViewGeschaeft.UseHyperlinks = true; + this.objectListViewGeschaeft.View = System.Windows.Forms.View.Details; + this.objectListViewGeschaeft.ButtonClick += new System.EventHandler(this.objectListViewAuftrag_ButtonClick); + this.objectListViewGeschaeft.CellEditFinished += new BrightIdeasSoftware.CellEditEventHandler(this.objectListViewAuftrag_CellEditFinished); + this.objectListViewGeschaeft.CellEditStarting += new BrightIdeasSoftware.CellEditEventHandler(this.objectListViewAuftrag_CellEditStarting); + this.objectListViewGeschaeft.CellClick += new System.EventHandler(this.objectListViewAuftrag_CellClick); + this.objectListViewGeschaeft.CellRightClick += new System.EventHandler(this.objectListViewAuftrag_CellRightClick); + this.objectListViewGeschaeft.FormatCell += new System.EventHandler(this.objectListViewAuftrag_FormatCell); // // groupBoxStatistik // @@ -859,11 +879,92 @@ this.labelStatistik1.Text = "Statistik 1"; this.labelStatistik1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // buttonStats + // + this.buttonStats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonStats.FlatAppearance.BorderColor = System.Drawing.Color.White; + this.buttonStats.FlatAppearance.BorderSize = 3; + this.buttonStats.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonStats.Image = global::Deckungsbeitrag.Properties.Resources.StatisticsWarning_16x; + this.buttonStats.Location = new System.Drawing.Point(1121, 650); + this.buttonStats.Name = "buttonStats"; + this.buttonStats.Size = new System.Drawing.Size(41, 41); + this.buttonStats.TabIndex = 46; + this.buttonStats.UseVisualStyleBackColor = true; + this.buttonStats.Click += new System.EventHandler(this.buttonStats_Click); + // + // buttonEinstellung + // + this.buttonEinstellung.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonEinstellung.FlatAppearance.BorderColor = System.Drawing.Color.White; + this.buttonEinstellung.FlatAppearance.BorderSize = 3; + this.buttonEinstellung.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonEinstellung.Image = global::Deckungsbeitrag.Properties.Resources.Monaco_Settings_16x; + this.buttonEinstellung.Location = new System.Drawing.Point(1168, 650); + this.buttonEinstellung.Name = "buttonEinstellung"; + this.buttonEinstellung.Size = new System.Drawing.Size(41, 41); + this.buttonEinstellung.TabIndex = 45; + this.buttonEinstellung.UseVisualStyleBackColor = true; + this.buttonEinstellung.Click += new System.EventHandler(this.buttonEinstellung_Click); + // + // buttonSWS_Drucken + // + this.buttonSWS_Drucken.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSWS_Drucken.BackColor = System.Drawing.Color.Yellow; + this.buttonSWS_Drucken.FlatAppearance.BorderSize = 0; + this.buttonSWS_Drucken.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonSWS_Drucken.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonSWS_Drucken.Location = new System.Drawing.Point(916, 650); + this.buttonSWS_Drucken.Margin = new System.Windows.Forms.Padding(2); + this.buttonSWS_Drucken.Name = "buttonSWS_Drucken"; + this.buttonSWS_Drucken.Size = new System.Drawing.Size(200, 41); + this.buttonSWS_Drucken.TabIndex = 35; + this.buttonSWS_Drucken.Text = "SWS-Drucken"; + this.buttonSWS_Drucken.UseVisualStyleBackColor = false; + this.buttonSWS_Drucken.Click += new System.EventHandler(this.buttonSWS_Drucken_Click); + // + // buttonSuchen + // + this.buttonSuchen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonSuchen.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.buttonSuchen.BackColor = System.Drawing.Color.DarkOrange; + this.buttonSuchen.FlatAppearance.BorderSize = 0; + this.buttonSuchen.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonSuchen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonSuchen.ForeColor = System.Drawing.Color.Black; + this.buttonSuchen.Location = new System.Drawing.Point(67, 649); + this.buttonSuchen.Margin = new System.Windows.Forms.Padding(2); + this.buttonSuchen.Name = "buttonSuchen"; + this.buttonSuchen.Size = new System.Drawing.Size(200, 41); + this.buttonSuchen.TabIndex = 63; + this.buttonSuchen.Text = "Suchen"; + this.buttonSuchen.UseVisualStyleBackColor = false; + this.buttonSuchen.Click += new System.EventHandler(this.buttonSuchen_Click); + // + // buttonNW + // + this.buttonNW.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonNW.FlatAppearance.BorderColor = System.Drawing.Color.White; + this.buttonNW.FlatAppearance.BorderSize = 3; + this.buttonNW.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonNW.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonNW.ForeColor = System.Drawing.Color.White; + this.buttonNW.Location = new System.Drawing.Point(4, 649); + this.buttonNW.Name = "buttonNW"; + this.buttonNW.Size = new System.Drawing.Size(58, 41); + this.buttonNW.TabIndex = 64; + this.buttonNW.Text = "NW"; + this.buttonNW.UseVisualStyleBackColor = true; + this.buttonNW.Click += new System.EventHandler(this.buttonNW_Click); + // // FormExpedit // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); this.ClientSize = new System.Drawing.Size(1221, 703); + this.Controls.Add(this.buttonNW); + this.Controls.Add(this.buttonSuchen); + this.Controls.Add(this.dGArtikel); this.Controls.Add(this.groupBoxStatistik); this.Controls.Add(this.buttonStats); this.Controls.Add(this.buttonEinstellung); @@ -871,7 +972,6 @@ this.Controls.Add(this.buttonSWS_Drucken); this.Controls.Add(this.tabControlAuftragList); this.Controls.Add(this.groupBoxEtikett); - this.Controls.Add(this.dGArtikel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.HelpButton = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -881,6 +981,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "EXPEDIT"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormExpedit_FormClosing); this.Load += new System.EventHandler(this.FormExpedit_Load); this.groupBoxEtikett.ResumeLayout(false); this.groupBoxEtikett.PerformLayout(); @@ -893,6 +994,8 @@ this.tabPageAll.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.objectListViewAuftrag)).EndInit(); this.tabControlAuftragList.ResumeLayout(false); + this.tabPageGeschaeft.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.objectListViewGeschaeft)).EndInit(); this.groupBoxStatistik.ResumeLayout(false); this.tableLayoutPanelStatistik.ResumeLayout(false); this.tableLayoutPanelStatistik.PerformLayout(); @@ -921,16 +1024,6 @@ private System.Windows.Forms.DataGridView dGArtikel; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox textBoxCont; - private System.Windows.Forms.DataGridViewTextBoxColumn KundeArtikelID; - private System.Windows.Forms.DataGridViewTextBoxColumn KundeID; - private System.Windows.Forms.DataGridViewTextBoxColumn ArtikelNR; - private System.Windows.Forms.DataGridViewTextBoxColumn ArtikelName; - private System.Windows.Forms.DataGridViewTextBoxColumn Stand; - private System.Windows.Forms.DataGridViewTextBoxColumn Fehlmenge; - private System.Windows.Forms.DataGridViewTextBoxColumn Korrektur; - private System.Windows.Forms.DataGridViewTextBoxColumn StandBearbeitet; - private System.Windows.Forms.DataGridViewTextBoxColumn FehlmengeBearbeitet; - private System.Windows.Forms.DataGridViewTextBoxColumn KorrekturBearbeitet; private System.Windows.Forms.TabPage tabPageSonder; private BrightIdeasSoftware.ObjectListView objectListViewSonder; private System.Windows.Forms.TabPage tabPageAll; @@ -953,5 +1046,19 @@ private System.Windows.Forms.Label labelStatistik2; private System.Windows.Forms.Label labelZahl1; private System.Windows.Forms.Label labelStatistik1; + private System.Windows.Forms.DataGridViewTextBoxColumn KundeArtikelID; + private System.Windows.Forms.DataGridViewTextBoxColumn KundeID; + private System.Windows.Forms.DataGridViewTextBoxColumn ArtikelNR; + private System.Windows.Forms.DataGridViewTextBoxColumn ArtikelName; + private System.Windows.Forms.DataGridViewTextBoxColumn Stand; + private System.Windows.Forms.DataGridViewTextBoxColumn Fehlmenge; + private System.Windows.Forms.DataGridViewTextBoxColumn Korrektur; + private System.Windows.Forms.DataGridViewTextBoxColumn StandBearbeitet; + private System.Windows.Forms.DataGridViewTextBoxColumn FehlmengeBearbeitet; + private System.Windows.Forms.DataGridViewTextBoxColumn KorrekturBearbeitet; + private System.Windows.Forms.Button buttonSuchen; + private System.Windows.Forms.Button buttonNW; + private System.Windows.Forms.TabPage tabPageGeschaeft; + private BrightIdeasSoftware.ObjectListView objectListViewGeschaeft; } } \ No newline at end of file diff --git a/AA-Forms/FormExpedit.cs b/AA-Forms/FormExpedit.cs index 7ceff18..fc57962 100644 --- a/AA-Forms/FormExpedit.cs +++ b/AA-Forms/FormExpedit.cs @@ -1,13 +1,17 @@ using BrightIdeasSoftware; using DatenDB; using Deckungsbeitrag.Properties; +using Microsoft.VisualBasic; using Npgsql; using System; using System.Collections.Generic; +using System.Configuration; +using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Net.Sockets; +using System.Threading.Tasks; using System.Windows.Forms; using System.Xml.Resolvers; @@ -16,6 +20,7 @@ namespace Deckungsbeitrag public partial class FormExpedit : Form { #region Properties + private readonly UserSettingsManager _settings = new UserSettingsManager(); private ToolTip cellTooltip = new ToolTip(); public Meldungen fehlermeldung = new Meldungen(); public Image etikett = null; @@ -31,10 +36,12 @@ namespace Deckungsbeitrag public List artikelListe; public List auftraglist; public List sonderlist; + public List geschaeftlist; int beforeedit = 0; int? neuecontclean = null; int? altecontclean = null; - Timer timer1 = new Timer(); + Timer timer1 = new Timer(); // Timer für Nachwäsche + Timer timer2 = new Timer(); // Timer für Refresh Auftragliste private Screen[] screens; private Point itemlocation; private ImageList imagelist = new ImageList(); @@ -51,10 +58,15 @@ namespace Deckungsbeitrag this.StartPosition = FormStartPosition.CenterScreen; this.tabControlAuftragList.Visible = true; - //Timer für Autorefresh - timer1.Interval = 10000; // 10 Sekunden - timer1.Tick += Timer1_Tick; - timer1.Start(); + //Timer für Autorefresh & Auftragliste Refresh + //timer1.Interval = 10000; // 10 sekunden + //timer1.Tick += Timer1_Tick; + //timer1.Start(); + + //timer2.Interval = 60000; // 1 Minute + //timer2.Tick += Timer2_Tick; + //timer2.Start(); + } public FormExpedit(Benutzer benutzer, Screen[] screens) : this(benutzer) @@ -68,18 +80,74 @@ namespace Deckungsbeitrag } } } - private void FormExpedit_Load(object sender, EventArgs e) { - Cursor.Current = Cursors.WaitCursor; + this.Cursor = Cursors.WaitCursor; + //this.Visible = false; this.SuspendLayout(); - this.Visible = false; - imagelist.Images.Add(Resources.Exclamation_Red); - imagelist.Images.Add(Resources.InformationSymbol_16x); - imagelist.ImageSize = new Size(24, 24); + _settings.Load(); + + //Auftragslisten erstellen und in ObjectListViews laden. + // DB PARALLEL im Background (NON-BLOCKING!) + _ = Task.Run(async () => + { + try + { + await Task.WhenAll(GetAuftraege(), GetSonderAuftraege()); + + // UI-Update NACH Daten (Invoke!) + this.Invoke(new Action(() => + { + // OLVs füllen + OLV_Load(objectListViewAuftrag, auftraglist); + // Lade die ListView für Sonderaufträge wie STV, STH, oder INVENTUR + if (sonderlist.Count == 0) { this.tabControlAuftragList.TabPages.Remove(tabPageSonder); } + else { OLV_Load(this.objectListViewSonder, sonderlist); if (this.tabControlAuftragList.TabPages.Count < 2) this.tabControlAuftragList.TabPages.Insert(1, tabPageSonder); } + // Lade die ListView für Geschäftaufträge + if (geschaeftlist.Count == 0) { this.tabControlAuftragList.TabPages.Remove(tabPageGeschaeft); } + else { OLV_Load(this.objectListViewGeschaeft, geschaeftlist); if (this.tabControlAuftragList.TabPages.Count < 2) this.tabControlAuftragList.TabPages.Insert(1, tabPageGeschaeft); } + + })); + } + catch (Exception ex) + { + // Vermeide $ für C# älter + this.BeginInvoke(new Action(() => MessageBox.Show( + string.Format("Laden fehlgeschlagen: {0}", ex.Message)))); + } + }); + + // Image Liste für ObjectListView laden. + ImageList_Laden(); // Controls aktivieren und deaktivieren nach BenutzerRolle + Enable_Controls(); + + + //TODO: Wenn GroupBox nicht notwendig, dann löschen. + //Load_Etikett_GroupBox(); + this.groupBoxEtikett.Visible = false; + + if (letzterLiefertag != null) this.dTPLiefertag.Value = (DateTime)letzterLiefertag; + else this.dTPLiefertag.Value = DateTime.Today.AddDays(1); + + if (this.kunde != null) Funktionen.Get_RadioButtons(this.groupBoxEtikett); + + + this.ResumeLayout(); + //this.Visible = true; + this.Cursor = Cursors.Default; + WindowState = FormWindowState.Maximized; + + } + + + /// + /// Controls werden nach Benutzer deaktiviert. + /// + private void Enable_Controls() + { switch (this.benutzer.Rolle) { case BenutzerRolle.Verwaltung: @@ -123,104 +191,118 @@ namespace Deckungsbeitrag break; } - //Auftragslisten erstellen und in ObjectListViews laden. - GetLists(); - Load_Etikett_GroupBox(); - - if (letzterLiefertag != null) this.dTPLiefertag.Value = (DateTime)letzterLiefertag; - else this.dTPLiefertag.Value = DateTime.Today.AddDays(1); - - if (this.kunde != null) Funktionen.Get_RadioButtons(this.groupBoxEtikett); - - - this.ResumeLayout(); - this.Visible = true; - Cursor.Current = Cursors.Default; - WindowState = FormWindowState.Maximized; } /// /// Auftragslisten erstellen und in ObjectListViews laden. /// - private void GetLists() + private async Task GetSonderAuftraege() { - // Lade die ListView für Aufträge vom aktuellen Tag. - auftraglist = Auftrag.GetAuftragListToday(DateTime.Today); - OLV_Load(this.objectListViewAuftrag, auftraglist); - - // Lade die ListView für Sonderaufträge wie STV, STH, oder INVENTUR - sonderlist = Auftrag.GetExpeditLists((int)AuftragTyp.Inventur); - if (sonderlist.Count == 0) { this.tabControlAuftragList.TabPages.Remove(tabPageSonder); } - else { OLV_Load(this.objectListViewSonder, sonderlist); if(this.tabControlAuftragList.TabPages.Count < 2) this.tabControlAuftragList.TabPages.Insert(1, tabPageSonder); } - - // Lade die Artikel eines Kunden. - //if (kunde!= null) this.artikelListe = KundeArtikel.GetList(kunde.KundeID.ToString()); - + var conn = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); // Pro Task! + try + { + await conn.OpenAsync(); + sonderlist = await Auftrag.GetExpeditListsAsync((int)AuftragTyp.Inventur, conn); + } + finally + { + if (conn.State == ConnectionState.Open) + conn.Close(); + conn.Dispose(); + } + } + private async Task GetAuftraege() + { + var conn = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); // Pro Task! + try + { + await conn.OpenAsync(); + auftraglist = await Auftrag.GetAuftragListTodayAsync(DateTime.Today, conn, AuftragTyp.Standart); + geschaeftlist = await Auftrag.GetAuftragListTodayAsync(DateTime.Today, conn, AuftragTyp.Geschäft); + } + finally + { + if (conn.State == ConnectionState.Open) + conn.Close(); + conn.Dispose(); + } } /// - /// Wenn Timer abgelaufen Funktion für Autorefresh. + /// Wenn Timer abgelaufen Funktion für Autorefresh & Neuer Timer für Auftragliste Refresh. /// /// /// private void Timer1_Tick(object sender, EventArgs e) { - // Vermeide Überlappung (wenn vorheriger Tick noch läuft) - if (_isProcessing) return; + this.Cursor = Cursors.WaitCursor; - Cursor.Current = Cursors.WaitCursor; - _isProcessing = true; - - try + // Nur durchführen wenn DataGridView ist sichtbar. + if (dGArtikel.Visible == true) { - if (auftrag != null) + // Vermeide Überlappung (wenn vorheriger Tick noch läuft) + if (_isProcessing) return; + + Cursor.Current = Cursors.WaitCursor; + _isProcessing = true; + + try { - const int maxRetries = 3; - Auftrag _auftrag = null; - - for (int retry = 0; retry < maxRetries; retry++) + if (auftrag != null) { - try - { - _auftrag = Auftrag.GetAuftrag(auftrag.AuftragID); - if (dGArtikel.Visible) Load_Gridview(_auftrag); + const int maxRetries = 3; + Auftrag _auftrag = null; - _consecutiveFailures = 0; // Erfolg -> Zähler reset - break; - } - catch (NpgsqlException ex) when ((ex.InnerException is SocketException || ex.InnerException is System.IO.IOException) && retry < maxRetries - 1) + for (int retry = 0; retry < maxRetries; retry++) { - _consecutiveFailures++; - Debug.WriteLine($"Retry {retry + 1}/{maxRetries}: {ex.Message}"); // Logging + try + { + _auftrag = Auftrag.GetAuftrag(auftrag.AuftragID); + if (dGArtikel.Visible) Load_Gridview(_auftrag); - System.Threading.Thread.Sleep(1000 * (int)Math.Pow(2, retry)); // Backoff: 1s, 2s, 4s + _consecutiveFailures = 0; // Erfolg -> Zähler reset + break; + } + catch (NpgsqlException ex) when ((ex.InnerException is SocketException || ex.InnerException is System.IO.IOException) && retry < maxRetries - 1) + { + _consecutiveFailures++; + Debug.WriteLine($"Retry {retry + 1}/{maxRetries}: {ex.Message}"); // Logging + + System.Threading.Thread.Sleep(1000 * (int)Math.Pow(2, retry)); // Backoff: 1s, 2s, 4s + } + catch (Exception ex) + { + Debug.WriteLine($"Unexpected error: {ex.Message}"); // Logging + break; + } } - catch (Exception ex) + + // Timer stoppen bei zu vielen aufeinanderfolgenden Fehlern + if (_consecutiveFailures >= MAX_FAILURES) { - Debug.WriteLine($"Unexpected error: {ex.Message}"); // Logging - break; + timer1.Enabled = false; + Debug.WriteLine("Timer gestoppt nach " + MAX_FAILURES + " Fehlern. Bitte manuell neu starten."); + // Optional: Status-Label setzen oder MessageBox } } - - // Timer stoppen bei zu vielen aufeinanderfolgenden Fehlern - if (_consecutiveFailures >= MAX_FAILURES) - { - timer1.Enabled = false; - Debug.WriteLine("Timer gestoppt nach " + MAX_FAILURES + " Fehlern. Bitte manuell neu starten."); - // Optional: Status-Label setzen oder MessageBox - } + } + catch (Exception ex) + { + Debug.WriteLine($"Timer1_Tick globaler Fehler: {ex}"); + _consecutiveFailures++; + } + finally + { + _isProcessing = false; + Cursor.Current = Cursors.Default; } } - catch (Exception ex) - { - Debug.WriteLine($"Timer1_Tick globaler Fehler: {ex}"); - _consecutiveFailures++; - } - finally - { - _isProcessing = false; - Cursor.Current = Cursors.Default; - } + + this.Cursor = Cursors.Default; + } + private async void Timer2_Tick(object sender, EventArgs e) + { + await GetAuftraege(); } /// @@ -228,44 +310,44 @@ namespace Deckungsbeitrag /// private void Load_Etikett_GroupBox() { - if (this.auftrag == null) - { - this.buttonKundeNr.Text = "Auftrag in der Liste wählen"; - this.pictureBoxEntwurf.Image = null; - this.textBoxCont.Text = "0"; - this.pictureBoxMinus.Enabled = this.pictureBoxPlus.Enabled = this.buttonDrucken.Enabled = false; - this.buttonDrucken.BackColor = Color.Gray; - this.pictureBoxMinus.BackColor = Color.Gray; - this.pictureBoxPlus.BackColor = Color.Gray; - foreach (Control ctr in this.groupBoxEtikett.Controls) - { - if (ctr.GetType() == typeof(Label)) ctr.Enabled = true; - else if (ctr.Enabled == true) ctr.Enabled = false; - } - this.dTPLiefertag.Enabled = true; + //if (this.auftrag == null) + //{ + // this.buttonKundeNr.Text = "Auftrag in der Liste wählen"; + // this.pictureBoxEntwurf.Image = null; + // this.textBoxCont.Text = "0"; + // this.pictureBoxMinus.Enabled = this.pictureBoxPlus.Enabled = this.buttonDrucken.Enabled = false; + // this.buttonDrucken.BackColor = Color.Gray; + // this.pictureBoxMinus.BackColor = Color.Gray; + // this.pictureBoxPlus.BackColor = Color.Gray; + // foreach (Control ctr in this.groupBoxEtikett.Controls) + // { + // if (ctr.GetType() == typeof(Label)) ctr.Enabled = true; + // else if (ctr.Enabled == true) ctr.Enabled = false; + // } + // this.dTPLiefertag.Enabled = true; - } - else - { - //Kunde holen und Name anzeigen - this.kunde = Kunde.GetKunde(null, this.auftrag.KundeID, null); - this.buttonKundeNr.Text = kunde.Suchtext; + //} + //else + //{ + // //Kunde holen und Name anzeigen + // this.kunde = Kunde.GetKunde(null, this.auftrag.KundeID, null); + // this.buttonKundeNr.Text = kunde.Suchtext; - //Containeranzahl und Liefertag anzeigen - if (neuecontclean != null) this.textBoxCont.Text = neuecontclean.ToString(); - else this.textBoxCont.Text = this.auftrag.ContainerClean.ToString(); - this.dTPLiefertag.Value = this.auftrag.Liefertag; - this.dTPLiefertag.Enabled = false; + // //Containeranzahl und Liefertag anzeigen + // if (neuecontclean != null) this.textBoxCont.Text = neuecontclean.ToString(); + // else this.textBoxCont.Text = this.auftrag.ContainerClean.ToString(); + // this.dTPLiefertag.Value = this.auftrag.Liefertag; + // this.dTPLiefertag.Enabled = false; - //Buttons Enablen und BackColor wechsel - this.buttonDrucken.BackColor = Color.FromArgb(0, 192, 0); - this.pictureBoxPlus.BackColor = Color.FromArgb(0, 192, 0); - this.buttonDrucken.Enabled = this.pictureBoxPlus.Enabled = true; + // //Buttons Enablen und BackColor wechsel + // this.buttonDrucken.BackColor = Color.FromArgb(0, 192, 0); + // this.pictureBoxPlus.BackColor = Color.FromArgb(0, 192, 0); + // this.buttonDrucken.Enabled = this.pictureBoxPlus.Enabled = true; - this.auftrag.ContainerClean = int.Parse(this.textBoxCont.Text); - etikett = Funktionen.Etikett_Entwurf(this, this.auftrag, nocont); - this.pictureBoxEntwurf.Image = etikett; - } + // this.auftrag.ContainerClean = int.Parse(this.textBoxCont.Text); + // etikett = Funktionen.Etikett_Entwurf(this, this.auftrag, nocont); + // this.pictureBoxEntwurf.Image = etikett; + //} } private void Load_Gridview(Auftrag auftrag) { @@ -310,7 +392,7 @@ namespace Deckungsbeitrag this.dGArtikel.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.dGArtikel = Funktionen.DGV_Size_Anpassen(this.dGArtikel); - this.dGArtikel.Width = this.Width - dGArtikel.Left; + //this.dGArtikel.Width = this.Width - dGArtikel.Left; // Rechter Rand von letzter Spalte berechnen. int x = 0; @@ -318,13 +400,15 @@ namespace Deckungsbeitrag this.dGArtikel.Location = new Point(this.objectListViewAuftrag.Left + x, this.dGArtikel.Location.Y); - if (this.dGArtikel.Rows.Count > 0) this.dGArtikel.Visible = true; + if (this.dGArtikel.Rows.Count > 0) { this.dGArtikel.Visible = true; timer1.Start(); } else this.dGArtikel.Visible = false; } } + #region Container-Events + /// /// Containeranzahl bearbeiten und Funktion wenn Text geändert wird. /// @@ -383,6 +467,8 @@ namespace Deckungsbeitrag else { nocont = false; nocontclicked = true; } } + #endregion + #region Button_Click-Events private void buttonDrucken_Click(object sender, EventArgs e) { @@ -406,20 +492,22 @@ namespace Deckungsbeitrag this.auftrag.Status = AuftragStatus.Vorbereitet; this.auftrag.Save(); this.auftrag = null; - FormExpedit_Load(this, e); + //FormExpedit_Load(this, e); this.dGArtikel.DataSource = null; this.dGArtikel.Rows.Clear(); } } } - private void buttonNeuerAuftrag_Click(object sender, EventArgs e) + private async void buttonNeuerAuftrag_Click(object sender, EventArgs e) { FormNeuerAuftrag neuerAuftrag = new FormNeuerAuftrag(benutzer, this.letzterLiefertag, AuftragTyp.Standart); if (neuerAuftrag.ShowDialog() == DialogResult.OK) { this.letzterLiefertag = neuerAuftrag.letzterLiefertag; - List auftraglist = Auftrag.GetAuftragListToday(DateTime.Today); - OLV_Load(this.objectListViewAuftrag, auftraglist); + await GetAuftraege(); + //List auftraglist = Auftrag.GetAuftragListToday(DateTime.Today); + OLV_SetObjects(this.objectListViewAuftrag, auftraglist); + OLV_SetObjects(this.objectListViewGeschaeft, geschaeftlist); } } private void buttonSWS_Drucken_Click(object sender, EventArgs e) @@ -432,6 +520,44 @@ namespace Deckungsbeitrag FormEinstellung einstellung = new FormEinstellung(this); einstellung.ShowDialog(); } + private void buttonSuchen_Click(object sender, EventArgs e) + { + int kundeID = 0; + + string eingabe = PromptForText( + "Welchen Kunden suchst du? \n\n" + + "Bitte scanne den QR-Code des Kunden den du suchst:", + "QR-Code Inhalt", + "0"); + + if (string.IsNullOrWhiteSpace(eingabe)) + { + this.Cursor = Cursors.Default; + return; + } + + string cleanedText = new string(eingabe.Where(char.IsLetterOrDigit).ToArray()); + + if (int.TryParse(cleanedText, out _)) kundeID = Kunde.GetKundeID(cleanedText, null); + else kundeID = Kunde.GetKundeID(null, cleanedText); + + var model = objectListViewAuftrag.Objects.Cast().FirstOrDefault(a => a.KundeID == kundeID); + + if (model != null) + { + objectListViewAuftrag.SelectedObject = model; + objectListViewAuftrag.EnsureModelVisible(model); + objectListViewAuftrag.Focus(); + + } + + } + private void buttonNW_Click(object sender, EventArgs e) + { + if (dGArtikel.Visible) dGArtikel.Visible = false; + else dGArtikel.Visible = true; + } + #endregion #region ObjectListView-Events @@ -464,6 +590,7 @@ namespace Deckungsbeitrag if (_auftrag.Status != AuftragStatus.Fertig) { this.auftrag = _auftrag; + this.kunde = Kunde.GetKunde(null, this.auftrag.KundeID, null); this.neuecontclean = null; Load_Etikett_GroupBox(); this.artikelListe = KundeArtikel.GetList(kunde.KundeID.ToString()); @@ -479,7 +606,7 @@ namespace Deckungsbeitrag olv.Focus(); } - private void objectListViewAuftrag_CellRightClick(object sender, CellRightClickEventArgs e) + private async void objectListViewAuftrag_CellRightClick(object sender, CellRightClickEventArgs e) { ObjectListView olv = (ObjectListView)sender; @@ -506,20 +633,22 @@ namespace Deckungsbeitrag if (_auftrag.AufgabeID != null) { // Wenn NEIN wird der Click abgebrochen. - if (meldung.GetAchtung(this, $"Bei dem ausgewählten Auftrag ist die Aufgabe {Aufgabe.GetAufgabe(null, auftrag.AufgabeID).Bezeichnung} zu erledigen. Hast du die Aufgabe erledigt? ", false) == DialogResult.No) return; + if (meldung.GetAchtung(this, $"Bei dem ausgewählten Auftrag ist die Aufgabe {Aufgabe.GetAufgabe(null, _auftrag.AufgabeID).Bezeichnung} zu erledigen. Hast du die Aufgabe erledigt? ", false) == DialogResult.No) return; else Aufgabe_erledigt(_auftrag, _kunde, name); } // Wenn TextBox für saubere Container 0 ist wird der Click abgebrochen. - if (this.textBoxCont.Text == "0") { meldung.GetFehler(this, "Du kannst den Auftrag nicht als vorbereitet markieren. Wähle zuerst die Anzahl der sauberen Container."); return; } + if (_auftrag.ContainerClean == 0) { meldung.GetFehler(this, "Du kannst den Auftrag nicht als vorbereitet markieren. Wähle zuerst die Anzahl der sauberen Container."); return; } // Auftrag wird bearbeitet und gespeichert. _auftrag.Status = AuftragStatus.Vorbereitet; _auftrag.Save(); olv.RefreshObject(e); - GetLists(); - if (olv.Name.Contains("Sonder")) OLV_Load(olv, this.sonderlist); - else OLV_Load(olv, this.auftraglist); + + await GetAuftraege(); + if (olv.Name.Contains("Sonder")) OLV_SetObjects(olv, sonderlist); + if (olv.Name.Contains("Geschaeft")) OLV_SetObjects(olv, geschaeftlist); + if (olv.Name.Contains("Auftrag")) OLV_SetObjects(olv, auftraglist); } break; case "Aufgabe": @@ -534,96 +663,51 @@ namespace Deckungsbeitrag break; } } - private void objectListViewAuftrag_ButtonClick(object sender, CellClickEventArgs e) + private async void objectListViewAuftrag_ButtonClick(object sender, BrightIdeasSoftware.CellClickEventArgs e) { Cursor.Current = Cursors.WaitCursor; ObjectListView olv = (ObjectListView)sender; Auftrag _auftrag = (Auftrag)e.Model; - if (this.auftrag != _auftrag) neuecontclean = null; - - this.auftrag = _auftrag; - //Load_Etikett_GroupBox(); - - if (this.auftrag.ContainerClean == 0) + if (e.Column.Text == "Abschließen") { - switch (this.auftrag.Typ) + if (this.auftrag != _auftrag) altecontclean = null; + + this.auftrag = _auftrag; + //Load_Etikett_GroupBox(); + + if (this.auftrag.ContainerClean == 0) { - case AuftragTyp.Geschäft: - break; - case AuftragTyp.Standart: - if (meldung.NoCleanContainer() == DialogResult.OK) return; - break; - case AuftragTyp.Inventur: - if (meldung.SonderNoCleanContainer() == DialogResult.Yes) - { - Auftrag_Fertig(); - Load_Etikett_GroupBox(); - } - else return; - break; - case AuftragTyp.Standverminderung: - if (meldung.SonderNoCleanContainer() == DialogResult.Yes) - { - Auftrag_Fertig(); - Load_Etikett_GroupBox(); - } - else return; - break; - case AuftragTyp.Standerhöhung: - if (meldung.SonderNoCleanContainer() == DialogResult.Yes) - { - Auftrag_Fertig(); - Load_Etikett_GroupBox(); - } - else return; - break; - default: - break; - } - } - else - { - if (neuecontclean != null && neuecontclean != altecontclean) - { - switch (meldung.DifferentCleanContainer()) + switch (this.auftrag.Typ) { - case DialogResult.Cancel: - return; - case DialogResult.Yes: - { - this.auftrag.ContainerClean = (int)neuecontclean; - neuecontclean = null; - //this.auftrag.Liefertag = dTPLiefertag.Value; - //WENN BEARBEITET UND AUSGEDRUCKT WIRD GEDRUCKT VERÄNDERT UND ERSTELLT IST URSPRUNGSDATUM - this.auftrag.Gedruckt = DateTime.Now; - this.auftrag.GedrucktVon = benutzer.BenutzerID; - - bool nocont = false; - if (MessageBox.Show("Möchtest du die Containeranzahl am Etikett anzeigen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - nocont = true; - } - else nocont = false; - - DialogResult result = Funktionen.Etikett_Drucken(auftrag, nocont); - if (result == DialogResult.OK) - { - Auftrag_Fertig(); - } - } + case AuftragTyp.Geschäft: break; - case DialogResult.No: + case AuftragTyp.Standart: + if (meldung.NoCleanContainer() == DialogResult.OK) return; + break; + case AuftragTyp.Inventur: + if (meldung.SonderNoCleanContainer() == DialogResult.Yes) { - this.auftrag.ContainerClean = (int)neuecontclean; - neuecontclean = null; - //this.auftrag.Liefertag = dTPLiefertag.Value; - //WENN BEARBEITET UND NICHT GEDRUCKT WIRD ERSTELLT VERÄNDERT UND GEDRUCKT IST URSPRUNGSDATUM - this.auftrag.Erstellt = DateTime.Now; - this.auftrag.ErstelltVon = (int)benutzer.BenutzerID; - Auftrag_Fertig(); + Load_Etikett_GroupBox(); } + else return; + break; + case AuftragTyp.Standverminderung: + if (meldung.SonderNoCleanContainer() == DialogResult.Yes) + { + Auftrag_Fertig(); + Load_Etikett_GroupBox(); + } + else return; + break; + case AuftragTyp.Standerhöhung: + if (meldung.SonderNoCleanContainer() == DialogResult.Yes) + { + Auftrag_Fertig(); + Load_Etikett_GroupBox(); + } + else return; break; default: break; @@ -631,79 +715,264 @@ namespace Deckungsbeitrag } else { - Auftrag_Fertig(); - Load_Etikett_GroupBox(); + if (altecontclean != null && this.auftrag.ContainerClean != altecontclean) + { + switch (meldung.DifferentCleanContainer()) + { + case DialogResult.Cancel: + return; + case DialogResult.Yes: + { + this.auftrag.ContainerClean = (int)neuecontclean; + neuecontclean = null; + //this.auftrag.Liefertag = dTPLiefertag.Value; + //WENN BEARBEITET UND AUSGEDRUCKT WIRD GEDRUCKT VERÄNDERT UND ERSTELLT IST URSPRUNGSDATUM + this.auftrag.Gedruckt = DateTime.Now; + this.auftrag.GedrucktVon = benutzer.BenutzerID; + + bool nocont = false; + if (MessageBox.Show("Möchtest du die Containeranzahl am Etikett anzeigen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + nocont = true; + } + else nocont = false; + + DialogResult result = Funktionen.Etikett_Drucken(auftrag, nocont); + if (result == DialogResult.OK) + { + Auftrag_Fertig(); + } + } + break; + case DialogResult.No: + { + this.auftrag.ContainerClean = (int)neuecontclean; + neuecontclean = null; + //this.auftrag.Liefertag = dTPLiefertag.Value; + //WENN BEARBEITET UND NICHT GEDRUCKT WIRD ERSTELLT VERÄNDERT UND GEDRUCKT IST URSPRUNGSDATUM + this.auftrag.Erstellt = DateTime.Now; + this.auftrag.ErstelltVon = (int)benutzer.BenutzerID; + + Auftrag_Fertig(); + } + break; + default: + break; + } + } + else + { + Auftrag_Fertig(); + Load_Etikett_GroupBox(); + } + + } + } + if (e.Column.Text == "Etikett") + { + this.auftrag = _auftrag; + + if (this.auftrag.AufgabeID != null) + { + if (meldung.GetAchtung(this, $"Bei dem ausgewählten Auftrag ist die Aufgabe {Aufgabe.GetAufgabe(null, auftrag.AufgabeID).Bezeichnung} zu erledigen. Hast du die Aufgabe erledigt? ", false) == DialogResult.No) return; } - } - olv.RefreshObject(e); - GetLists(); - if (olv.Name.Contains("Sonder")) OLV_Load(olv, this.sonderlist); - else OLV_Load(olv, this.auftraglist); - Load_Gridview(this.auftrag); + if (this.auftrag.ContainerClean != 0) + { + //AUFTRAG UPDATE + letzterLiefertag = this.auftrag.Liefertag = this.dTPLiefertag.Value; - Cursor.Current = Cursors.Default; + } + else + { + string eingabe = PromptForText( + "Der Auftrag hat keine sauberen Container oder Pakete. \n\n" + + "Bitte gib an wieviele Container oder Pakete der Auftrag hat:", + "Container/Pakete eingeben", + "0"); + + if (string.IsNullOrWhiteSpace(eingabe) || !int.TryParse(eingabe, out int anzahl)) + { + this.Cursor = Cursors.Default; + return; + } + this.auftrag.ContainerClean = anzahl; + } + //ETIKETT DRUCKEN + DialogResult result = Funktionen.Etikett_Drucken(auftrag, nocont); + if (result == DialogResult.OK) + { + this.auftrag.Gedruckt = this.auftrag.Erstellt = DateTime.Now; + this.auftrag.GedrucktVon = this.auftrag.ErstelltVon = (int)this.benutzer.BenutzerID; + this.auftrag.Status = AuftragStatus.Vorbereitet; + this.auftrag.Save(); + this.auftrag = null; + } + } + + // Neu-Laden der ObjectListView + await GetAuftraege(); + if (olv.Name.Contains("Sonder")) OLV_SetObjects(olv, sonderlist); + if (olv.Name.Contains("Geschaeft")) OLV_SetObjects(olv, geschaeftlist); + if (olv.Name.Contains("Auftrag")) OLV_SetObjects(olv, auftraglist); + + // DataGridView ausblenden. + this.dGArtikel.DataSource = null; + this.dGArtikel.Rows.Clear(); + this.dGArtikel.Visible = false; + + this.Cursor = Cursors.Default; } private void OLV_Load(ObjectListView olv, List auftraglist) { // Cursor auf Warte-Status setzen, um Benutzerfeedback zu geben - Cursor.Current = Cursors.WaitCursor; + this.Cursor = Cursors.WaitCursor; // Layout- und Update-Änderungen pausieren, um Flackern zu verhindern olv.SuspendLayout(); // Stoppt Layout-Berechnungen (Anchor/Dock) - olv.BeginUpdate(); // Stoppt Datenaktualisierungen/Redraws - + + // Automatisch alle Properties von Auftrag als Spalten generieren Generator.GenerateColumns(olv, typeof(Auftrag), true); - foreach (OLVColumn col in olv.Columns) - { - if (col.Index == 0) col.IsVisible = false; - if (col.Index >= 7 && col.Index <= 9) col.IsVisible |= false; - } + // ========== CHECKBOX COLUMNS FÜR ABTEILUNGEN =========== + // Spalten-Setup + var colFrottee = new OLVColumn("Frottee", "Frottee"); + colFrottee.Text = "FR"; + colFrottee.DisplayIndex = 6; + colFrottee.TextAlign = HorizontalAlignment.Center; + colFrottee.CheckBoxes = true; + colFrottee.Width = 50; + colFrottee.AspectGetter = row => ((Auftrag)row).Abteilungen.HasFlag(AbteilungsStatus.Frottee); - // ========== SPALTE 11: BUTTON-COLUMNE ========== - // Spalte 11 (Index 11) als Button-Spalte konfigurieren - OLVColumn buttonColumn = (OLVColumn)olv.Columns[11]; - buttonColumn.IsButton = true; // Als Button rendern - buttonColumn.ButtonSizing = OLVColumn.ButtonSizingMode.CellBounds; // Button füllt gesamte Zelle - - + var colKleinteile = new OLVColumn("Kleinteile", "Kleinteile"); + colKleinteile.Text = "KT"; + colKleinteile.DisplayIndex = 7; + colKleinteile.TextAlign = HorizontalAlignment.Center; + colKleinteile.CheckBoxes = true; + colKleinteile.Width = 50; + colKleinteile.AspectGetter = row => ((Auftrag)row).Abteilungen.HasFlag(AbteilungsStatus.Kleinteile); + + var colGrosseTeile = new OLVColumn("Großteile", "Großteile"); + colGrosseTeile.Text = "GT"; + colGrosseTeile.DisplayIndex = 8; + colGrosseTeile.TextAlign = HorizontalAlignment.Center; + colGrosseTeile.CheckBoxes = true; + colGrosseTeile.Width = 50; + colGrosseTeile.AspectGetter = row => ((Auftrag)row).Abteilungen.HasFlag(AbteilungsStatus.Großteile); + + olv.AllColumns.Add(colFrottee); + olv.AllColumns.Add(colKleinteile); + olv.AllColumns.Add(colGrosseTeile); + + // ========== COLUMNS DURCHLAUFEN =========== + foreach (OLVColumn col in olv.AllColumns) + { + switch (col.Text) + { + case "Abschließen": // Abschließen Spalte als Button-Spalte konfigurieren + + OLVColumn fertigColumn = col; + fertigColumn.DisplayIndex = 11; + fertigColumn.IsButton = true; // Als Button rendern + fertigColumn.ButtonSizing = OLVColumn.ButtonSizingMode.CellBounds; // Button füllt gesamte Zelle + fertigColumn.HeaderImageKey = "abschließen"; + fertigColumn.ShowTextInHeader = false; + fertigColumn.MinimumWidth = fertigColumn.MaximumWidth = 80; + break; + case "Etikett": // Etikett Spalte als Button-Spalte konfigurieren + OLVColumn etikettColumn = col; + etikettColumn.DisplayIndex = 10; + etikettColumn.IsButton = true; // Als Button rendern + etikettColumn.ButtonSizing = OLVColumn.ButtonSizingMode.CellBounds; // Button füllt gesamte Zelle + etikettColumn.HeaderImageKey = "print"; + etikettColumn.ShowTextInHeader = false; + etikettColumn.MinimumWidth = etikettColumn.MaximumWidth = 80; + break; + case "Aufgabe": // Aufgabe Spalte als Icon-Spalte: zeigt Icon wenn AufgabeID vorhanden + OLVColumn iconColumn = col; + iconColumn.DisplayIndex = 9; + iconColumn.ImageGetter = rowObject => + { + var auftrag = rowObject as Auftrag; + if (auftrag.AufgabeID == null) return null; // null = kein Icon anzeigen + else return 0; // Index 0 aus SmallImageList + }; + break; + case "Kunde": // Kunde Spalte als Icon-Spalte: zeigt Icon und Kundename wenn Anmerkung vorhanden + OLVColumn iColumn = col; + iColumn.DisplayIndex = 0; + iColumn.ImageGetter = rowObject => + { + var _auftrag = rowObject as Auftrag; + if (string.IsNullOrWhiteSpace(Kunde.GetKunde(null, _auftrag.KundeID, null).Anmerkung)) return null; // null = kein Icon anzeigen + else return 1; // Index 0 aus SmallImageList + }; + break; + case "Liefertag": // Liefertag Spalte Zeigt Liefertag als String an. + OLVColumn dateColumn = col; + dateColumn.DisplayIndex = 1; + dateColumn.AspectToStringFormat = "{0:ddd dd.MM.}"; + // DateTime-Filter für Spalte 2 + dateColumn.ClusteringStrategy = new DateTimeClusteringStrategy(DateTimePortion.Day, "ddd dd.MM."); // DateTimeClustering damit Datum gefiltert werden kann + olv.SecondarySortColumn = dateColumn; // Primary Sortiert nach Spalte 5 (Status) Secundary Sortiert nach Spalte 2 (Liefertag) + break; + case "Status": // Spalte 5 als primäre Sortier-Spalte festlegen (nach Datenbindung!) + OLVColumn sortcolumn = col; + sortcolumn.DisplayIndex = 4; + olv.PrimarySortColumn = sortcolumn; // Primary Sortiert nach Spalte 5 (Status) Secundary Sortiert nach Spalte 2 (Liefertag) + break; + case "Auswählen": + col.IsVisible = false; + break; + case "Erstellt": + col.IsVisible = false; + break; + case "Gedruckt": + col.IsVisible = false; + break; + case "Erledigt": + col.IsVisible = false; + break; + case "schmutzig": + col.HeaderImageKey = "dirt"; + col.ShowTextInHeader = false; + col.MinimumWidth = col.MaximumWidth = 80; + col.DisplayIndex = 2; + break; + case "sauber": + col.HeaderImageKey = "clean"; + col.ShowTextInHeader = false; + col.MinimumWidth = col.MaximumWidth = 80; + col.DisplayIndex = 3; + break; + default: + break; + } + + } + //TODO: Reihenfolge Spalten richtig stellen. + //TODO: OLV State speichern. + + olv.RebuildColumns(); + if (_settings.OLV_State != null) this.objectListViewAuftrag.RestoreState(_settings.OLV_State); // ========== IMAGE-LIST ZUWEISEN ========== - // SmallImageList für Icons in Detail-View (16x16 Pixel standard) + // SmallImageList für Icons in Detail-View (24x24 Pixel standard) olv.SmallImageList = imagelist; // Voraussetzung: imagelist mit Icon Index 0 gefüllt - - // ========== SPALTE 10 & 1: ICON-KOLUMNE ========== - // Spalte 10 als Icon-Spalte: zeigt Icon wenn AufgabeID vorhanden - OLVColumn iconColumn = (OLVColumn)olv.Columns[10]; - iconColumn.ImageGetter = rowObject => - { - var auftrag = rowObject as Auftrag; - if (auftrag.AufgabeID == null) return null; // null = kein Icon anzeigen - else return 0; // Index 0 aus SmallImageList - }; - OLVColumn iColumn = (OLVColumn)olv.Columns[1]; - iColumn.ImageGetter = rowObject => - { - var _auftrag = rowObject as Auftrag; - if (string.IsNullOrWhiteSpace(Kunde.GetKunde(null, _auftrag.KundeID, null).Anmerkung)) return null; // null = kein Icon anzeigen - else return 1; // Index 0 aus SmallImageList - }; - - - // ========== TOOLTIP FÜR ICON-SPALTE ========== + + // ========== TOOLTIP FÜR ICON-SPALTEN ========== // Automatischer Cell-Tooltip bei Mouse-Hover über Spalte 10 und 1 olv.CellToolTipShowing += (s, e) => { // Nur für Icon-Spalte (Index 10) und gültiges Model - if (e.ColumnIndex == 10 && e.Model is Auftrag auftrag) + if (e.Column.Text == "Aufgabe" && e.Model is Auftrag auftrag) { // Lade Bezeichnung der Aufgabe als Tooltip-Text e.Text = Aufgabe.GetAufgabe(null, auftrag.AufgabeID).Bezeichnung; } // Nur für Icon-Spalte (Index 1) und gültiges Model - if (e.ColumnIndex == 1 && e.Model is Auftrag _auftrag) + if (e.Column.Text == "Kunde" && e.Model is Auftrag _auftrag) { if (!string.IsNullOrWhiteSpace(Kunde.GetKunde(null, _auftrag.KundeID, null).Anmerkung)) { @@ -713,44 +982,84 @@ namespace Deckungsbeitrag } //TODO: Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? }; - + // ========== DATEN LADEN ========== // WICHTIG: SetObjects NACH Column-Konfiguration aufrufen! - olv.SetObjects(auftraglist); // Bindet die Auftragsliste an die View + OLV_SetObjects(olv, auftraglist); // ========== SORTIERUNG ========== - // Spalte 5 als primäre Sortier-Spalte festlegen (nach Datenbindung!) - OLVColumn sortcolumn = (OLVColumn)olv.Columns[5]; - olv.Sort(sortcolumn); // Sortiert aufsteigend nach Spalte 5 + olv.Sort(); // ========== CHECKBOX-FUNKTIONALITÄT ========== // Aktiviert Checkboxen basierend auf "IsChecked" Property des Auftrag-Modells - olv.CheckedAspectName = "IsChecked"; + //olv.CheckedAspectName = "IsChecked"; // ========== SPALTEN ANPASSEN ========== Funktionen.Columns_Resize(olv); // Externe Funktion für responsive Spaltenbreiten - - // Unsichtbare Spalten (Width = 0 = versteckt) - olv.Columns[0].Width = 0; // Spalte 0 verstecken - olv.Columns[7].Width = 0; // Spalte 7 verstecken - olv.Columns[8].Width = 0; // Spalte 8 verstecken - olv.Columns[9].Width = 0; // Spalte 9 verstecken - - + + olv.FilterMenuBuildStrategy = new MeinFilterMenu(); // ========== AUFRÄUMEN & AKTIVIEREN ========== - olv.EndUpdate(); // Update-Pause beenden, Daten neu zeichnen olv.ResumeLayout(); // Layout-Pause beenden, Positionen neu berechnen olv.Focus(); // OLV fokussieren (Tastaturbedienung aktivieren) // Cursor zurücksetzen - Cursor.Current = Cursors.Default; + this.Cursor = Cursors.Default; } + private void OLV_SetObjects(ObjectListView olv, List auftraglist) + { + olv.BeginUpdate(); // Stoppt Datenaktualisierungen/Redraws + olv.SetObjects(auftraglist); // Bindet die Auftragsliste an die View + olv.EndUpdate(); // Update-Pause beenden, Daten neu zeichnen + } + /// + /// Blendet die Button Spalten aus wenn der User dazu nicht berechtigt ist. + /// private void GetUnvisibleButtonColumn() { foreach (OLVColumn col in this.objectListViewAuftrag.Columns) if (col.IsButton) col.IsVisible = false; } + private void objectListViewAuftrag_CellEditFinished(object sender, CellEditEventArgs e) + { + Auftrag auftrag = (Auftrag)e.RowObject; + if (e.Column.Text == "sauber") altecontclean = (int?)e.Value; + if (!string.IsNullOrWhiteSpace(e.NewValue.ToString())) Save_Auftrag(auftrag, false); + } + private void objectListViewAuftrag_CellEditStarting(object sender, CellEditEventArgs e) + { + if(meldung.GetFrage(this, $"Möchtest du die gewählte Zelle wirklich bearbeiten?", false) == DialogResult.No) e.Cancel = true; + } + private void ImageList_Laden() + { + imagelist.Images.Add(Resources.Exclamation_Red); + imagelist.Images.Add(Resources.InformationSymbol_16x); + imagelist.Images.Add("print", Resources.Print_16x); + imagelist.Images.Add("abschließen", Resources.Checkmark_blue_16x); + imagelist.Images.Add("dirt", Resources.dirt); + imagelist.Images.Add("clean", Resources.clean); + imagelist.ImageSize = new Size(24, 24); + + } + #endregion - + + /// + /// Zeigt Fenster zur Eingabe von Text. + /// + /// + /// + /// + /// Anzahl Saubere Container als string + private string PromptForText(string titel, string prompt, string defaultText) + { + return Interaction.InputBox(prompt, titel, defaultText); + } + + private void Save_Auftrag(Auftrag auftrag, bool show) + { + if (auftrag.Save()[0] == 1) if (show) meldung.Gespeichert(); + else if (show) meldung.Speicherfehler(); + } + private void Aufgabe_erledigt(Auftrag _auftrag,Kunde _kunde, string name) { if (_kunde.AufgabeCount <= 0) _kunde.Aufgabe = null; @@ -768,8 +1077,10 @@ namespace Deckungsbeitrag this.auftrag.Status = AuftragStatus.Fertig; this.auftrag.Save(); this.auftrag = null; + this.dGArtikel.Visible = false; } + #region Liefertag-Events /// /// Liefertag wird ermittelt und in Day of Week umgerechnet. RadioButtons werden Checked oder Unchecked und Click wird registriert. /// @@ -809,7 +1120,8 @@ namespace Deckungsbeitrag this.objectListViewAuftrag.RefreshObject(this.auftrag); } } - + #endregion + /// /// Wenn das dritte Tab gewählt ist, wird die GroupBox Etikett ausgeblendet. 3.Tab wäre für vergangene Aufträge - weshalb kein Etikett mehr notwendig. /// @@ -882,6 +1194,11 @@ namespace Deckungsbeitrag } } } + private void dGArtikel_VisibleChanged(object sender, EventArgs e) + { + if (dGArtikel.Visible) timer1.Start(); + else timer1.Stop(); + } #region Statistik private void buttonStats_Click(object sender, EventArgs e) @@ -947,13 +1264,37 @@ namespace Deckungsbeitrag { GetStatistik(); } + #endregion + private void FormExpedit_FormClosing(object sender, FormClosingEventArgs e) + { + _settings.OLV_State = this.objectListViewAuftrag.SaveState(); + _settings.Save(); + } + } } -//CHANGES: Wenn Auftrag als Vorbereitet markiert wird, wird nachgefragt ob die Aufgabe erledigt wurde. -//CHANGES: Wenn saubere Container sind 0 kann Auftrag nicht als Vorbereitet markiert werden. (Damit die Statistik stimmt) -//CHANGES: Es werden jetzt Meldungen gezeigt damit Aufgaben erledigt und Containeranzahl zuverlässig stimmt. -//DONE: Spalten besser erkennbar gestalten damit Mirka die Spalte trifft wenn RechtsClick. -//DONE: Aufgabe wird bei "Vorbereiten ohne Etikett" verarbeitet. -//DONE: Auftrag als Vorbereitet markieren geht nur wenn saubere Container nicht 0 sind. +//INSTALL-REMINDER: Spalte Abteilungen in Auftrag muss in Wirl_DB_17012023 eingefügt werden. +//CHANGES: Geschäftaufträge werden in neuem Tab angezeigt. +//CHANGES: Kundeneingabe mit ? fügt einmaligen Kundenname als ZusatzInfo hinzu und wählt Kunde BAR DIVERSE 2320000 +//CHANGES: Highlightfarbe bleibt auch wenn unfocused. (Farbe ändern?) +//CHANGES: Sortierte Spalte hat leicht andere Farbe. (Besser zu erkennen wonach sortiert wird) +//CHANGES: Als zweite Sortierung wird immer der Liefertag gewählt. +//CHANGES: Rechtsklick auf Spaltenheader ermöglicht Filtern. +//CHANGES: Wenn HEUTE als Liefertag gewählt, kommt Frage ob heute oder in einer Woche. Wenn JA dann HEUTE. +//CHANGES: Bearbeiten in ObjectListView möglich. (Kundename wird aber zurückgesetzt) +//CHANGES: Wenn Doppelklick auf Zelle, wird gefragt ob bearbeiten wirklich gewollt. Sonst wird blockiert. +//CHANGES: GroupBox nicht mehr notwendig. Etikette Druck über ObjectListView. +//CHANGES: Datumfilter funktioniert. +//CHANGES: Keine Timer da Probleme mit DB-Connection. DataGridView wird neu geladen wenn Auftrag neu gewählt wird. +//CHANGES: ObjectListView speichert Status automatisch beim schließen des Fensters und läd wieder wenn neu gestartet wird. +//CHANGES: AbteilungsStatus ist implementiert. +//CHANGES: Aus und Einblenden der Nachwäsche möglich. +//CHANGES: Suchen eines Auftrags mit Scan möglich. +//TODO: Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten) +//DONE: Etikett GroupBox entfernen. Änderungen direkt in ObjectListView vornehmen PrintPreview für Etikett. +//DONE: Etikett Drucken als Button in Row. Dann Vorschau anzeigen und Drucken. +//DONE: StartUp von Expedit verfeinern. +//TODO: Datum HEUTE auch bei NeuerAuftrag?? +//DONE: Einmalige Kunden für Geschäft ermöglichen \ No newline at end of file diff --git a/AA-Forms/FormFehlmengeCount.cs b/AA-Forms/FormFehlmengeCount.cs index c4797cf..eff993a 100644 --- a/AA-Forms/FormFehlmengeCount.cs +++ b/AA-Forms/FormFehlmengeCount.cs @@ -19,11 +19,15 @@ namespace Deckungsbeitrag { private FilterInfoCollection videoDevices; Kunde kunde; + Auftrag auftrag; List artikelListe; Meldungen meldung = new Meldungen(); - private List auftragsliste; + private List auftragsliste; string userid; + + #region Form-Konstruktor + public FormFehlmengeCount() { InitializeComponent(); @@ -40,6 +44,8 @@ namespace Deckungsbeitrag this.userid = uid; } + #endregion + private void FormFehlmengeCount_Load(object sender, EventArgs e) { videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); @@ -147,7 +153,7 @@ namespace Deckungsbeitrag case var nr when nr.ToString().StartsWith("6312") & nr.ToString().EndsWith("1"): //DUSCHTUCH BLAU this.buttonArt7.Tag = artikel; break; - case var nr when nr.ToString().StartsWith("61115") & (nr.ToString().EndsWith("00") || nr.ToString().EndsWith("30")): //SPANNLEINTUCH SINGLE + case var nr when nr.ToString().StartsWith("61115") & (nr.ToString().EndsWith("00") || nr.ToString().EndsWith("30") || nr.ToString().EndsWith("10")): //SPANNLEINTUCH SINGLE this.buttonArt8.Tag = artikel; break; default: @@ -156,7 +162,7 @@ namespace Deckungsbeitrag } // Wird bei Großteile verarbeitet - if (this.userid.Contains("großteile")) + if (this.userid.Contains("grossteile")) { // Wird bei Großteilen verarbeitet switch (artikel.ArtikelNR) @@ -286,13 +292,13 @@ namespace Deckungsbeitrag private void buttonFertig_Click(object sender, EventArgs e) { // Controls werden durchgegangen und ausgeblendet oder der Text entfernt. - foreach(Control ctr in this.Controls) + foreach (Control ctr in this.Controls) { switch (ctr) { case Label lbl: - lbl.Text = string.Empty; - //lbl.Visible = false; + //lbl.Text = string.Empty; + lbl.Visible = false; break; case GroupBox gb: gb.Visible = false; @@ -306,6 +312,13 @@ namespace Deckungsbeitrag } } + // AbteilungsStatus für Kleinteile und Großteile wird hier gesetzt. + if (!userid.Contains("frottee")) + { + if (userid.Contains("kleinteile")) { auftrag.Abteilungen |= AbteilungsStatus.Kleinteile; auftrag.Save(); } + if (userid.Contains("grossteile")) { auftrag.Abteilungen |= AbteilungsStatus.Großteile; auftrag.Save(); } + } + //Kunde wird durch Scan oder Handeingabe Ausgewählt. Open_Liste(); ControlLaden(); @@ -316,18 +329,19 @@ namespace Deckungsbeitrag /// Wenn Extrakunde dann true private void Open_Liste() { - auftragsliste = Auftrag.GetFinishingList(); - List kundenliste = new List(); - foreach(Auftrag auf in auftragsliste) - { - object kunde = Kunde.GetKunde(null, auf.KundeID, null); - kundenliste.Add(kunde); - } + auftragsliste = new List(Auftrag.GetFinishingList()); + //List kundenliste = new List(); + //foreach(Auftrag auf in auftragsliste) + //{ + // object kunde = Kunde.GetKunde(null, auf.KundeID, null); + // kundenliste.Add(kunde); + //} - FormListe liste = new FormListe(kundenliste, 0); + FormListe liste = new FormListe(auftragsliste, 0); if (liste.ShowDialog() == DialogResult.OK) { - this.kunde = liste.kunde; + this.auftrag = liste.auftrag; + this.kunde = Kunde.GetKunde(null, auftrag.KundeID, null); } } diff --git a/AA-Forms/FormListe.Designer.cs b/AA-Forms/FormListe.Designer.cs index f7a8a32..91466d0 100644 --- a/AA-Forms/FormListe.Designer.cs +++ b/AA-Forms/FormListe.Designer.cs @@ -168,6 +168,7 @@ namespace Deckungsbeitrag this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "LISTE"; this.TopMost = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormListe_FormClosing); this.Load += new System.EventHandler(this.FormListe_Load); this.Shown += new System.EventHandler(this.FormListe_Shown); this.ResumeLayout(false); diff --git a/AA-Forms/FormListe.cs b/AA-Forms/FormListe.cs index b81b9aa..ff072b4 100644 --- a/AA-Forms/FormListe.cs +++ b/AA-Forms/FormListe.cs @@ -21,7 +21,8 @@ namespace Deckungsbeitrag Kundenliste = 0, Aufgabenliste = 1, Benutzerliste = 2, - Auftragliste = 3 + Auftragliste = 3, + Finishingliste = 4 } public partial class FormListe : Form { @@ -32,6 +33,7 @@ namespace Deckungsbeitrag private List Aufgabenliste; private List Benutzerliste; private List Auftragliste; + private List Finishingliste; private Meldungen meldung = new Meldungen(); bool isKundenliste = false; bool isAufgabenliste = false; @@ -72,14 +74,18 @@ namespace Deckungsbeitrag } if(this.type_of_list == (int)Listentyp.Kundenliste) { - if (objliste != null) this.Kundenliste = objliste.OfType().GroupBy(k => k.KundeID).Select(g => g.First()).ToList(); + if (objliste != null) + { + this.type_of_list = (int)Listentyp.Finishingliste; + this.Finishingliste = objliste.Cast().ToList(); + } } } #endregion private void FormListe_Load(object sender, EventArgs e) { - // Timer für Wartezeit bis TextChanged eintritt. + // Timer für Wartezeit bis TextChanged eintritt. timer = new Timer(); timer.Interval = 700; // 0,7 Sekunden timer.Tick += Timer_Tick; @@ -101,7 +107,7 @@ namespace Deckungsbeitrag //LISTE LEEREN this.listViewKunde.Items.Clear(); this.listViewKunde.Columns.Clear(); - + //SWITCH NACH LISTENTYP switch (type_of_list) { @@ -196,6 +202,35 @@ namespace Deckungsbeitrag this.listViewKunde.Items.Add(item); } this.textBoxKunde.Enabled = false; + break; + case var finishliste when type_of_list == (int)Listentyp.Finishingliste: + //SPALTEN ERSTELLEN UND EINFÜGEN + string[] colname1 = knd_col.Split(','); + foreach (string s in colname1) + { + ColumnHeader ch = new ColumnHeader(); + ch.Text = s; + + this.listViewKunde.Columns.Add(ch); + } + //KUNDEN LADEN + this.Text = "KUNDE WÄHLEN"; + foreach (Auftrag a in this.Finishingliste) + { + Kunde knd = Kunde.GetKunde(null, a.KundeID, null); + + ListViewItem item = new ListViewItem(); + item.Tag = a; + item.Text = knd.KundeNummer; + item.SubItems.Add(knd.Suchtext); + item.SubItems.Add(knd.KundeName); + item.SubItems.Add(knd.Ort); + + this.listViewKunde.Items.Add(item); + } + if (listViewKunde.Items.Count == 1) kunde = (Kunde)listViewKunde.Items[0].Tag; + this.buttonNeuerAuftrag.Visible = this.buttonNeuerAuftrag.Enabled = false; + break; default: break; @@ -226,6 +261,8 @@ namespace Deckungsbeitrag { this.textBoxKunde.ForeColor = Color.Black; this.textBoxKunde.Clear(); + + //GetKeyboard(); } private void textBoxKunde_TextChanged(object sender, EventArgs e) @@ -238,11 +275,14 @@ namespace Deckungsbeitrag { timer.Stop(); // Timer stoppen + if(string.IsNullOrEmpty(textBoxKunde.Text)) { return; } + // Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt. if (!textBoxKunde.Text.StartsWith("?")) { this.Kundenliste = Kunde.GetTmpList(this.textBoxKunde.Text); listViewKunde_Load(); + return; } // Wenn Fragezeichen am Anfang wird OK-Button aktiviert. @@ -272,6 +312,11 @@ namespace Deckungsbeitrag this.DialogResult = DialogResult.OK; this.Close(); break; + case var _ when type_of_list == (int)Listentyp.Finishingliste: + auftrag = (Auftrag)item.Tag; + this.DialogResult = DialogResult.OK; + this.Close(); + break; default: break; } @@ -289,7 +334,28 @@ namespace Deckungsbeitrag { if (this.listViewKunde.Items.Count == 1) { - kunde = (Kunde)this.listViewKunde.Items[0].Tag; + switch (type_of_list) + { + case var _ when type_of_list == (int)Listentyp.Kundenliste: + { + kunde = (Kunde)this.listViewKunde.Items[0].Tag; + this.DialogResult = DialogResult.OK; + this.Close(); + } + break; + case var _ when type_of_list == (int)Listentyp.Auftragliste: + auftrag = (Auftrag)this.listViewKunde.Items[0].Tag; + this.DialogResult = DialogResult.OK; + this.Close(); + break; + case var _ when type_of_list == (int)Listentyp.Finishingliste: + auftrag = (Auftrag)this.listViewKunde.Items[0].Tag; + this.DialogResult = DialogResult.OK; + this.Close(); + break; + default: + break; + } } else return; } @@ -340,8 +406,10 @@ namespace Deckungsbeitrag this.Close(); } } + + private void FormListe_FormClosing(object sender, FormClosingEventArgs e) + { + + } } } -//CHANGES: Die Liste zeigt jetzt auch die Aufträge und die Kunden der möglich Aufträge an. (Erleichtert die Kundenauswahl bei Fehlmengecount) -//DONE: Listentyp.Auftragliste implementiert um über FormWSVerfolgung die Auftragliste abrufen zu können. -//DONE: Kunde anzeigen Reihenfolge der Spalten zuerst Suchtext danach Name. \ No newline at end of file diff --git a/AA-Forms/FormMain.Designer.cs b/AA-Forms/FormMain.Designer.cs index 05558d8..16ac2d2 100644 --- a/AA-Forms/FormMain.Designer.cs +++ b/AA-Forms/FormMain.Designer.cs @@ -31,22 +31,11 @@ namespace Deckungsbeitrag { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); this.toolStripMenu = new System.Windows.Forms.ToolStrip(); - this.tSBBenutzerVW = new System.Windows.Forms.ToolStripButton(); - this.tSBAuftragVW = new System.Windows.Forms.ToolStripButton(); - this.tSBAufgabeVW = new System.Windows.Forms.ToolStripButton(); - this.tSBArtikelVW = new System.Windows.Forms.ToolStripButton(); - this.toolStripZaehlscheine = new System.Windows.Forms.ToolStripButton(); - this.tSBExpedit = new System.Windows.Forms.ToolStripButton(); - this.toolStripDB = new System.Windows.Forms.ToolStripButton(); - this.tSBKosten = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.tSBScannTest = new System.Windows.Forms.ToolStripButton(); - this.tSBHilfe = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonImport = new System.Windows.Forms.ToolStripButton(); - this.tSBEinstellung = new System.Windows.Forms.ToolStripButton(); - this.toolStripBeenden = new System.Windows.Forms.ToolStripButton(); this.panelMain = new System.Windows.Forms.Panel(); + this.buttonNeuerStand = new System.Windows.Forms.Button(); + this.buttonNeueInventur = new System.Windows.Forms.Button(); this.buttonNeueAufgabe = new System.Windows.Forms.Button(); + this.buttonNeuerAuftrag = new System.Windows.Forms.Button(); this.buttonNeuerUser = new System.Windows.Forms.Button(); this.groupBoxStatistik = new System.Windows.Forms.GroupBox(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); @@ -70,7 +59,6 @@ namespace Deckungsbeitrag this.buttonArtikelUpdate = new System.Windows.Forms.Button(); this.progressBarArtikel = new System.Windows.Forms.ProgressBar(); this.buttonAllUpdate = new System.Windows.Forms.Button(); - this.buttonNeuerAuftrag = new System.Windows.Forms.Button(); this.groupBoxAuftrag = new System.Windows.Forms.GroupBox(); this.objectListViewAuftrag = new BrightIdeasSoftware.ObjectListView(); this.rBAufAbruf = new System.Windows.Forms.RadioButton(); @@ -81,12 +69,25 @@ namespace Deckungsbeitrag this.buttonAufAbruf = new System.Windows.Forms.Button(); this.buttonAusgeliefert = new System.Windows.Forms.Button(); this.groupBoxScannTest = new System.Windows.Forms.GroupBox(); - this.pictureBoxScannTest = new System.Windows.Forms.PictureBox(); this.textBoxScannTest = new System.Windows.Forms.TextBox(); this.buttonScannTest = new System.Windows.Forms.Button(); this.labelScannTest = new System.Windows.Forms.Label(); - this.buttonNeueInventur = new System.Windows.Forms.Button(); - this.buttonNeuerStand = new System.Windows.Forms.Button(); + this.tSBBenutzerVW = new System.Windows.Forms.ToolStripButton(); + this.tSBAuftragVW = new System.Windows.Forms.ToolStripButton(); + this.tSBAufgabeVW = new System.Windows.Forms.ToolStripButton(); + this.tSBArtikelVW = new System.Windows.Forms.ToolStripButton(); + this.toolStripZaehlscheine = new System.Windows.Forms.ToolStripButton(); + this.tSBExpedit = new System.Windows.Forms.ToolStripButton(); + this.toolStripDB = new System.Windows.Forms.ToolStripButton(); + this.tSBKosten = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.tSBScannTest = new System.Windows.Forms.ToolStripButton(); + this.tSBHilfe = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonImport = new System.Windows.Forms.ToolStripButton(); + this.tSBEinstellung = new System.Windows.Forms.ToolStripButton(); + this.toolStripBeenden = new System.Windows.Forms.ToolStripButton(); + this.pictureBoxScannTest = new System.Windows.Forms.PictureBox(); + this.tSBTourenplanung = new System.Windows.Forms.ToolStripButton(); this.toolStripMenu.SuspendLayout(); this.panelMain.SuspendLayout(); this.groupBoxStatistik.SuspendLayout(); @@ -120,6 +121,7 @@ namespace Deckungsbeitrag this.tSBHilfe, this.toolStripButtonImport, this.tSBEinstellung, + this.tSBTourenplanung, this.toolStripBeenden}); this.toolStripMenu.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow; this.toolStripMenu.Location = new System.Drawing.Point(0, 0); @@ -128,276 +130,6 @@ namespace Deckungsbeitrag this.toolStripMenu.TabIndex = 0; this.toolStripMenu.Text = "toolStripMenu"; // - // tSBBenutzerVW - // - this.tSBBenutzerVW.AutoSize = false; - this.tSBBenutzerVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBBenutzerVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBBenutzerVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBBenutzerVW.ForeColor = System.Drawing.Color.White; - this.tSBBenutzerVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBBenutzerVW.Image"))); - this.tSBBenutzerVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBBenutzerVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBBenutzerVW.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBBenutzerVW.Name = "tSBBenutzerVW"; - this.tSBBenutzerVW.Size = new System.Drawing.Size(180, 40); - this.tSBBenutzerVW.Text = "BENUTZERVERWALTUNG"; - this.tSBBenutzerVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBBenutzerVW.Click += new System.EventHandler(this.tSBBenutzerVW_Click); - this.tSBBenutzerVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBBenutzerVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBBenutzerVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBAuftragVW - // - this.tSBAuftragVW.AutoSize = false; - this.tSBAuftragVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBAuftragVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBAuftragVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBAuftragVW.ForeColor = System.Drawing.Color.White; - this.tSBAuftragVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBAuftragVW.Image"))); - this.tSBAuftragVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBAuftragVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBAuftragVW.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBAuftragVW.Name = "tSBAuftragVW"; - this.tSBAuftragVW.Size = new System.Drawing.Size(180, 40); - this.tSBAuftragVW.Text = "AUFTRAGVERWALTUNG"; - this.tSBAuftragVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBAuftragVW.ToolTipText = "Auftragkontrolle und -bearbeitung"; - this.tSBAuftragVW.Click += new System.EventHandler(this.tSBAuftragVW_Click); - this.tSBAuftragVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBAuftragVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBAuftragVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBAufgabeVW - // - this.tSBAufgabeVW.AutoSize = false; - this.tSBAufgabeVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBAufgabeVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBAufgabeVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBAufgabeVW.ForeColor = System.Drawing.Color.White; - this.tSBAufgabeVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBAufgabeVW.Image"))); - this.tSBAufgabeVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBAufgabeVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBAufgabeVW.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBAufgabeVW.Name = "tSBAufgabeVW"; - this.tSBAufgabeVW.Size = new System.Drawing.Size(180, 40); - this.tSBAufgabeVW.Text = "AUFGABENVERWALTUNG"; - this.tSBAufgabeVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBAufgabeVW.Click += new System.EventHandler(this.tSBAufgabeVW_Click); - this.tSBAufgabeVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBAufgabeVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBAufgabeVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBArtikelVW - // - this.tSBArtikelVW.AutoSize = false; - this.tSBArtikelVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBArtikelVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBArtikelVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBArtikelVW.ForeColor = System.Drawing.Color.White; - this.tSBArtikelVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBArtikelVW.Image"))); - this.tSBArtikelVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBArtikelVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBArtikelVW.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBArtikelVW.Name = "tSBArtikelVW"; - this.tSBArtikelVW.Size = new System.Drawing.Size(180, 40); - this.tSBArtikelVW.Text = "ARTIKELVERWALTUNG"; - this.tSBArtikelVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBArtikelVW.ToolTipText = "Artikel bearbeiten"; - this.tSBArtikelVW.Click += new System.EventHandler(this.tSBArtikelVW_Click); - this.tSBArtikelVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBArtikelVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBArtikelVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // toolStripZaehlscheine - // - this.toolStripZaehlscheine.AutoSize = false; - this.toolStripZaehlscheine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.toolStripZaehlscheine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripZaehlscheine.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.toolStripZaehlscheine.ForeColor = System.Drawing.Color.White; - this.toolStripZaehlscheine.Image = ((System.Drawing.Image)(resources.GetObject("toolStripZaehlscheine.Image"))); - this.toolStripZaehlscheine.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripZaehlscheine.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripZaehlscheine.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripZaehlscheine.Name = "toolStripZaehlscheine"; - this.toolStripZaehlscheine.Size = new System.Drawing.Size(180, 40); - this.toolStripZaehlscheine.Text = "KUNDENVERWALTUNG"; - this.toolStripZaehlscheine.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripZaehlscheine.ToolTipText = "Kunde bearbeiten"; - this.toolStripZaehlscheine.Click += new System.EventHandler(this.toolStripZaehlscheine_Click); - this.toolStripZaehlscheine.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.toolStripZaehlscheine.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.toolStripZaehlscheine.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBExpedit - // - this.tSBExpedit.AutoSize = false; - this.tSBExpedit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBExpedit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBExpedit.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBExpedit.ForeColor = System.Drawing.Color.White; - this.tSBExpedit.Image = ((System.Drawing.Image)(resources.GetObject("tSBExpedit.Image"))); - this.tSBExpedit.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBExpedit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBExpedit.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBExpedit.Name = "tSBExpedit"; - this.tSBExpedit.Size = new System.Drawing.Size(180, 40); - this.tSBExpedit.Text = "EXPEDIT"; - this.tSBExpedit.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBExpedit.Click += new System.EventHandler(this.tSBExpedit_Click); - this.tSBExpedit.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBExpedit.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBExpedit.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // toolStripDB - // - this.toolStripDB.AutoSize = false; - this.toolStripDB.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.toolStripDB.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDB.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.toolStripDB.ForeColor = System.Drawing.Color.White; - this.toolStripDB.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDB.Image"))); - this.toolStripDB.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripDB.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripDB.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDB.Name = "toolStripDB"; - this.toolStripDB.Size = new System.Drawing.Size(180, 40); - this.toolStripDB.Text = "DECKUNGSBEITRAG"; - this.toolStripDB.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripDB.Click += new System.EventHandler(this.toolStripDB_Click); - this.toolStripDB.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.toolStripDB.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.toolStripDB.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBKosten - // - this.tSBKosten.AutoSize = false; - this.tSBKosten.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBKosten.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBKosten.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBKosten.ForeColor = System.Drawing.Color.White; - this.tSBKosten.Image = ((System.Drawing.Image)(resources.GetObject("tSBKosten.Image"))); - this.tSBKosten.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBKosten.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBKosten.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBKosten.Name = "tSBKosten"; - this.tSBKosten.Size = new System.Drawing.Size(180, 40); - this.tSBKosten.Text = "KOSTENLISTE"; - this.tSBKosten.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBKosten.Click += new System.EventHandler(this.tSBKosten_Click); - this.tSBKosten.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBKosten.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBKosten.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // toolStripButton1 - // - this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripButton1.AutoSize = false; - this.toolStripButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.BackgroundImage"))); - this.toolStripButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Enabled = false; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(180, 70); - this.toolStripButton1.Text = "toolStripButton1"; - // - // tSBScannTest - // - this.tSBScannTest.AutoSize = false; - this.tSBScannTest.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBScannTest.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBScannTest.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBScannTest.ForeColor = System.Drawing.Color.White; - this.tSBScannTest.Image = ((System.Drawing.Image)(resources.GetObject("tSBScannTest.Image"))); - this.tSBScannTest.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBScannTest.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBScannTest.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBScannTest.Name = "tSBScannTest"; - this.tSBScannTest.Size = new System.Drawing.Size(180, 40); - this.tSBScannTest.Text = "SCANN TEST"; - this.tSBScannTest.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBScannTest.Click += new System.EventHandler(this.tSBScannTest_Click); - this.tSBScannTest.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.tSBScannTest.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.tSBScannTest.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBHilfe - // - this.tSBHilfe.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.tSBHilfe.AutoSize = false; - this.tSBHilfe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.tSBHilfe.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBHilfe.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBHilfe.ForeColor = System.Drawing.Color.White; - this.tSBHilfe.Image = ((System.Drawing.Image)(resources.GetObject("tSBHilfe.Image"))); - this.tSBHilfe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBHilfe.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.tSBHilfe.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBHilfe.Name = "tSBHilfe"; - this.tSBHilfe.Size = new System.Drawing.Size(180, 40); - this.tSBHilfe.Text = "HILFE"; - this.tSBHilfe.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBHilfe.Click += new System.EventHandler(this.tSBHilfe_Click); - // - // toolStripButtonImport - // - this.toolStripButtonImport.AutoSize = false; - this.toolStripButtonImport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.toolStripButtonImport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButtonImport.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.toolStripButtonImport.ForeColor = System.Drawing.Color.White; - this.toolStripButtonImport.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonImport.Image"))); - this.toolStripButtonImport.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripButtonImport.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonImport.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonImport.Name = "toolStripButtonImport"; - this.toolStripButtonImport.Size = new System.Drawing.Size(180, 40); - this.toolStripButtonImport.Text = "IMPORT"; - this.toolStripButtonImport.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripButtonImport.Click += new System.EventHandler(this.toolStripButtonImport_Click); - this.toolStripButtonImport.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.toolStripButtonImport.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.toolStripButtonImport.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // - // tSBEinstellung - // - this.tSBEinstellung.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.tSBEinstellung.AutoSize = false; - this.tSBEinstellung.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.tSBEinstellung.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tSBEinstellung.ForeColor = System.Drawing.Color.White; - this.tSBEinstellung.Image = ((System.Drawing.Image)(resources.GetObject("tSBEinstellung.Image"))); - this.tSBEinstellung.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBEinstellung.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tSBEinstellung.Name = "tSBEinstellung"; - this.tSBEinstellung.Size = new System.Drawing.Size(180, 40); - this.tSBEinstellung.Text = "EINSTELLUNG"; - this.tSBEinstellung.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.tSBEinstellung.Click += new System.EventHandler(this.tSBEinstellung_Click); - // - // toolStripBeenden - // - this.toolStripBeenden.AutoSize = false; - this.toolStripBeenden.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); - this.toolStripBeenden.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripBeenden.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.toolStripBeenden.ForeColor = System.Drawing.Color.White; - this.toolStripBeenden.Image = ((System.Drawing.Image)(resources.GetObject("toolStripBeenden.Image"))); - this.toolStripBeenden.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripBeenden.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripBeenden.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripBeenden.Name = "toolStripBeenden"; - this.toolStripBeenden.Size = new System.Drawing.Size(180, 40); - this.toolStripBeenden.Text = "BEENDEN"; - this.toolStripBeenden.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.toolStripBeenden.Click += new System.EventHandler(this.toolStripBeenden_Click); - this.toolStripBeenden.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); - this.toolStripBeenden.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); - this.toolStripBeenden.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); - // // panelMain // this.panelMain.AllowDrop = true; @@ -421,6 +153,48 @@ namespace Deckungsbeitrag this.panelMain.DragEnter += new System.Windows.Forms.DragEventHandler(this.panelMain_DragEnter); this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMain_Paint); // + // buttonNeuerStand + // + this.buttonNeuerStand.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); + this.buttonNeuerStand.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.buttonNeuerStand.FlatAppearance.BorderSize = 0; + this.buttonNeuerStand.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonNeuerStand.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonNeuerStand.ForeColor = System.Drawing.Color.White; + this.buttonNeuerStand.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.buttonNeuerStand.Location = new System.Drawing.Point(528, 5); + this.buttonNeuerStand.Margin = new System.Windows.Forms.Padding(5); + this.buttonNeuerStand.Name = "buttonNeuerStand"; + this.buttonNeuerStand.Size = new System.Drawing.Size(250, 41); + this.buttonNeuerStand.TabIndex = 65; + this.buttonNeuerStand.Text = "Neue Standveränderung"; + this.buttonNeuerStand.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.buttonNeuerStand.UseVisualStyleBackColor = false; + this.buttonNeuerStand.Click += new System.EventHandler(this.buttonNeuerStand_Click); + this.buttonNeuerStand.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); + this.buttonNeuerStand.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); + // + // buttonNeueInventur + // + this.buttonNeueInventur.BackColor = System.Drawing.Color.Green; + this.buttonNeueInventur.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.buttonNeueInventur.FlatAppearance.BorderSize = 0; + this.buttonNeueInventur.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonNeueInventur.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonNeueInventur.ForeColor = System.Drawing.Color.White; + this.buttonNeueInventur.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.buttonNeueInventur.Location = new System.Drawing.Point(268, 5); + this.buttonNeueInventur.Margin = new System.Windows.Forms.Padding(5); + this.buttonNeueInventur.Name = "buttonNeueInventur"; + this.buttonNeueInventur.Size = new System.Drawing.Size(250, 41); + this.buttonNeueInventur.TabIndex = 64; + this.buttonNeueInventur.Text = "Neue Inventur"; + this.buttonNeueInventur.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.buttonNeueInventur.UseVisualStyleBackColor = false; + this.buttonNeueInventur.Click += new System.EventHandler(this.buttonNeueInventur_Click); + this.buttonNeueInventur.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); + this.buttonNeueInventur.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); + // // buttonNeueAufgabe // this.buttonNeueAufgabe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); @@ -442,6 +216,27 @@ namespace Deckungsbeitrag this.buttonNeueAufgabe.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); this.buttonNeueAufgabe.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); // + // buttonNeuerAuftrag + // + this.buttonNeuerAuftrag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.buttonNeuerAuftrag.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0; + this.buttonNeuerAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonNeuerAuftrag.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonNeuerAuftrag.ForeColor = System.Drawing.Color.White; + this.buttonNeuerAuftrag.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.buttonNeuerAuftrag.Location = new System.Drawing.Point(8, 5); + this.buttonNeuerAuftrag.Margin = new System.Windows.Forms.Padding(5); + this.buttonNeuerAuftrag.Name = "buttonNeuerAuftrag"; + this.buttonNeuerAuftrag.Size = new System.Drawing.Size(250, 41); + this.buttonNeuerAuftrag.TabIndex = 56; + this.buttonNeuerAuftrag.Text = "Neuer Auftrag"; + this.buttonNeuerAuftrag.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.buttonNeuerAuftrag.UseVisualStyleBackColor = false; + this.buttonNeuerAuftrag.Click += new System.EventHandler(this.buttonNeuerAuftrag_Click); + this.buttonNeuerAuftrag.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); + this.buttonNeuerAuftrag.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); + // // buttonNeuerUser // this.buttonNeuerUser.BackColor = System.Drawing.Color.Yellow; @@ -768,27 +563,6 @@ namespace Deckungsbeitrag this.buttonAllUpdate.UseVisualStyleBackColor = false; this.buttonAllUpdate.Click += new System.EventHandler(this.buttonAllUpdate_Click); // - // buttonNeuerAuftrag - // - this.buttonNeuerAuftrag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.buttonNeuerAuftrag.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.buttonNeuerAuftrag.FlatAppearance.BorderSize = 0; - this.buttonNeuerAuftrag.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonNeuerAuftrag.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonNeuerAuftrag.ForeColor = System.Drawing.Color.White; - this.buttonNeuerAuftrag.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.buttonNeuerAuftrag.Location = new System.Drawing.Point(8, 5); - this.buttonNeuerAuftrag.Margin = new System.Windows.Forms.Padding(5); - this.buttonNeuerAuftrag.Name = "buttonNeuerAuftrag"; - this.buttonNeuerAuftrag.Size = new System.Drawing.Size(250, 41); - this.buttonNeuerAuftrag.TabIndex = 56; - this.buttonNeuerAuftrag.Text = "Neuer Auftrag"; - this.buttonNeuerAuftrag.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.buttonNeuerAuftrag.UseVisualStyleBackColor = false; - this.buttonNeuerAuftrag.Click += new System.EventHandler(this.buttonNeuerAuftrag_Click); - this.buttonNeuerAuftrag.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); - this.buttonNeuerAuftrag.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); - // // groupBoxAuftrag // this.groupBoxAuftrag.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -961,16 +735,6 @@ namespace Deckungsbeitrag this.groupBoxScannTest.TabStop = false; this.groupBoxScannTest.Visible = false; // - // pictureBoxScannTest - // - this.pictureBoxScannTest.Location = new System.Drawing.Point(6, 10); - this.pictureBoxScannTest.Name = "pictureBoxScannTest"; - this.pictureBoxScannTest.Size = new System.Drawing.Size(179, 160); - this.pictureBoxScannTest.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBoxScannTest.TabIndex = 14; - this.pictureBoxScannTest.TabStop = false; - this.pictureBoxScannTest.Visible = false; - // // textBoxScannTest // this.textBoxScannTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -1003,47 +767,305 @@ namespace Deckungsbeitrag this.labelScannTest.Text = "label1"; this.labelScannTest.Visible = false; // - // buttonNeueInventur + // tSBBenutzerVW // - this.buttonNeueInventur.BackColor = System.Drawing.Color.Green; - this.buttonNeueInventur.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.buttonNeueInventur.FlatAppearance.BorderSize = 0; - this.buttonNeueInventur.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonNeueInventur.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonNeueInventur.ForeColor = System.Drawing.Color.White; - this.buttonNeueInventur.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.buttonNeueInventur.Location = new System.Drawing.Point(268, 5); - this.buttonNeueInventur.Margin = new System.Windows.Forms.Padding(5); - this.buttonNeueInventur.Name = "buttonNeueInventur"; - this.buttonNeueInventur.Size = new System.Drawing.Size(250, 41); - this.buttonNeueInventur.TabIndex = 64; - this.buttonNeueInventur.Text = "Neue Inventur"; - this.buttonNeueInventur.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.buttonNeueInventur.UseVisualStyleBackColor = false; - this.buttonNeueInventur.Click += new System.EventHandler(this.buttonNeueInventur_Click); - this.buttonNeueInventur.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); - this.buttonNeueInventur.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); + this.tSBBenutzerVW.AutoSize = false; + this.tSBBenutzerVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBBenutzerVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBBenutzerVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBBenutzerVW.ForeColor = System.Drawing.Color.White; + this.tSBBenutzerVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBBenutzerVW.Image"))); + this.tSBBenutzerVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBBenutzerVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBBenutzerVW.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBBenutzerVW.Name = "tSBBenutzerVW"; + this.tSBBenutzerVW.Size = new System.Drawing.Size(180, 40); + this.tSBBenutzerVW.Text = "BENUTZERVERWALTUNG"; + this.tSBBenutzerVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBBenutzerVW.Click += new System.EventHandler(this.tSBBenutzerVW_Click); + this.tSBBenutzerVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBBenutzerVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBBenutzerVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); // - // buttonNeuerStand + // tSBAuftragVW // - this.buttonNeuerStand.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); - this.buttonNeuerStand.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.buttonNeuerStand.FlatAppearance.BorderSize = 0; - this.buttonNeuerStand.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonNeuerStand.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonNeuerStand.ForeColor = System.Drawing.Color.White; - this.buttonNeuerStand.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.buttonNeuerStand.Location = new System.Drawing.Point(528, 5); - this.buttonNeuerStand.Margin = new System.Windows.Forms.Padding(5); - this.buttonNeuerStand.Name = "buttonNeuerStand"; - this.buttonNeuerStand.Size = new System.Drawing.Size(250, 41); - this.buttonNeuerStand.TabIndex = 65; - this.buttonNeuerStand.Text = "Neue Standveränderung"; - this.buttonNeuerStand.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.buttonNeuerStand.UseVisualStyleBackColor = false; - this.buttonNeuerStand.Click += new System.EventHandler(this.buttonNeuerStand_Click); - this.buttonNeuerStand.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Button_MouseDown); - this.buttonNeuerStand.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Button_MouseMove); + this.tSBAuftragVW.AutoSize = false; + this.tSBAuftragVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBAuftragVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBAuftragVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBAuftragVW.ForeColor = System.Drawing.Color.White; + this.tSBAuftragVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBAuftragVW.Image"))); + this.tSBAuftragVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBAuftragVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBAuftragVW.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBAuftragVW.Name = "tSBAuftragVW"; + this.tSBAuftragVW.Size = new System.Drawing.Size(180, 40); + this.tSBAuftragVW.Text = "AUFTRAGVERWALTUNG"; + this.tSBAuftragVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBAuftragVW.ToolTipText = "Auftragkontrolle und -bearbeitung"; + this.tSBAuftragVW.Click += new System.EventHandler(this.tSBAuftragVW_Click); + this.tSBAuftragVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBAuftragVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBAuftragVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBAufgabeVW + // + this.tSBAufgabeVW.AutoSize = false; + this.tSBAufgabeVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBAufgabeVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBAufgabeVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBAufgabeVW.ForeColor = System.Drawing.Color.White; + this.tSBAufgabeVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBAufgabeVW.Image"))); + this.tSBAufgabeVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBAufgabeVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBAufgabeVW.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBAufgabeVW.Name = "tSBAufgabeVW"; + this.tSBAufgabeVW.Size = new System.Drawing.Size(180, 40); + this.tSBAufgabeVW.Text = "AUFGABENVERWALTUNG"; + this.tSBAufgabeVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBAufgabeVW.Click += new System.EventHandler(this.tSBAufgabeVW_Click); + this.tSBAufgabeVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBAufgabeVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBAufgabeVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBArtikelVW + // + this.tSBArtikelVW.AutoSize = false; + this.tSBArtikelVW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBArtikelVW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBArtikelVW.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBArtikelVW.ForeColor = System.Drawing.Color.White; + this.tSBArtikelVW.Image = ((System.Drawing.Image)(resources.GetObject("tSBArtikelVW.Image"))); + this.tSBArtikelVW.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBArtikelVW.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBArtikelVW.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBArtikelVW.Name = "tSBArtikelVW"; + this.tSBArtikelVW.Size = new System.Drawing.Size(180, 40); + this.tSBArtikelVW.Text = "ARTIKELVERWALTUNG"; + this.tSBArtikelVW.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBArtikelVW.ToolTipText = "Artikel bearbeiten"; + this.tSBArtikelVW.Click += new System.EventHandler(this.tSBArtikelVW_Click); + this.tSBArtikelVW.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBArtikelVW.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBArtikelVW.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // toolStripZaehlscheine + // + this.toolStripZaehlscheine.AutoSize = false; + this.toolStripZaehlscheine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.toolStripZaehlscheine.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripZaehlscheine.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.toolStripZaehlscheine.ForeColor = System.Drawing.Color.White; + this.toolStripZaehlscheine.Image = ((System.Drawing.Image)(resources.GetObject("toolStripZaehlscheine.Image"))); + this.toolStripZaehlscheine.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripZaehlscheine.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripZaehlscheine.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripZaehlscheine.Name = "toolStripZaehlscheine"; + this.toolStripZaehlscheine.Size = new System.Drawing.Size(180, 40); + this.toolStripZaehlscheine.Text = "KUNDENVERWALTUNG"; + this.toolStripZaehlscheine.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripZaehlscheine.ToolTipText = "Kunde bearbeiten"; + this.toolStripZaehlscheine.Click += new System.EventHandler(this.toolStripZaehlscheine_Click); + this.toolStripZaehlscheine.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.toolStripZaehlscheine.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.toolStripZaehlscheine.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBExpedit + // + this.tSBExpedit.AutoSize = false; + this.tSBExpedit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBExpedit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBExpedit.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBExpedit.ForeColor = System.Drawing.Color.White; + this.tSBExpedit.Image = ((System.Drawing.Image)(resources.GetObject("tSBExpedit.Image"))); + this.tSBExpedit.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBExpedit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBExpedit.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBExpedit.Name = "tSBExpedit"; + this.tSBExpedit.Size = new System.Drawing.Size(180, 40); + this.tSBExpedit.Text = "EXPEDIT"; + this.tSBExpedit.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBExpedit.Click += new System.EventHandler(this.tSBExpedit_Click); + this.tSBExpedit.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBExpedit.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBExpedit.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // toolStripDB + // + this.toolStripDB.AutoSize = false; + this.toolStripDB.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.toolStripDB.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDB.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.toolStripDB.ForeColor = System.Drawing.Color.White; + this.toolStripDB.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDB.Image"))); + this.toolStripDB.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripDB.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripDB.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDB.Name = "toolStripDB"; + this.toolStripDB.Size = new System.Drawing.Size(180, 40); + this.toolStripDB.Text = "DECKUNGSBEITRAG"; + this.toolStripDB.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripDB.Click += new System.EventHandler(this.toolStripDB_Click); + this.toolStripDB.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.toolStripDB.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.toolStripDB.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBKosten + // + this.tSBKosten.AutoSize = false; + this.tSBKosten.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBKosten.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBKosten.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBKosten.ForeColor = System.Drawing.Color.White; + this.tSBKosten.Image = ((System.Drawing.Image)(resources.GetObject("tSBKosten.Image"))); + this.tSBKosten.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBKosten.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBKosten.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBKosten.Name = "tSBKosten"; + this.tSBKosten.Size = new System.Drawing.Size(180, 40); + this.tSBKosten.Text = "KOSTENLISTE"; + this.tSBKosten.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBKosten.Click += new System.EventHandler(this.tSBKosten_Click); + this.tSBKosten.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBKosten.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBKosten.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // toolStripButton1 + // + this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.toolStripButton1.AutoSize = false; + this.toolStripButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.BackgroundImage"))); + this.toolStripButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Enabled = false; + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(180, 70); + this.toolStripButton1.Text = "toolStripButton1"; + // + // tSBScannTest + // + this.tSBScannTest.AutoSize = false; + this.tSBScannTest.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBScannTest.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBScannTest.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBScannTest.ForeColor = System.Drawing.Color.White; + this.tSBScannTest.Image = ((System.Drawing.Image)(resources.GetObject("tSBScannTest.Image"))); + this.tSBScannTest.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBScannTest.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBScannTest.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBScannTest.Name = "tSBScannTest"; + this.tSBScannTest.Size = new System.Drawing.Size(180, 40); + this.tSBScannTest.Text = "SCANN TEST"; + this.tSBScannTest.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBScannTest.Click += new System.EventHandler(this.tSBScannTest_Click); + this.tSBScannTest.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBScannTest.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBScannTest.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBHilfe + // + this.tSBHilfe.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.tSBHilfe.AutoSize = false; + this.tSBHilfe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBHilfe.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBHilfe.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBHilfe.ForeColor = System.Drawing.Color.White; + this.tSBHilfe.Image = ((System.Drawing.Image)(resources.GetObject("tSBHilfe.Image"))); + this.tSBHilfe.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBHilfe.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBHilfe.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBHilfe.Name = "tSBHilfe"; + this.tSBHilfe.Size = new System.Drawing.Size(180, 40); + this.tSBHilfe.Text = "HILFE"; + this.tSBHilfe.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBHilfe.Click += new System.EventHandler(this.tSBHilfe_Click); + // + // toolStripButtonImport + // + this.toolStripButtonImport.AutoSize = false; + this.toolStripButtonImport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.toolStripButtonImport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripButtonImport.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.toolStripButtonImport.ForeColor = System.Drawing.Color.White; + this.toolStripButtonImport.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonImport.Image"))); + this.toolStripButtonImport.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripButtonImport.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButtonImport.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonImport.Name = "toolStripButtonImport"; + this.toolStripButtonImport.Size = new System.Drawing.Size(180, 40); + this.toolStripButtonImport.Text = "IMPORT"; + this.toolStripButtonImport.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripButtonImport.Click += new System.EventHandler(this.toolStripButtonImport_Click); + this.toolStripButtonImport.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.toolStripButtonImport.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.toolStripButtonImport.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // tSBEinstellung + // + this.tSBEinstellung.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.tSBEinstellung.AutoSize = false; + this.tSBEinstellung.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBEinstellung.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBEinstellung.ForeColor = System.Drawing.Color.White; + this.tSBEinstellung.Image = ((System.Drawing.Image)(resources.GetObject("tSBEinstellung.Image"))); + this.tSBEinstellung.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBEinstellung.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBEinstellung.Name = "tSBEinstellung"; + this.tSBEinstellung.Size = new System.Drawing.Size(180, 40); + this.tSBEinstellung.Text = "EINSTELLUNG"; + this.tSBEinstellung.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBEinstellung.Click += new System.EventHandler(this.tSBEinstellung_Click); + // + // toolStripBeenden + // + this.toolStripBeenden.AutoSize = false; + this.toolStripBeenden.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.toolStripBeenden.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripBeenden.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.toolStripBeenden.ForeColor = System.Drawing.Color.White; + this.toolStripBeenden.Image = ((System.Drawing.Image)(resources.GetObject("toolStripBeenden.Image"))); + this.toolStripBeenden.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripBeenden.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripBeenden.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripBeenden.Name = "toolStripBeenden"; + this.toolStripBeenden.Size = new System.Drawing.Size(180, 40); + this.toolStripBeenden.Text = "BEENDEN"; + this.toolStripBeenden.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.toolStripBeenden.Click += new System.EventHandler(this.toolStripBeenden_Click); + this.toolStripBeenden.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.toolStripBeenden.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.toolStripBeenden.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); + // + // pictureBoxScannTest + // + this.pictureBoxScannTest.Location = new System.Drawing.Point(6, 10); + this.pictureBoxScannTest.Name = "pictureBoxScannTest"; + this.pictureBoxScannTest.Size = new System.Drawing.Size(179, 160); + this.pictureBoxScannTest.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBoxScannTest.TabIndex = 14; + this.pictureBoxScannTest.TabStop = false; + this.pictureBoxScannTest.Visible = false; + // + // tSBTourenplanung + // + this.tSBTourenplanung.AutoSize = false; + this.tSBTourenplanung.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.tSBTourenplanung.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tSBTourenplanung.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tSBTourenplanung.ForeColor = System.Drawing.Color.White; + this.tSBTourenplanung.Image = ((System.Drawing.Image)(resources.GetObject("tSBTourenplanung.Image"))); + this.tSBTourenplanung.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBTourenplanung.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tSBTourenplanung.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tSBTourenplanung.Name = "tSBTourenplanung"; + this.tSBTourenplanung.Size = new System.Drawing.Size(180, 40); + this.tSBTourenplanung.Text = "TOURENPLANUNG"; + this.tSBTourenplanung.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.tSBTourenplanung.Click += new System.EventHandler(this.tSBTourenplanung_Click); + this.tSBTourenplanung.MouseEnter += new System.EventHandler(this.toolStrip_MouseEnter); + this.tSBTourenplanung.MouseLeave += new System.EventHandler(this.toolStrip_MouseLeave); + this.tSBTourenplanung.Paint += new System.Windows.Forms.PaintEventHandler(this.get_Border_Paint); // // FormMain // @@ -1142,6 +1164,7 @@ namespace Deckungsbeitrag private System.Windows.Forms.Button buttonNeueAufgabe; private System.Windows.Forms.Button buttonNeueInventur; private System.Windows.Forms.Button buttonNeuerStand; + private System.Windows.Forms.ToolStripButton tSBTourenplanung; } } diff --git a/AA-Forms/FormMain.cs b/AA-Forms/FormMain.cs index 53578b0..ea3ca67 100644 --- a/AA-Forms/FormMain.cs +++ b/AA-Forms/FormMain.cs @@ -633,7 +633,7 @@ namespace Deckungsbeitrag break; case AuftragStatus.Aufgelegt: break; - case AuftragStatus.Finisching: + case AuftragStatus.Gewaschen: break; case AuftragStatus.Herrichten: break; @@ -960,14 +960,6 @@ namespace Deckungsbeitrag } } } - private void Button_MouseUp(object sender, MouseEventArgs e) - { - var btn = sender as Button; - if (!isDragging) - { - //btn?.PerformClick(); // oder der normale Click-Event-Handler wird aufgerufen - } - } /// /// Buttons auf MainPanel. Schnellzugriff für Neuer User und Neuer Auftrag. @@ -980,8 +972,6 @@ namespace Deckungsbeitrag neuerBenutzer.ShowDialog(); } - - /// /// Settings speichern bei Form_Closing. /// @@ -1022,6 +1012,13 @@ namespace Deckungsbeitrag } } + private void tSBTourenplanung_Click(object sender, EventArgs e) + { + this.Cursor = Cursors.WaitCursor; + FormTourenplanung tourenplanung = new FormTourenplanung(this.benutzer); + tourenplanung.ShowDialog(); + this.Cursor = Cursors.Default; + } } } //CHANGES: Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren. diff --git a/AA-Forms/FormMain.resx b/AA-Forms/FormMain.resx index d56ce45..8b79069 100644 --- a/AA-Forms/FormMain.resx +++ b/AA-Forms/FormMain.resx @@ -461,6 +461,17 @@ HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb 1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC nOccAdABIDXXE1nzAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEMSURBVDhPrZMxjoNADEVzpD1CRE9PzwW2pkpDzwEo0tEi + DkBPT09BSbORsCkneqM1yUxQtNLG0pdG/va3x+M5nT5p27adVbVVVRehhYvjA1PVapomV5alS9PUJUni + wRkfHDFxnjeIcRx9cJZlrmkaNwyDB2d8cIcitAZhleZ5vonIBT/gjK+qKtf3PQI/67p+PVdvSaQKgQH5 + ayLyvSzLXiQQYUgQXdc5qh0kXwBJds08zx/FEGBY3Pdo0vB1Xe8oisLHm8hnBP57hX2ILxN+iARDDIYd + PyMiVCQA2DPSIdc8LCIiV0hbJIJpF2HObxfJDBFbZVtjg60yMXFeYM+fiQ7Anz9TbDaD2B/bHero49g9 + VkT2AAAAAElFTkSuQmCC diff --git a/AA-Forms/FormNeuerAuftrag.cs b/AA-Forms/FormNeuerAuftrag.cs index 34d31ee..810e7e7 100644 --- a/AA-Forms/FormNeuerAuftrag.cs +++ b/AA-Forms/FormNeuerAuftrag.cs @@ -70,12 +70,10 @@ namespace Deckungsbeitrag // Kunde holen this.kunde = Funktionen.KundenAuswahl(); - - // ComboBox AuftragTyp wird geladen und richtiges Item selected. - comboBox_Load(); + // ComboBox AuftragTyp wird geladen und richtiges Item selected. // Falls KundenAuswahl null liefert wird Form geschlossen oder wenn Waschstrasse neu geladen. - if (this.kunde != null) DatenLaden(); + if (this.kunde != null) { comboBox_Load(); DatenLaden(); } else { // Wenn NICHT Waschstrasse dann Fenster schließen. @@ -86,7 +84,7 @@ namespace Deckungsbeitrag } this.dGArtikel.ForeColor = Color.Black; - this.dTPLiefertag.Value = DateTime.Today.AddDays(1); + //this.dTPLiefertag.Value = DateTime.Today.AddDays(1); this.textBoxKundeName.Enabled = false; this.textBoxKndNr.Enabled = false; @@ -205,6 +203,9 @@ namespace Deckungsbeitrag //AUFTRAG DATEN ÜBERGEBEN Auftrag.KundeID = (int)kunde.KundeID; + // Wenn Kundennummer ist Div.Barzahler(in FormListe wenn mit ? am Anfang) wird individueller Kundename als Zusatzinfo gespeichert. + if (kunde.KundeNummer == "2320000") Auftrag.ZusatzInfo = kunde.Suchtext; + //TODO: Überlegen ob das der richtige Weg ist. Eventuell in Expedit sowohl KundeAufgabe wie auch AuftragAufgabe anzeigen? NOTWENDIG? if (Auftrag.AufgabeID == null) { if (kunde.Aufgabe != null) Auftrag.AufgabeID = kunde.Aufgabe; } Auftrag.Liefertag = this.dTPLiefertag.Value; @@ -287,7 +288,7 @@ namespace Deckungsbeitrag case BenutzerRolle.Master: break; case BenutzerRolle.Expedit: - Auftrag.Status = AuftragStatus.Herrichten; + Auftrag.Status = AuftragStatus.Gewaschen; break; case BenutzerRolle.Frottee: break; @@ -525,4 +526,5 @@ namespace Deckungsbeitrag } } } -//CHANGES: NeuerAuftrag wird jetzt mit Propertie AuftragTyp aufgerufen. Dadurch ist die Auswahl des AuftragTyp konstanter. \ No newline at end of file +//CHANGES: NeuerAuftrag wird jetzt mit Propertie AuftragTyp aufgerufen. Dadurch ist die Auswahl des AuftragTyp konstanter. +//DONE: Fehler wenn FormListe mit X geschlossen wird und Kunde null ist wurde behoben. \ No newline at end of file diff --git a/AA-Forms/FormTourenplanung.Designer.cs b/AA-Forms/FormTourenplanung.Designer.cs new file mode 100644 index 0000000..127653f --- /dev/null +++ b/AA-Forms/FormTourenplanung.Designer.cs @@ -0,0 +1,119 @@ +namespace Deckungsbeitrag.AA_Forms +{ + partial class FormTourenplanung + { + /// + /// 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(FormTourenplanung)); + this.tabControlLKW = new System.Windows.Forms.TabControl(); + this.flowLayoutPanelKunden = new System.Windows.Forms.FlowLayoutPanel(); + this.comboBoxFilter = new System.Windows.Forms.ComboBox(); + this.buttonAddPage = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // tabControlLKW + // + this.tabControlLKW.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.tabControlLKW.Location = new System.Drawing.Point(206, 39); + this.tabControlLKW.Name = "tabControlLKW"; + this.tabControlLKW.SelectedIndex = 0; + this.tabControlLKW.Size = new System.Drawing.Size(594, 411); + this.tabControlLKW.TabIndex = 0; + this.tabControlLKW.SelectedIndexChanged += new System.EventHandler(this.tabControlLKW_SelectedIndexChanged); + this.tabControlLKW.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tabControlLKW_MouseDoubleClick); + // + // flowLayoutPanelKunden + // + this.flowLayoutPanelKunden.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.flowLayoutPanelKunden.AutoScroll = true; + this.flowLayoutPanelKunden.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.flowLayoutPanelKunden.Location = new System.Drawing.Point(0, 36); + this.flowLayoutPanelKunden.Name = "flowLayoutPanelKunden"; + this.flowLayoutPanelKunden.Size = new System.Drawing.Size(204, 414); + this.flowLayoutPanelKunden.TabIndex = 1; + // + // comboBoxFilter + // + this.comboBoxFilter.FormattingEnabled = true; + this.comboBoxFilter.Location = new System.Drawing.Point(0, 0); + this.comboBoxFilter.Margin = new System.Windows.Forms.Padding(5); + this.comboBoxFilter.Name = "comboBoxFilter"; + this.comboBoxFilter.Size = new System.Drawing.Size(204, 28); + this.comboBoxFilter.TabIndex = 2; + // + // buttonAddPage + // + this.buttonAddPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonAddPage.BackColor = System.Drawing.Color.Turquoise; + this.buttonAddPage.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.buttonAddPage.FlatAppearance.BorderSize = 0; + this.buttonAddPage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonAddPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonAddPage.ForeColor = System.Drawing.Color.Black; + this.buttonAddPage.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.buttonAddPage.Location = new System.Drawing.Point(647, 3); + this.buttonAddPage.Margin = new System.Windows.Forms.Padding(5); + this.buttonAddPage.Name = "buttonAddPage"; + this.buttonAddPage.Size = new System.Drawing.Size(150, 28); + this.buttonAddPage.TabIndex = 57; + this.buttonAddPage.Text = "Neues Fahrzeug"; + this.buttonAddPage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.buttonAddPage.UseVisualStyleBackColor = false; + this.buttonAddPage.Click += new System.EventHandler(this.buttonAddPage_Click); + // + // FormTourenplanung + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + 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.buttonAddPage); + this.Controls.Add(this.comboBoxFilter); + this.Controls.Add(this.flowLayoutPanelKunden); + this.Controls.Add(this.tabControlLKW); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ForeColor = System.Drawing.Color.White; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "FormTourenplanung"; + this.Text = "TOURENPLANUNG"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormTourenplanung_FormClosing); + this.Load += new System.EventHandler(this.FormTourenplanung_Load); + this.Shown += new System.EventHandler(this.FormTourenplanung_Shown); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabControlLKW; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelKunden; + private System.Windows.Forms.ComboBox comboBoxFilter; + private System.Windows.Forms.Button buttonAddPage; + } +} \ No newline at end of file diff --git a/AA-Forms/FormTourenplanung.cs b/AA-Forms/FormTourenplanung.cs new file mode 100644 index 0000000..a1809a1 --- /dev/null +++ b/AA-Forms/FormTourenplanung.cs @@ -0,0 +1,204 @@ +using DatenDB; +using Deckungsbeitrag.AA_Klassen; +using Deckungsbeitrag.UserControls; +using Microsoft.VisualBasic; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Deckungsbeitrag.AA_Forms +{ + public partial class FormTourenplanung : Form + { + private Benutzer Benutzer; + + #region Form-Konstruktor + public FormTourenplanung() + { + InitializeComponent(); + } + + public FormTourenplanung(Benutzer benutzer) : this() + { + this.Cursor = Cursors.WaitCursor; + this.Benutzer = benutzer; + + LadeAlleTabs(); + + // Controls steuern nach BenutzerRolle + switch (this.Benutzer.Rolle) + { + case BenutzerRolle.Verwaltung: + break; + case BenutzerRolle.Fahrer: + this.buttonAddPage.Enabled = false; + break; + case BenutzerRolle.Admin: + break; + case BenutzerRolle.Waschstrasse: + this.buttonAddPage.Enabled = false; + break; + case BenutzerRolle.Master: + break; + case BenutzerRolle.Expedit: + this.buttonAddPage.Enabled = false; + break; + case BenutzerRolle.Frottee: + this.buttonAddPage.Enabled = false; + break; + case BenutzerRolle.Flach: + this.buttonAddPage.Enabled = false; + break; + default: + break; + } + } + + #endregion + private void FormTourenplanung_Load(object sender, EventArgs e) + { + List kundenliste = Kunde.GetKundenTourenListe(); + + // Kunden hinzufügen + foreach (Kunde kunde in kundenliste) + { + // Wenn kein Suchtext vorhanden, dann KundeName verwenden. + KundenControl control = new KundenControl(kunde.Suchtext == string.Empty ? kunde.KundeName : kunde.Suchtext, kunde.Region); + control.Tag = kunde; + flowLayoutPanelKunden.Controls.Add(control); + } + + // Breite des Panels anpassen damit die kompletten KundenControls sichtbar sind. +25 = ScrollBar Breite. + this.flowLayoutPanelKunden.Width = flowLayoutPanelKunden.Controls[0].Width + 25; + this.tabControlLKW.Location = new Point(this.flowLayoutPanelKunden.Right, this.tabControlLKW.Location.Y); + } + + + + #region TabControl-Funktionen + // 1. TabPage wird hinzugefügt. + private void buttonAddPage_Click(object sender, EventArgs e) + { + UCTabPageLKW uc = new UCTabPageLKW(); + TabPage tp = new TabPage("Neue TabPage"); + uc.Dock = DockStyle.Fill; + tp.Controls.Add(uc); + this.tabControlLKW.TabPages.Add(tp); + } + // 2. Umbennen mit DoppelClick starten + private void tabControlLKW_MouseDoubleClick(object sender, MouseEventArgs e) + { + if(this.Benutzer.Rolle == BenutzerRolle.Admin || this.Benutzer.Rolle == BenutzerRolle.Verwaltung) + { + for (int i = 0; i < tabControlLKW.TabCount; i++) + { + Rectangle r = tabControlLKW.GetTabRect(i); + if (r.Contains(e.Location)) + { + string altText = tabControlLKW.TabPages[i].Text; + string neuText = PromptForText("Tab-Namen ändern", "Neuer Name:", altText); + if (!string.IsNullOrWhiteSpace(neuText)) + tabControlLKW.TabPages[i].Text = neuText; + break; + } + } + } + } + // 3. Öffnet Fenster mit Texteingabe für neuen Name + private string PromptForText(string titel, string prompt, string defaultText) + { + return Interaction.InputBox(prompt, titel, defaultText); + } + private void tabControlLKW_SelectedIndexChanged(object sender, EventArgs e) + { + if (tabControlLKW.SelectedTab.Controls.Count == 0) + { + UCTabPageLKW uc = new UCTabPageLKW(); + uc.Dock = DockStyle.Fill; + tabControlLKW.SelectedTab.Controls.Add(uc); + } + } + private void SpeichereAlleTabs() + { + var alleTabs = new List(); + + foreach (TabPage tab in tabControlLKW.TabPages) + { + if (tab.Controls[0] is UCTabPageLKW uc) + { + alleTabs.Add(uc.SpeichereDaten()); + } + } + + string json = JsonSerializer.Serialize(alleTabs, new JsonSerializerOptions + { + WriteIndented = true + }); + File.WriteAllText("lkw-touren.json", json); + } + private void LadeAlleTabs() + { + if (!File.Exists("lkw-touren.json")) return; + + try + { + string json = File.ReadAllText("lkw-touren.json"); + var tabDaten = JsonSerializer.Deserialize>(json); + + // Bestehende Tabs löschen + tabControlLKW.TabPages.Clear(); + + // Jede Fahrzeug-Tab laden + foreach (var tabData in tabDaten) + { + // Neuer TabPage + TabPage tabPage = new TabPage(tabData.FahrzeugName); + + // UserControl erstellen + UCTabPageLKW uc = new UCTabPageLKW(); + uc.Dock = DockStyle.Fill; + + // DATEN laden! + uc.LadeDaten(tabData); + + // UC zum Tab hinzufügen + tabPage.Controls.Add(uc); + tabControlLKW.TabPages.Add(tabPage); + } + + MessageBox.Show($"Geladen: {tabDaten.Count} Fahrzeuge"); + } + catch (Exception ex) + { + MessageBox.Show($"Fehler beim Laden: {ex.Message}"); + } + } + + + #endregion + + private void FormTourenplanung_FormClosing(object sender, FormClosingEventArgs e) + { + SpeichereAlleTabs(); + + } + + private void FormTourenplanung_Shown(object sender, EventArgs e) + { + this.Cursor = Cursors.Default; + } + } +} +//DONE: Testen ob umbenennen funktioniert. +//TODO: Max Clones von PanelKunde zu PanelTourenplanung. (Lieferrythmus eingeben?) +//TODO: Speichern der Touren ermöglichen. Eventuell über .json oder .xml Datei? +//TODO: Filter für Regionen ermöglichen. +//TODO: Funktioniert mehrere KundenControls auf einmal DragDrop? \ No newline at end of file diff --git a/AA-Forms/FormTourenplanung.resx b/AA-Forms/FormTourenplanung.resx new file mode 100644 index 0000000..4b0fe78 --- /dev/null +++ b/AA-Forms/FormTourenplanung.resx @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAAAAAAAEAIAC5FQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAAAFv + ck5UAc+id5oAABVzSURBVHja7Z0LuFVVtcfPOqCg4gMFVDQhsHyics4GfBUIPsMywULt4Ytz4CqSWV5R + UwnsZpaZ0c23XtNKI/JVGT5BTbtqiqX5SMRXGnI1LdBjiNwx9h57sfY6a5+91jl77b3WXr/f9/0//Pz4 + Ps4Zc8wx5xpzzDmamgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgTpxRbYECgIxNeoJBQgcBsGFM9tpEtKdo + quhc0VzRaaJPiwZjw9oNxEDRSNF40SdFO4k2ZABC26+faGezndpwD9EW2K+svdQ2x4vuEv2faI1orUfv + ih4XzRBtjP/FNxDqtOeJHhG9Keow4/9NdJvoy35Hxn4l2ko03Rz5NbNdh9nyQdHpoo9l2X4+e20kOkJ0 + r+jfvkkfpNWiy0Sb4X/VddyhonNESysMgA7S7aJWnLhEm1lwfEj0QQUbPiWaImrOiv0C7NVbNE40X7Qy + xMT3SncHZ4scgkDPB2KQbaueiDgI+vdbsjYAAfbbQPQZ0e9spQ9rP90RHJOFIBpgs91EPxatiOhzXr3i + XYSge8mWL4geCLFilZM6/YAsDEKA/dYTjRXdIPpXN+33kmhMI9rPGT4hyGYfFc0WvdiDie/VlaL1CQLR + HLevaKLoN6L3ejgA+j02s9FXMZ/9HEvoXdLDFayoG2wX0TD2C/A5XSRO7MYus5LeEh1AAAg3EPrNtY/o + p6J3qjgIf7bI3nirWGdH3l70X6KXq2i/f9knREPYLyDB9znRIlss1sagWzgVqLxi7S76kWh5TIMwu5F2 + AQETfxvR10VPx2S/36U5q13m80iPPheIVsVkM+/x4FGcSgUPxDDRnCp+c5XTMtGuaR+AAPv1t7PphwPO + paupDm9CMOU208+jS+0sf22N9IAls7MZAMqcRX/VjptqNQgXi3o1yCqmW9dJdpb/fo3s95CNWyrsVybB + N8cSm2trLE1ifyVzAaDMWbSuJH/oQWa/u/q7aO80DUKA/TSjPEH0y26cTVfDiU9Juv3KVIzqMfKf6jDx + vXpSNDwTQaDMWfRhooURz6KrretEfdIwCD77aUFOzo6V3qyzEw9Lov3KlDp/XnRfjAm+qDqvoYuDyiRb + tJrqxh6cRVdTerpwSFIHoMylnB1EF1ipcxKc+JtJSmh1sUu6yRJwaxOklxu2OCggsz/Ski0rEjYIt1mR + UaIGIcCRtxWdIXo2YfZbZpVydbVfgL2KPndZnXdJlXSFLYyNEQQCBkIvknzbSiGTOAAlxzIJtJ8WpUwT + PSb6MKE2nFdMqCboNGlulesf4pIWB+2f+gBQ5ixa70U/k4JBuM+SQ00JcuKN7Zt1UchbZ/XUcivaqqn9 + ytwTmWm5ibUp0s2pLQ4KGITN7XGER2I+i66mVlvpZ10GIOCb9UBzilUpcuLrrWw7dhuWSfAdKbq/DqdJ + 1dqFHpm64qCAs+jJortTsGIFaYlou1oOgM9+vexlmf8RvZ1C+2lC9VNx2y8gWO5vwfLdFNrMq/tTURzk + 5Mz4uU5Z1gV1OIuupvT7+qxaRGGf/VS7iC4SvZ5yJ/51XAnVgARfiyXQ3ky5zby70JMTHQDyTrsuAOhl + nX1FV1sioxEG4Xl7YSiWQcjbrtVsOCb/b3zc7iUsbRD76W3No6tpv4Dt/nC74PRKg9gs+XUVeYcd2Vb8 + s9nOLhsp+np1YbVfvinZNY3O/7md7Taeb0D73V+VhGpre1NTriBPBZ9WHv6lAW2W0OIgHYQWzyDk8iuW + FqG82sADoO/ija7KAIj9eo0+If+n7Z62sGTjkgQf6VVjK3tSjz6l1O9cTW+2T8y7U5rg686jKyPrGwC8 + A5DL/7ml/DCnip7LwACorunxyy0lTty+odhRL+sszogT60MaQyLbr9Rmqh3Ebt9NYPFY3Lq8PsVBnQeg + v+gYWbkeTNGRXv1ebulsv/VF48WJf5HyBGl3Eqpnh7ZfZ7sNEZ0pei5jE9/7/uKE2gYA/4rV2j5JdIc4 + b0dGB+FXdr7cHSduFo0RXSV6M6P2W1oxodp54g8UnSR6QvShLDxrM2q7tXZ3oV/8QaDzirW/aIFolSjL + A7DKnofqegA6O/EuootEr+ftl20n/n4xoVrBZpuJviT6vegDtZssPFm2W7E4aEo8AaDzAPQS7Sm6RvRW + fgAYBNU93qYiFWw4TDRbtNS1X2vm7fdaySvCnW2mO83DRQtFHSV2y3bgjLlEvXQQdhP9sLhiMQidmoq0 + lQxAZyceLPqa6Cm//QigbkK1jy8A6E5zgu00V3ayG4HTe6IyI64AsL3oPNFLQQNAAHD1qF3FLZ6IFDVA + NFX0qH6vYr+y+ofdbSjuNFtEl4heK2c3AkDcr1i3ts8QLbbtfgeDULGt0+meANBXdJBovjnxu6I1BICK + t936iU22sS3/saLjRaeJLhc9qMlSfK+s5lS3OKiQ6BsvOtgG43zRXaLlOHCgnrGyXbXdtqL9bAurdpwi + Osu2sy+4SSzs509ofa5pk1nljkr1M+pQ0RWivxEAAouD9qhmAAhKAuoRzIEWkclgd9b5mtFuaml3Auyn + /29jUU50rugv+e0tOQCv7i0mVAPsV9QGogNEvxbbvY/NSnRp9YqDyg9AcRAmiu6RQViD4UuaO7Z0kdH2 + BtM9rAZgJXYrSai2B5YIBydWL0zZewhxS/sWjI+vLiD4WEszuETiMCWane23qX7jyi5qBXZz9cdiQjXQ + iUvt18/qCFiESovTNoq3OKh0EAbJLuCqBr640p0ovF/o6rYW+b7Ntc90qtvbMO0lwrPC2M9uUA6224XY + LkpxWtWCQOE6pl5d/T3GdzVftGGEEte+9mgmtitI6/t3qGQ/z6fCERm7R1FJi2rzfqUOQos7CIezirnS + fgafDVUivO4uu3bp/RO2c/WdSm8ueAKABtsbsVnwdevaPP9VqOS6CuO7usMJ0x1Xg2ira8MTyKe40vck + cpXs5wkCnxS9gd1c6WIytDZBYN0gjHKS042m3tKJfFyYAfAEUe3cexe2c+U2xAjhf735jAosDqppANAt + 23cxvCttaLp1qCCwzoaT+J4tufO+X4RdwAjRC9jN1Yui3WsdBHYU/RXj5/WBvZIUJQDoEc4vsV34hKpT + +iDo2disRJe4x9K52gWBMzgWdKUPVA6PGATGO435mGp3tNISzE0hg4CeSD2O3UqOpfMvVzWPmlpIPNcg + AOggPIbxXc0Nc1HDKe2QfCV2c3Wn5UfC2m+ak87GM3Fpoaz+m+d3AMWj5xoEgelOcnqsp+ZbzGO/nNPY + LytHTageHyEA6H2Cu7Gb51gw13ZmU8u03iX1JzEHAO1Yuxjju/pvy1SHdWJNqF6A3Vw9bFV/Ye03yeox + sF1BK5py7e35ylN/SXqMQWCKk/5+bNWSnlF/IuIuYEcnO8+sh3lz4WsRcgEUB/kkAWCFTPhv5Mv3gy6p + xRAAtJ3xLRjf1c+cEN1xfVntWSRUSxKq20csDuKilTcItLa/J7pFdIhepip7Y7WKQeBge/KJARjV9k/R + oRF3AR8hoVqib1VKqHpsp59cP8JmJbuA4mM++p7Hz+yl5V2sv0cfkeYJ1qtmANAS4WsxvqvfijaNGASm + k9WO9vINxUEVA0BR+rT/s6Lb7cXveaI51f4U2Ev0dwYgL+2O+6WIAWCA3fDCfuuKW3pHKA46h8+osgHA + q3dEP8k/Z1flANBLdDED4EqvTg+KmAsgoerJaIdJqHpsN8QpNFslAAQHgHctL3CwPWgbS0JwV6dxetxX + o0T45Ii7ABKqpfq5aIOIxUGZr0vxTfzV9vL3lE4JwRgCQHErhvNGvK7psd+BJFRLEqqfjlgcdE+mbZZz + A4D2WnhMNN16V9SsLmAoj16U6JxK59o+G5JQLdXtYRKqHhtPzvJNS5v8fxWdIfpI7BO/zCCcbFtgHLiQ + nd414i5gT9Hr2C6vjjAJVV9x0C8yuvprL4XviXas6cQPGIQtHd4P9OoHliQN68T6dy/Cbq4eNJ8Ka7+x + GSsOelcmv2b2RzW15FvS13bil8kFfNGOw3DgwvHoXhF3Abtwtl2SUJ0ZoUS4t93LyEqe6ctOa1vfkp6V + 9cIzCJtaQQwOXNC19n0fJQhwtr1OoZpj+oqDljWwPV6xismPFh8Cif0tgG4EgUMtk4sDFzL7B0cMACRU + SzU7Yl3FuQ1oA31ERt9RbPGWS8f+HFg3A0BfuxyD8xZ0q531R3HiGZxtu1pmK3sWi4O0QEw7Ak1wPF2p + EjXxywzCJxyecvYO4pERdwFaTfgAtnN1caWEqi+Apv3RmtX25oZWifbz/W5NiSWjCZkwWmx1/1GCwBfs + OAz7FRKqe0csDro3xXkP3QEOTMWk72IQ9rAbXjhwIaJPjxgANiGhWqLrwiRUU1wcpHNljjfpmbrJ7xsA + TVach+O60rv/20UMAhMd2rIV9bbokAgBQJ9hn5+C30tf973UFkwn1ZM/YBCG22svOHDhaO/MiAFAE6o/ + xXaubouYUE1ycZB2+13gFBqkrJf6Sd/FIJzq0Oe9KG2sslPEILAvCdWShOpRKS8OWm1vQBxhu5Smhpv8 + vkHQF1//F+d1pS3WmiOsYjx/1TmhOjCC/XZzCs+3J+Fnf8IpdPcd0LATv8wgaDNNuuMWpE1WR0XcBSTJ + iZOwgp4Y0X71Lg560QqahmZi4gcMgHZ/uRPndaXt1teP4MSaHJqL3VwtCZNQ9VVX1qM4SPMPP3Y8zWMy + MfHLDMLhDt1xvaWdEyKuYppQfQrbuQnVs8JMKM/f+Y8aFgetshOIcY7njcNMTfwyd7bn47yufuVNAoUs + Ef4qCVVXz4t2Tlhx0L/t35jseDofZ3LilxmE8XbuiQMXVonJEXcBW5NQLdGFEROqR8S4C11iu4wBmd3u + hxgAPe+8HMd1pY0uN48YBI4loerqNdHoOhcHLbMr3EOY+OEcuNWhO25ROpGnurbJhXJiTajege1cXe0m + VMPZb1yVioPesBqDEUz8aEFAM9rfwXFd/dEptAnr0oF9TvxZhw653jcXDsrbZUxb2ccxfLvQnhQHrbT3 + B8dmPsHXg13ADqJncV43oz3bGdHmVHraiUcwu3hFOCc7o1xbWPvtaLfuoib49JNtkj/Bx+SPHgBUp/P0 + ledbNtd2QPPoqU0RgsA4EqqeyZlrm9U0cnqvrh7H9PnfASHvqayxi1zT7CSBiV+lILCtbX9x4MLzzo9r + 77b19zq24tPOnq3sZdhuXdGNNcToGyEIjLCbeMssH/OhabXVatwnOsX9RGPiVz0ItDt0x/U2eHhGdJxo + 0676u/sSqq9gO7Nfrv1NsdG3RNuFtF/xrsXHRIfZQxwn20s8OdFmTPx4A0CaX26Jw4E1CPxDdK1oXKe+ + bl7l2pvsDPx8bOfuotR+74vuFh0lGihyytqwZZo/GHQpiCcIfN6KYnDgXEmTx1dFN4imiUbbqqb93jYX + bS0qrk4fJ6Fasosq6m3RXdYua7xouGiQqL9oS/vv5kQ8qZ3xAKCPHt6E83Zy4KI6RK9Y08dFop+LjrFA + ULThf1IiXNZ+H4jeEP1ZdL/oVgsKw+reUIMgQHfcLnYAQb3ebxYdWEx06bGXJ6H6KAGgS/upHhadINqi + bq20IDAAaCXXNQSAQAfWb9o7RYeLNvJ/x3ps2EZCtWwAeFJ0imirujTQhFBBYIzVdmc9CVjUGtEjtmL1 + L+e4voTqPQTQEhu+KJpbst1n4ic2AGjjh++zeuX1tOjrosFhHNd3220VAbR9uWieaDcmfrqCwM52zzur + zvuynWNvH8Vxfbfdbsrw6v+O6HrRPqJeTP70BQDV2Rl0Xq1iu0Q0MvDcOpoNtcT1rYzZ8D2x029FEztV + AjLxUxcEhtjrqZlwXH0ZSFb/sU0t7b174rS+hOrVGZr8j0gA/aLYbBMmfuMEgZOcxu6O+4HoQdHRMvn7 + ubfYeui4GUuoPp9/FzDXNrhov0q3ASE9AUC7497foI77pGimOOugfHlpoaS32vZrtueyGtF+r+eTxbm2 + nZy9Cr9v/gJVjonfaEHgaNsiN4rjPmX5jaHFxz+c1sqPgPTAfjs1WEL1dXtObrTYrTlvv1z17QfJCQDa + Hfc3DeC42hRijj3rXfjdWuK9XOKx4Tca4M0FbQp6rWgvOypuYvJnJwh8yklvd9zlonnW1cep5a0yX0J1 + SUrtp30Ab7XnvvpwMy+bAUC7416fMsd9x37mfdwVq8aO6/s3T0xZQlXLmRfbnfyNmfgEgX1tNU3DkZ5+ + sky0wFVXx/X82wNTklDVT5XH7W39gUx8AoD3xZZ5CXZcXV0fsKTlJklyXM/PcZRtqZPcNv1Mnt6Ccg48 + wkled9wPrWBphh1bJs5xfQnV2xI48bVT8vfsxIKJD1068ZwEOe5SO9JLfDcYX0L17YTYT0uVtUPyKG9r + LyY+dOXAw6yIpt5n0Rd5m1Im3XF9CdXr6mw/baqxwCl0Rl6PVR+iZrRPsTLaenSf0QdL9qxXZr9KNty7 + TgnVYlONyd6OyEx8iOrAW4keqnEH35vtybI+aXZaz5sLP6yh/dbkL+uMajvB2wSViQ89CQLHiDpqsGIt + sheL+zWC4/oSqi/UYPI/LTpNtA0TH6rpwPoc9sIYM/vFNlAN1efd97t8M8aJ/7Lo29Zsg4kPsTixdnH5 + Z5Ud9znRLHthtyEdN+aE6gprszWy1qXPkL0AoN1Zb6yS474qusA6Fjf0iuX7/b5SpYSqtim/wdplk9mH + mjnxPnYs113H1eaPV1gPuMycRfveXFjUA/t12KfYZ0QbMPGh1g6s28xTu/FmgJ5FzxeNz+qK5fl99xO9 + 1I3XjB6yZCzNM6GuDtw3/yxUuEcwtf3znaJJWT+L9v3uh0XoLfik1WJsxcSHpDhwb7uBt7DM2wEr7Tbc + caL+OG6gDfXNgivtk2pNwJGoHunNtuQh9oPEOXDxwstY+yzQBiM/sKz+QdY1B8ft2ob6mvDuonZrOT7P + jgunuM+YYT9IQSCgx3uMNgRInTMD9gMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgJD8PyK+P6C0d3u7AAAAAElFTkSu + QmCC + + + \ No newline at end of file diff --git a/AA-Forms/FormWSVerfolgung.cs b/AA-Forms/FormWSVerfolgung.cs index be78f4d..bc49fd0 100644 --- a/AA-Forms/FormWSVerfolgung.cs +++ b/AA-Forms/FormWSVerfolgung.cs @@ -438,9 +438,3 @@ namespace Deckungsbeitrag.AA_Forms } } } -//DONE: Statt Neuen Auftrag wird Auftragsliste mit Status "abgeholt" angezeigt. Dadurch muss Aufleger weder scannen noch Namen eintippen und suchen. -//DONE: Auch wenn Extra Auftrag benötigt wird funktioniert es über die Auftragsliste. -//DONE: Wenn kein Auftrag gefunden wird, kann ein neuer erstellt werden. -//CHANGES: Aufleger muss keine Aufträge mehr erstellen da Fahrer das machen können. -//CHANGES: Wenn Auftrag nicht gefunden kann er trotzdem einen neuen Erstellen. -//CHANGES: Auftragsliste zeigt hier nur AuftragStatus "Abgeholt" Aufträge. \ No newline at end of file diff --git a/AA-Klassen/Aufgabe.cs b/AA-Klassen/Aufgabe.cs index 097cf0c..7ed8da3 100644 --- a/AA-Klassen/Aufgabe.cs +++ b/AA-Klassen/Aufgabe.cs @@ -135,4 +135,3 @@ namespace DatenDB } } } -//INSTALL-REMINDER: Spalte Aktiv in DB einfügen. diff --git a/AA-Klassen/Auftrag.cs b/AA-Klassen/Auftrag.cs index cd5c5b3..c54d209 100644 --- a/AA-Klassen/Auftrag.cs +++ b/AA-Klassen/Auftrag.cs @@ -2,17 +2,22 @@ using Npgsql; using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DatenDB { - public enum AuftragStatus + #region Enums + /// + /// Enum AuftragStatus + /// + public enum AuftragStatus { Abgeholt = 0, Aufgelegt = 1, - Finisching = 2, + Gewaschen = 2, Herrichten = 3, Vorbereitet = 4, Fertig = 7, @@ -32,16 +37,67 @@ namespace DatenDB Standverminderung = 4 } - - public class Auftrag + public enum AbteilungsStatus { - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 - public const string COLUMNS = "auftrag_id, benutzer_id, aufgabe_id, kunde_id, zusatz, liefertag, gedruckt, gedruckt_von, erledigt, erledigt_von, erstellt, erstellt_von, status, tour_id, container_dirt, maschine_id, container_clean, typ, aufgabe_erledigt"; - private const string TABLE = "kundenverwaltung.auftrag"; + Keine = 0, + Frottee = 1, + Kleinteile = 2, + Großteile = 4 + } + + #endregion + + public class Auftrag + { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + public const string COLUMNS = "auftrag_id, benutzer_id, aufgabe_id, kunde_id, zusatz, liefertag, gedruckt, gedruckt_von, erledigt, erledigt_von, erstellt, erstellt_von, status, tour_id, container_dirt, maschine_id, container_clean, typ, aufgabe_erledigt, abteilungen_status"; + public const string ACOLUMNS = "a.auftrag_id, a.benutzer_id, a.aufgabe_id, a.kunde_id, a.zusatz, a.liefertag, a.gedruckt, a.gedruckt_von, a.erledigt, a.erledigt_von, a.erstellt, a.erstellt_von, a.status, a.tour_id, a.container_dirt, a.maschine_id, a.container_clean, a.typ, a.aufgabe_erledigt, a.abteilungen_status"; + private const string TABLE = "kundenverwaltung.auftrag"; public const string ASPECTS = "FahrerID,AufgabeID,KundeID,ZusatzInfo,Wann,Gedruckt,Erledigt,Erstellt von,Erstellt Am"; + static bool isExpedit = false; public Auftrag() { } + #region async Tasks + public static async Task> GetAuftragListTodayAsync(DateTime produktion, NpgsqlConnection conn, AuftragTyp typ) + { + List resultList = new List(); + isExpedit = true; + using (var command = new NpgsqlCommand()) + { + command.Connection = conn; + command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext FROM {TABLE} a left join kundenverwaltung.kunde k on a.kunde_id = k.kunde_id WHERE typ = {(int)typ} AND erstellt::date = @produktion OR typ = {(int)typ} AND status < 7 ORDER BY liefertag ASC"; + command.Parameters.AddWithValue("@produktion", produktion.Date); + + using (var reader = await command.ExecuteReaderAsync()) + { + while (await reader.ReadAsync()) + resultList.Add(new Auftrag(reader)); + } + } + + return resultList; + } + public static async Task> GetExpeditListsAsync(int? typ, NpgsqlConnection conn) + { + List resultList = new List(); + isExpedit = true; + using (var command = new NpgsqlCommand()) + { + command.Connection = conn; + command.CommandText = $"SELECT {ACOLUMNS}, k.name1 as kunde_name, k.suchtext as suchtext FROM {TABLE} a left join Kundenverwaltung.kunde k on a.kunde_id = k.kunde_id WHERE typ >= @typ AND status < 7 ORDER BY status DESC, liefertag ASC"; + command.Parameters.AddWithValue("@typ", typ ?? 0); // Parameterized + Null-Handling + + using (var reader = await command.ExecuteReaderAsync()) + { + while (await reader.ReadAsync()) + resultList.Add(new Auftrag(reader)); + } + } + + return resultList; + } + #endregion public static List GetFinishingList() { @@ -50,7 +106,7 @@ namespace DatenDB NpgsqlCommand cmd = new NpgsqlCommand(); cmd.Connection = DatenbankConnection.GetConnection(); - cmd.CommandText = $"select {COLUMNS} from {TABLE} where status = 1 order by liefertag asc"; + cmd.CommandText = $"select {COLUMNS} from {TABLE} where status = 2 order by liefertag asc"; NpgsqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) resultList.Add(new Auftrag(reader)); @@ -58,7 +114,6 @@ namespace DatenDB DatenbankConnection.GetConnection().Close(); return resultList; } - public static List GetRampeAuftragList() { DatenbankConnection.GetConnection().Open(); @@ -74,7 +129,6 @@ namespace DatenDB DatenbankConnection.GetConnection().Close(); return resultList; } - public static List GetAuftragList(string s, Auftrag auftrag) { int? aID = null; @@ -110,9 +164,9 @@ namespace DatenDB DatenbankConnection.GetConnection().Open(); List resultList = new List(); NpgsqlCommand command = new NpgsqlCommand(); - command.Connection = DatenbankConnection.GetConnection(); + command.Connection = DatenbankConnection.GetConnection(); - command.CommandText = $"select {COLUMNS} from {TABLE} where typ = 1 and erstellt::date = '{produktion.Date}' or typ = 1 and status < 7 order by liefertag asc"; + command.CommandText = $"select {COLUMNS} from {TABLE} where typ <= 1 and erstellt::date = '{produktion.Date}' or typ <= 1 and status < 7 order by liefertag asc"; NpgsqlDataReader reader = command.ExecuteReader(); while (reader.Read()) resultList.Add(new Auftrag(reader)); @@ -151,21 +205,6 @@ namespace DatenDB DatenbankConnection.GetConnection().Close(); return resultList; } - public static List GetExpeditLists(int? typ) - { - DatenbankConnection.GetConnection().Open(); - List resultList = new List(); - NpgsqlCommand command = new NpgsqlCommand(); - command.Connection = DatenbankConnection.GetConnection(); - - command.CommandText = $"select {COLUMNS} from {TABLE} where typ >= {typ} and status < 7 order by status desc, liefertag asc"; - - NpgsqlDataReader reader = command.ExecuteReader(); - while (reader.Read()) resultList.Add(new Auftrag(reader)); - reader.Close(); - DatenbankConnection.GetConnection().Close(); - return resultList; - } public static Auftrag GetAuftrag(int? auftragID) { DatenbankConnection.GetConnection().Open(); @@ -233,25 +272,107 @@ namespace DatenDB this.ContainerClean = reader.IsDBNull(16) ? 0 : reader.GetInt32(16); this.Typ = reader.IsDBNull(17) ? AuftragTyp.Standart : (AuftragTyp)reader.GetInt32(17); this.AufgabeErledigt = reader.IsDBNull(18) ? false : reader.GetBoolean(18); + this.Abteilungen = reader.IsDBNull(19) ? AbteilungsStatus.Keine : (AbteilungsStatus)reader.GetInt16(19); + + if (isExpedit) + { + this.Kundename = reader.GetString(20); + this.Kundename = reader.IsDBNull(21) ? this.Kundename : reader.GetString(21); + if (this.Kundename == "BAR DIVERSE") this.Kundename = this.ZusatzInfo; + } - } - #region Properties + #region Properties + /// + /// SPALTE 1 - Der Kundename wird angezeigt + /// + [OLVColumn("Kunde", DisplayIndex = 0)] + public string Kundename { get; set; } + /// - /// CheckBoxen zur Auftragsauswahl als erste Spalte. + /// SPALTE 2 - CheckBoxen zur Auftragsauswahl als erste Spalte. /// - [OLVColumn("Auswählen", CheckBoxes = true, DisplayIndex = 0)] + [OLVColumn("Auswählen", CheckBoxes = true, DisplayIndex = 1)] public bool IsChecked { get; set; } /// - /// Liefertag mit ausgeschriebenen Tag als zweite Spalte. + /// SPALTE 3 - Liefertag mit ausgeschriebenen Tag als zweite Spalte. /// - [OLVColumn("Liefertag", DisplayIndex = 2, AspectToStringFormat = "{0:ddd dd.MM.}")] + [OLVColumn("Liefertag", DisplayIndex = 2)] public DateTime Liefertag { get; set; } /// - /// Die Aufgabe (STV, STH, INV) wird angezeigt wenn vorhanden. + /// SPALTE 4 - Containeranzahl schmutzig + /// + [OLVColumn("schmutzig", DisplayIndex = 3, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] + public int Container { get; set; } + + /// + /// SPALTE 5 - Containeranzahl sauber + /// + [OLVColumn("sauber", DisplayIndex = 4, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] + public int ContainerClean { get; set; } + + /// + /// SPALTE 6 - Der Status wird angezeigt. + /// + [OLVColumn("Status", DisplayIndex = 5)] + public AuftragStatus Status { get; set; } + + /// + /// SPALTE 7 - Der Auftragtyp wird angezeigt. + /// + [OLVColumn("Typ", IsVisible = true, DisplayIndex = 6)] + public AuftragTyp Typ { get; set; } + + /// + /// SPALTE 8 - Die "Erstellt von" Spalte mit Datum wird erstellt + /// + private string _auftragerstellt; + [OLVColumn("Erstellt")] + public string AuftragErstellt + { + get + { + if (this.Erstellt != null) return _auftragerstellt = Benutzer.GetBenutzer(null, this.ErstelltVon).BenutzerName + " von " + this.Erstellt.ToString(); + else return null; + } + } + + /// + /// SPALTE 9 - Die "Gedruckt von" Spalte mit Datum wird erstellt + /// + private string _auftraggedruckt; + [OLVColumn("Gedruckt")] + public string AuftragGedruckt + { + get + { + if(this.Gedruckt != null) return _auftraggedruckt = Benutzer.GetBenutzer(null, this.GedrucktVon).BenutzerName + " von " + this.Gedruckt.ToString(); + else return null; + } + } + + /// + /// SPALTE 10 - Die "Erledigt von" Spalte mit Datum wird erstellt + /// + private string _auftragerledigt; + [OLVColumn("Erledigt")] + public string AuftragErledigt + { + get + { + if (this.Erledigt != null) return _auftragerledigt = Benutzer.GetBenutzer(null, this.ErledigtVon).BenutzerName + " von " + this.Erledigt.ToString(); + else return null; + + } + } + + + + /// + /// SPALTE 11 - Die Aufgabe (STV, STH, INV) wird angezeigt wenn vorhanden. /// private string _auftragaufgabe; [OLVColumn("Aufgabe", DisplayIndex = 10, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] @@ -267,83 +388,36 @@ namespace DatenDB } /// - /// Der Status wird angezeigt. + /// SPALTE 12 - Button Etikett Drucken wird angezeigt. /// - [OLVColumn("Status", DisplayIndex = 5)] - public AuftragStatus Status { get; set; } - - /// - /// Der Kundename wird angezeigt - /// - private string _kundename; - [OLVColumn("Kunde", DisplayIndex = 1)] - public string Kundename - { - get - { - if (string.IsNullOrWhiteSpace(Kunde.GetKunde(null, KundeID, null).Suchtext)) return _kundename = Kunde.GetKunde(null, KundeID, null).KundeName; - else return _kundename = Kunde.GetKunde(null, KundeID, null).Suchtext; - } - set { } - } - - /// - /// Containeranzahl schmutzig - /// - [OLVColumn("schmutzig", DisplayIndex = 3, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] - public int Container { get; set; } - - /// - /// Containeranzahl sauber - /// - [OLVColumn("sauber", DisplayIndex = 4, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] - public int ContainerClean { get; set; } - - /// - /// Die "Erstellt von" Spalte mit Datum wird erstellt - /// - private string _auftragerstellt; - [OLVColumn("Erstellt", DisplayIndex = 7)] - public string AuftragErstellt - { - get - { - if (this.Erstellt != null) return _auftragerstellt = Benutzer.GetBenutzer(null, this.ErstelltVon).BenutzerName + " von " + this.Erstellt.ToString(); - else return null; + private string _etikett; + [OLVColumn("Etikett", DisplayIndex = 11, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] + public string Etikett + { + get + { + if (Typ >= AuftragTyp.Inventur) + { + if (Status >= AuftragStatus.Vorbereitet) return _fertig = string.Empty; + else return _fertig = "🖨"; + } + else + { + if (Status <= AuftragStatus.Herrichten) return _fertig = "🖨"; + else + { + if (Status == AuftragStatus.Vorbereitet) return _fertig = "🖨"; + else return _fertig = string.Empty; + } + } } } - /// - /// Die "Gedruckt von" Spalte mit Datum wird erstellt - /// - private string _auftraggedruckt; - [OLVColumn("Gedruckt", DisplayIndex = 8)] - public string AuftragGedruckt - { - get - { - if(this.Gedruckt != null) return _auftraggedruckt = Benutzer.GetBenutzer(null, this.GedrucktVon).BenutzerName + " von " + this.Gedruckt.ToString(); - else return null; - } - } - - /// - /// Die "Erledigt von" Spalte mit Datum wird erstellt - /// - private string _auftragerledigt; - [OLVColumn("Erledigt", DisplayIndex = 9)] - public string AuftragErledigt - { - get - { - if (this.Erledigt != null) return _auftragerledigt = Benutzer.GetBenutzer(null, this.ErledigtVon).BenutzerName + " von " + this.Erledigt.ToString(); - else return null; - - } - } - - private string _fertig; - [OLVColumn("Abschließen", DisplayIndex = 11)] + /// + /// SPALTE 13 - Button Abschließenvon Aufträgen wird angezeigt. + /// + private string _fertig; + [OLVColumn("Abschließen", DisplayIndex = 12, TextAlign = System.Windows.Forms.HorizontalAlignment.Center)] public string Fertig { get @@ -351,11 +425,11 @@ namespace DatenDB if(Typ >= AuftragTyp.Inventur) { if (Status >= AuftragStatus.Fertig) return _fertig = string.Empty; - else return _fertig = "Auftrag abschließen"; + else return _fertig = "✅"; } else { - if (Status == AuftragStatus.Vorbereitet) return _fertig = "Auftrag abschließen"; + if (Status == AuftragStatus.Vorbereitet) return _fertig = "✅"; else { return _fertig = string.Empty; ; @@ -364,15 +438,14 @@ namespace DatenDB } } + + /// /// Zusatz und Typ Properties werden ausgeblendet. /// [OLVColumn("Zusatz", IsVisible = false)] public string ZusatzInfo { get; set; } - [OLVColumn("Typ", IsVisible = true, DisplayIndex = 6)] - public AuftragTyp Typ { get; set; } - /// /// Properties von ObjectListView ignoriert. /// @@ -405,6 +478,9 @@ namespace DatenDB public int? AufgabeID { get; set; } [OLVIgnore] public bool AufgabeErledigt { get; set; } = false; + [OLVIgnore] + public AbteilungsStatus Abteilungen { get; set; } + #endregion public int[] Save() @@ -416,13 +492,13 @@ namespace DatenDB if (this.AuftragID.HasValue & this.AuftragID != 0) { - command.CommandText = $"update {TABLE} set benutzer_id = :p1, aufgabe_id = :p2, kunde_id = :p3, zusatz = :p4, liefertag = :p5, gedruckt = :p6, gedruckt_von = :p7, erledigt = :p8, erledigt_von = :p9, erstellt = :p10, erstellt_von = :p11, status = :p12, tour_id = :p13, container_dirt = :p14, maschine_id = :p15, container_clean = :p16, typ = :p17, aufgabe_erledigt = :p18 WHERE auftrag_id = :p0"; + command.CommandText = $"update {TABLE} set benutzer_id = :p1, aufgabe_id = :p2, kunde_id = :p3, zusatz = :p4, liefertag = :p5, gedruckt = :p6, gedruckt_von = :p7, erledigt = :p8, erledigt_von = :p9, erstellt = :p10, erstellt_von = :p11, status = :p12, tour_id = :p13, container_dirt = :p14, maschine_id = :p15, container_clean = :p16, typ = :p17, aufgabe_erledigt = :p18, abteilungen_status = :p19 WHERE auftrag_id = :p0"; } else { command.CommandText = "select nextval('kundenverwaltung.auftrag_seq')"; this.AuftragID = result[1] = (int)(long)command.ExecuteScalar(); - command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, :p12, :p13, :p14, :p15, :p16, :p17, :p18)"; + command.CommandText = $"insert into {TABLE} ({COLUMNS}) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10, :p11, :p12, :p13, :p14, :p15, :p16, :p17, :p18, :p19)"; } command.Parameters.AddWithValue("p0", this.AuftragID); @@ -444,6 +520,7 @@ namespace DatenDB command.Parameters.AddWithValue("p16", this.ContainerClean); command.Parameters.AddWithValue("p17", (int)this.Typ); command.Parameters.AddWithValue("p18", this.AufgabeErledigt); + command.Parameters.AddWithValue("p19", (int)this.Abteilungen); result[0] = command.ExecuteNonQuery(); DatenbankConnection.GetConnection().Close(); @@ -451,8 +528,4 @@ namespace DatenDB } } -} -//INSTALL-REMINDER: AufgabeID als Spalte in DB hinzufügen. -//INSTALL-REMINDER: AufgabeErledigt als Spalte in DB hinzufügen. -//DONE: Neuer Konstruktor für Auftragliste "Rampe". (abgeholte Aufträge die noch nicht aufgelegt sind) -//DONE: Neuer Konstruktor für Auftragliste "Finishing" oder "Aufgelegt". (aufgelegte Aufträge die noch nicht \ No newline at end of file +} \ No newline at end of file diff --git a/AA-Klassen/Berechnungen.cs b/AA-Klassen/Berechnungen.cs index b5fdcc6..2c5ef89 100644 --- a/AA-Klassen/Berechnungen.cs +++ b/AA-Klassen/Berechnungen.cs @@ -2,13 +2,16 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace DatenDB { public class Berechnungen { + private static Meldungen meldung = new Meldungen(); public Berechnungen() { } @@ -57,12 +60,18 @@ namespace DatenDB public static DateTime GetNextWeekday(int liefertag) { - DateTime dt; - if ((int)DateTime.Today.DayOfWeek == liefertag) { dt = DateTime.Today.AddDays(1); } - else { dt = DateTime.Today; } - int daysUntilLiefertag = ((int)liefertag - (int)dt.DayOfWeek + 7) % 7; + DateTime today = DateTime.Today; + DayOfWeek heute = today.DayOfWeek; - return dt.AddDays(daysUntilLiefertag); + if ((int)heute == liefertag) + { + if(meldung.GetFrage(null, $"Möchtest du HEUTE als Liefertag wählen?", false) == DialogResult.Yes) return today; + else return today.AddDays(7); + + } + int daysUntilLiefertag = ((int)liefertag - (int)heute + 7) % 7; + + return today.AddDays(daysUntilLiefertag); } } } diff --git a/AA-Klassen/DatenbankConnection.cs b/AA-Klassen/DatenbankConnection.cs index a6080e1..6210f4f 100644 --- a/AA-Klassen/DatenbankConnection.cs +++ b/AA-Klassen/DatenbankConnection.cs @@ -15,10 +15,9 @@ namespace DatenDB public static NpgsqlConnection GetConnection() { - if (connection == null) - { - connection = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); - } + if (connection?.State == System.Data.ConnectionState.Open) return connection; + connection?.Dispose(); + connection = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); return connection; } diff --git a/AA-Klassen/Funktionen.cs b/AA-Klassen/Funktionen.cs index 62cd500..53c1557 100644 --- a/AA-Klassen/Funktionen.cs +++ b/AA-Klassen/Funktionen.cs @@ -802,9 +802,14 @@ namespace Deckungsbeitrag { printDocument.PrinterSettings = dialog.PrinterSettings; printDocument.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage); - dialog.Document = printDocument; - dialog.Document.DocumentName = "Etikett"; - printDocument.Print(); + preview.StartPosition = FormStartPosition.CenterScreen; + preview.WindowState = FormWindowState.Normal; + preview.Document = printDocument; + preview.Document.DocumentName = "Etikett"; + preview.ShowDialog(); + //dialog.Document = printDocument; + //dialog.Document.DocumentName = "Etikett"; + //printDocument.Print(); return DialogResult.OK; } diff --git a/AA-Klassen/Kunde.cs b/AA-Klassen/Kunde.cs index 752e991..26b3b42 100644 --- a/AA-Klassen/Kunde.cs +++ b/AA-Klassen/Kunde.cs @@ -8,6 +8,7 @@ using System.Runtime.Remoting.Metadata.W3cXsd2001; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using static System.Net.Mime.MediaTypeNames; namespace DatenDB { @@ -15,7 +16,7 @@ namespace DatenDB { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 public const string COLUMNS = "kunde_id, tour_id, kunde_nr, name1, name2, straße, plz, bezeichnung, land, aktiv, bettenanzahl, kunde_gruppe, service, region, waescheart, suchtext, aufgabe, anmerkung, aufgabe_count"; - private const string RED_COLUMNS = "kunde_id, tour_id, kunde_nr, name1, name2, straße, plz, bezeichnung, land, aktiv, bettenanzahl, kunde_gruppe, service, region, waescheart, jahr, umsatz"; + private const string RED_COLUMNS = "kunde_id, tour_id, kunde_nr, name1, name2, straße, plz, bezeichnung, land, aktiv, bettenanzahl, kunde_gruppe, service, region, waescheart, jahr, umsatz"; public const string TABLE = "kundenverwaltung.kunde"; public const string VIEW = "kundenverwaltung.jahresumsaetze"; //RICHTIGE VIEW AUSSUCHEN FÜR INAKTIVE MIT LETZTEN UMSATZ... public Umsatz umsatz; @@ -24,9 +25,11 @@ namespace DatenDB } // LEER public static List GetTmpList(string text) { - bool endsWithSpecial = false; - if(!string.IsNullOrWhiteSpace(text)) endsWithSpecial = !char.IsLetterOrDigit(text[text.Length-1]); - DatenbankConnection.GetConnection().Open(); + //bool endsWithSpecial = false; + //if(!string.IsNullOrWhiteSpace(text)) endsWithSpecial = !char.IsLetterOrDigit(text[text.Length-1]); + + + DatenbankConnection.GetConnection().Open(); List resultList = new List(); using (NpgsqlCommand command = new NpgsqlCommand()) { @@ -34,16 +37,14 @@ namespace DatenDB if (string.IsNullOrEmpty(text)) command.CommandText = $"select {COLUMNS} from {TABLE} where aktiv = {true}"; else { - 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}' 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. + string cleanedText = new string(text.Where(char.IsLetterOrDigit).ToArray()); + + if (int.TryParse(cleanedText, out _)) command.CommandText = $"select {COLUMNS} from {TABLE} where kunde_nr::varchar ~* '{cleanedText}'"; + else command.CommandText = $"select {COLUMNS} from {TABLE} where suchtext ~* '{cleanedText}' or name1 ~* '{cleanedText}'"; + //TODO: Testen ob SWS-QRCodes gelesen werden können. Nur notwendig bis alle SWS-QRCodes richtig gedruckt und gelesen werden. } - NpgsqlDataReader reader = command.ExecuteReader(); + NpgsqlDataReader reader = command.ExecuteReader(); while (reader.Read()) resultList.Add(new Kunde(reader)); reader.Close(); } @@ -60,8 +61,8 @@ namespace DatenDB { command.Connection = DatenbankConnection.GetConnection(); if (!string.IsNullOrEmpty(kndnr)) command.CommandText = $"select kunde_id from {TABLE} where kunde_nr = '{kndnr}'"; - else command.CommandText = $"select kunde_id from {TABLE} where suchtext = '{text}'"; - NpgsqlDataReader reader = command.ExecuteReader(); + else command.CommandText = $"select kunde_id from {TABLE} where suchtext ~* '{text}' or name1 ~* '{text}'"; + NpgsqlDataReader reader = command.ExecuteReader(); while (reader.Read()) result = reader.GetInt32(0); reader.Close(); } @@ -83,8 +84,40 @@ namespace DatenDB return resultList; } + internal static List GetKundenTourenListe() + { + DatenbankConnection.GetConnection().Open(); + List resultList = new List(); + using (NpgsqlCommand command = new NpgsqlCommand()) + { + command.Connection = DatenbankConnection.GetConnection(); + command.CommandText = $"select {COLUMNS} from {TABLE} where aktiv = true and service = 'Lieferservice' order by region asc"; + NpgsqlDataReader reader = command.ExecuteReader(); + while (reader.Read()) resultList.Add(new Kunde(reader, false)); + reader.Close(); + } + DatenbankConnection.GetConnection().Close(); - public static List GetList(bool? isaktiv, string text) + foreach (Kunde kunde in resultList) + { + List list = new List(); + list = OLVKundenumsatz.GetJahresumsatz(kunde.KundeID); + if (list.Count > 0) + { + kunde.Zeitraum = double.Parse(OLVKundenumsatz.GetJahresumsatz(kunde.KundeID).Last().Zeitraum); + kunde.Umsatz1 = OLVKundenumsatz.GetJahresumsatz(kunde.KundeID).Last().Umsatz; + } + else + { + kunde.Zeitraum = 0; + kunde.Umsatz1 = 0; + } + + } + + return resultList; + } + public static List GetList(bool? isaktiv, string text) { DatenbankConnection.GetConnection().Open(); List resultList = new List(); @@ -291,6 +324,7 @@ namespace DatenDB } } + #region Properties [OLVIgnore] public int? KundeID { get; set; } diff --git a/AA-Klassen/MeinFilterMenu.cs b/AA-Klassen/MeinFilterMenu.cs index 0fb02fe..c07575d 100644 --- a/AA-Klassen/MeinFilterMenu.cs +++ b/AA-Klassen/MeinFilterMenu.cs @@ -10,16 +10,17 @@ namespace Deckungsbeitrag { public class MeinFilterMenu : FilterMenuBuilder { - - public MeinFilterMenu() + public MeinFilterMenu() { APPLY_LABEL = "Filter Durchführen"; CLEAR_ALL_FILTERS_LABEL = "Alle Filter Löschen"; FILTERING_LABEL = "Filter"; SELECT_ALL_LABEL = "Alle Auswählen"; MaxObjectsToConsider = 10000; //Max Anzahl Gruppen die erstellt werden können. + - } + } + override protected ToolStripMenuItem CreateFilteringMenuItem(OLVColumn column, List clusters) { ToolStripCheckedListBox checkedList = new ToolStripCheckedListBox(); diff --git a/AA-Klassen/TourenDaten.cs b/AA-Klassen/TourenDaten.cs new file mode 100644 index 0000000..0d7cd47 --- /dev/null +++ b/AA-Klassen/TourenDaten.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Deckungsbeitrag.AA_Klassen +{ + public class TourenDaten + { + public string FahrzeugName { get; set; } + public List KundenProTag { get; set; } = new List(); // [(Tag, Kunden[]), ...] + public Dictionary Counter { get; set; } = new Dictionary(); + } + + public class KundeData + { + public string Name { get; set; } + public string Region { get; set; } + public string Tag { get; set; } // ← MO, DI, MI, DO, FR + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index cd19e56..82c37d4 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: -[assembly: AssemblyVersion("1.0.4.2")] -[assembly: AssemblyFileVersion("1.0.4.2")] +[assembly: AssemblyVersion("1.0.4.7")] +[assembly: AssemblyFileVersion("1.0.4.7")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index e7d3f4d..223817c 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -70,6 +70,16 @@ namespace Deckungsbeitrag.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap clean { + get { + object obj = ResourceManager.GetObject("clean", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// @@ -90,6 +100,16 @@ namespace Deckungsbeitrag.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap dirt { + get { + object obj = ResourceManager.GetObject("dirt", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// @@ -130,6 +150,16 @@ namespace Deckungsbeitrag.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Print_16x { + get { + object obj = ResourceManager.GetObject("Print_16x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// diff --git a/Properties/Resources.resx b/Properties/Resources.resx index e825302..dbdb722 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -127,28 +127,37 @@ ..\Resources\InformationSymbol_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Monaco_Settings_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\weather_warning_signal_alert_exclamation_icon_124159.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\UpdatedScript_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Monaco_Settings_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\question-sign_icon-icons.com_73445.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Close_red_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\WarningRule_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Close_WhiteNoHalo_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Print_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\StatisticsWarning_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\WarningRule_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Close_red_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Close_WhiteNoHalo_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\clean.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\dirt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Resources/Print_16x.png b/Resources/Print_16x.png new file mode 100644 index 0000000..0b13187 Binary files /dev/null and b/Resources/Print_16x.png differ diff --git a/Resources/clean.png b/Resources/clean.png new file mode 100644 index 0000000..53fc1a3 Binary files /dev/null and b/Resources/clean.png differ diff --git a/Resources/dirt.png b/Resources/dirt.png new file mode 100644 index 0000000..e69f9e6 Binary files /dev/null and b/Resources/dirt.png differ diff --git a/SetupVerwaltung/SetupVerwaltung.vdproj b/SetupVerwaltung/SetupVerwaltung.vdproj index ae60c9a..28c7d7b 100644 --- a/SetupVerwaltung/SetupVerwaltung.vdproj +++ b/SetupVerwaltung/SetupVerwaltung.vdproj @@ -1661,15 +1661,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:SetupVerwaltung" - "ProductCode" = "8:{681D4BE0-85C6-49F3-B837-C9ABEC74802B}" - "PackageCode" = "8:{3E02C75F-E8EE-454B-9579-2FD60899A00E}" + "ProductCode" = "8:{9E33B269-74F0-4D08-8166-8E0EFD990DD8}" + "PackageCode" = "8:{85BC06AD-B1CE-4846-87BE-3D7EFFCBB51D}" "UpgradeCode" = "8:{2DC7CE56-8D1C-42EB-B326-2E887EBB7F5A}" "AspNetVersion" = "8:" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0.28" + "ProductVersion" = "8:1.0.33" "Manufacturer" = "8:Kilian Wirl GmbH" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/UserControls/KundenControl.Designer.cs b/UserControls/KundenControl.Designer.cs new file mode 100644 index 0000000..260c465 --- /dev/null +++ b/UserControls/KundenControl.Designer.cs @@ -0,0 +1,40 @@ +using System.Drawing; + +namespace Deckungsbeitrag.UserControls +{ + partial class KundenControl + { + /// + /// 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.SuspendLayout(); + this.AutoScaleDimensions = new SizeF(7F, 15F); + this.ResumeLayout(false); + } + + #endregion + } +} diff --git a/UserControls/KundenControl.cs b/UserControls/KundenControl.cs new file mode 100644 index 0000000..ad68fa8 --- /dev/null +++ b/UserControls/KundenControl.cs @@ -0,0 +1,102 @@ +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.UserControls +{ + public partial class KundenControl : UserControl + { + private Label lblKunde; + private Label lblRegion; + private FlowLayoutPanel flp; // ← Field deklarieren! + + public string KundenName + { + get => lblKunde.Text; + set => lblKunde.Text = value; + } + public string Region + { + get => lblRegion.Text; + set => lblRegion.Text = value; + } + + public KundenControl() + { + InitializeComponent(); + SetupControl(); + } + + public KundenControl(string name, string region = "") : this() + { + KundenName = name; + Region = region; + } + private void SetupControl() + { + this.Size = new Size(200, 35); // Breiter für 2 Labels + this.BackColor = Color.LightSteelBlue; + this.BorderStyle = BorderStyle.FixedSingle; + + // FlowLayoutPanel für horizontale Anordnung + flp = new FlowLayoutPanel + { + Dock = DockStyle.Fill, + FlowDirection = FlowDirection.LeftToRight, + AutoSize = true, + Padding = new Padding(4) + }; + + // Kunde-Label (links, fett) + lblKunde = new Label + { + Text = "Max Mustermann", + TextAlign = ContentAlignment.MiddleLeft, + Font = new Font("Segoe UI", 12F, FontStyle.Bold), + Margin = new Padding(0, 2, 5, 2), // Abstand rechts + Anchor = AnchorStyles.None, + AutoSize = true + }; + + // Region-Label (rechts, klein) + lblRegion = new Label + { + Text = "Salzburg", + TextAlign = ContentAlignment.MiddleLeft, + Font = new Font("Segoe UI", 10F, FontStyle.Regular), + ForeColor = Color.DarkBlue, + Margin = new Padding(0), + Anchor = AnchorStyles.None, + AutoSize = true + }; + + + flp.Controls.Add(lblKunde); + flp.Controls.Add(lblRegion); + this.Controls.Add(flp); + + // ★★★ MOUSE-EVENTS DURCHREICHEN zu EINEM Handler ★★★ + flp.MouseDown += KundenControl_MouseDown; + lblKunde.MouseDown += KundenControl_MouseDown; + lblRegion.MouseDown += KundenControl_MouseDown; + } + private void KundenControl_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + this.DoDragDrop(new DataObject("KundeData", this), DragDropEffects.Copy); + } + } + public object Clone() + { + return new KundenControl(this.KundenName, this.Region); + } + } +} +//TODO: Design des Controls anpassen. Eventuell im Designer erstellen. \ No newline at end of file diff --git a/UCAuftrag.Designer.cs b/UserControls/UCAuftrag.Designer.cs similarity index 100% rename from UCAuftrag.Designer.cs rename to UserControls/UCAuftrag.Designer.cs diff --git a/UCAuftrag.cs b/UserControls/UCAuftrag.cs similarity index 100% rename from UCAuftrag.cs rename to UserControls/UCAuftrag.cs diff --git a/UCAuftrag.resx b/UserControls/UCAuftrag.resx similarity index 100% rename from UCAuftrag.resx rename to UserControls/UCAuftrag.resx diff --git a/UCFach.Designer.cs b/UserControls/UCFach.Designer.cs similarity index 100% rename from UCFach.Designer.cs rename to UserControls/UCFach.Designer.cs diff --git a/UCFach.cs b/UserControls/UCFach.cs similarity index 100% rename from UCFach.cs rename to UserControls/UCFach.cs diff --git a/UCFach.resx b/UserControls/UCFach.resx similarity index 100% rename from UCFach.resx rename to UserControls/UCFach.resx diff --git a/UserControls/UCTabPageLKW.Designer.cs b/UserControls/UCTabPageLKW.Designer.cs new file mode 100644 index 0000000..4fe32df --- /dev/null +++ b/UserControls/UCTabPageLKW.Designer.cs @@ -0,0 +1,320 @@ +namespace Deckungsbeitrag.UserControls +{ + partial class UCTabPageLKW + { + /// + /// 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.tableLayoutPanelTage = new System.Windows.Forms.TableLayoutPanel(); + this.flowLayoutPanelFR = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanelDO = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanelMI = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanelDI = new System.Windows.Forms.FlowLayoutPanel(); + this.labelContFR = new System.Windows.Forms.Label(); + this.labelContDO = new System.Windows.Forms.Label(); + this.labelContMI = new System.Windows.Forms.Label(); + this.labelContDI = new System.Windows.Forms.Label(); + this.labelFR = new System.Windows.Forms.Label(); + this.labelDO = new System.Windows.Forms.Label(); + this.labelMI = new System.Windows.Forms.Label(); + this.labelDI = new System.Windows.Forms.Label(); + this.labelMO = new System.Windows.Forms.Label(); + this.labelContMO = new System.Windows.Forms.Label(); + this.flowLayoutPanelMO = new System.Windows.Forms.FlowLayoutPanel(); + this.tableLayoutPanelTage.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanelTage + // + this.tableLayoutPanelTage.ColumnCount = 5; + this.tableLayoutPanelTage.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanelTage.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanelTage.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanelTage.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanelTage.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanelTage.Controls.Add(this.flowLayoutPanelFR, 4, 1); + this.tableLayoutPanelTage.Controls.Add(this.flowLayoutPanelDO, 3, 1); + this.tableLayoutPanelTage.Controls.Add(this.flowLayoutPanelMI, 2, 1); + this.tableLayoutPanelTage.Controls.Add(this.flowLayoutPanelDI, 1, 1); + this.tableLayoutPanelTage.Controls.Add(this.labelContFR, 4, 2); + this.tableLayoutPanelTage.Controls.Add(this.labelContDO, 3, 2); + this.tableLayoutPanelTage.Controls.Add(this.labelContMI, 2, 2); + this.tableLayoutPanelTage.Controls.Add(this.labelContDI, 1, 2); + this.tableLayoutPanelTage.Controls.Add(this.labelFR, 4, 0); + this.tableLayoutPanelTage.Controls.Add(this.labelDO, 3, 0); + this.tableLayoutPanelTage.Controls.Add(this.labelMI, 2, 0); + this.tableLayoutPanelTage.Controls.Add(this.labelDI, 1, 0); + this.tableLayoutPanelTage.Controls.Add(this.labelMO, 0, 0); + this.tableLayoutPanelTage.Controls.Add(this.labelContMO, 0, 2); + this.tableLayoutPanelTage.Controls.Add(this.flowLayoutPanelMO, 0, 1); + this.tableLayoutPanelTage.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanelTage.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanelTage.Name = "tableLayoutPanelTage"; + this.tableLayoutPanelTage.RowCount = 3; + this.tableLayoutPanelTage.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanelTage.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanelTage.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanelTage.Size = new System.Drawing.Size(910, 719); + this.tableLayoutPanelTage.TabIndex = 1; + // + // flowLayoutPanelFR + // + this.flowLayoutPanelFR.AllowDrop = true; + this.flowLayoutPanelFR.BackColor = System.Drawing.SystemColors.ControlLight; + this.flowLayoutPanelFR.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanelFR.Location = new System.Drawing.Point(731, 33); + this.flowLayoutPanelFR.Name = "flowLayoutPanelFR"; + this.flowLayoutPanelFR.Size = new System.Drawing.Size(176, 653); + this.flowLayoutPanelFR.TabIndex = 19; + this.flowLayoutPanelFR.Tag = "FR"; + this.flowLayoutPanelFR.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragDrop); + this.flowLayoutPanelFR.DragEnter += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragEnter); + this.flowLayoutPanelFR.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragOver); + // + // flowLayoutPanelDO + // + this.flowLayoutPanelDO.AllowDrop = true; + this.flowLayoutPanelDO.BackColor = System.Drawing.SystemColors.ControlLight; + this.flowLayoutPanelDO.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanelDO.Location = new System.Drawing.Point(549, 33); + this.flowLayoutPanelDO.Name = "flowLayoutPanelDO"; + this.flowLayoutPanelDO.Size = new System.Drawing.Size(176, 653); + this.flowLayoutPanelDO.TabIndex = 18; + this.flowLayoutPanelDO.Tag = "DO"; + this.flowLayoutPanelDO.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragDrop); + this.flowLayoutPanelDO.DragEnter += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragEnter); + this.flowLayoutPanelDO.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragOver); + // + // flowLayoutPanelMI + // + this.flowLayoutPanelMI.AllowDrop = true; + this.flowLayoutPanelMI.BackColor = System.Drawing.SystemColors.ControlLight; + this.flowLayoutPanelMI.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanelMI.Location = new System.Drawing.Point(367, 33); + this.flowLayoutPanelMI.Name = "flowLayoutPanelMI"; + this.flowLayoutPanelMI.Size = new System.Drawing.Size(176, 653); + this.flowLayoutPanelMI.TabIndex = 17; + this.flowLayoutPanelMI.Tag = "MI"; + this.flowLayoutPanelMI.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragDrop); + this.flowLayoutPanelMI.DragEnter += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragEnter); + this.flowLayoutPanelMI.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragOver); + // + // flowLayoutPanelDI + // + this.flowLayoutPanelDI.AllowDrop = true; + this.flowLayoutPanelDI.BackColor = System.Drawing.SystemColors.ControlLight; + this.flowLayoutPanelDI.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanelDI.Location = new System.Drawing.Point(185, 33); + this.flowLayoutPanelDI.Name = "flowLayoutPanelDI"; + this.flowLayoutPanelDI.Size = new System.Drawing.Size(176, 653); + this.flowLayoutPanelDI.TabIndex = 16; + this.flowLayoutPanelDI.Tag = "DI"; + this.flowLayoutPanelDI.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragDrop); + this.flowLayoutPanelDI.DragEnter += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragEnter); + this.flowLayoutPanelDI.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragOver); + // + // labelContFR + // + this.labelContFR.AutoSize = true; + this.labelContFR.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.labelContFR.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelContFR.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelContFR.Location = new System.Drawing.Point(731, 689); + this.labelContFR.Name = "labelContFR"; + this.labelContFR.Size = new System.Drawing.Size(176, 30); + this.labelContFR.TabIndex = 14; + this.labelContFR.Text = "25"; + this.labelContFR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelContDO + // + this.labelContDO.AutoSize = true; + this.labelContDO.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.labelContDO.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelContDO.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelContDO.Location = new System.Drawing.Point(549, 689); + this.labelContDO.Name = "labelContDO"; + this.labelContDO.Size = new System.Drawing.Size(176, 30); + this.labelContDO.TabIndex = 13; + this.labelContDO.Text = "25"; + this.labelContDO.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelContMI + // + this.labelContMI.AutoSize = true; + this.labelContMI.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.labelContMI.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelContMI.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelContMI.Location = new System.Drawing.Point(367, 689); + this.labelContMI.Name = "labelContMI"; + this.labelContMI.Size = new System.Drawing.Size(176, 30); + this.labelContMI.TabIndex = 12; + this.labelContMI.Text = "25"; + this.labelContMI.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelContDI + // + this.labelContDI.AutoSize = true; + this.labelContDI.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.labelContDI.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelContDI.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelContDI.Location = new System.Drawing.Point(185, 689); + this.labelContDI.Name = "labelContDI"; + this.labelContDI.Size = new System.Drawing.Size(176, 30); + this.labelContDI.TabIndex = 11; + this.labelContDI.Text = "25"; + this.labelContDI.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelFR + // + this.labelFR.AutoSize = true; + this.labelFR.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.labelFR.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelFR.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelFR.ForeColor = System.Drawing.Color.White; + this.labelFR.Location = new System.Drawing.Point(731, 0); + this.labelFR.Name = "labelFR"; + this.labelFR.Size = new System.Drawing.Size(176, 30); + this.labelFR.TabIndex = 4; + this.labelFR.Text = "FR"; + this.labelFR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelDO + // + this.labelDO.AutoSize = true; + this.labelDO.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.labelDO.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelDO.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelDO.ForeColor = System.Drawing.Color.White; + this.labelDO.Location = new System.Drawing.Point(549, 0); + this.labelDO.Name = "labelDO"; + this.labelDO.Size = new System.Drawing.Size(176, 30); + this.labelDO.TabIndex = 3; + this.labelDO.Text = "DO"; + this.labelDO.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelMI + // + this.labelMI.AutoSize = true; + this.labelMI.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.labelMI.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelMI.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelMI.ForeColor = System.Drawing.Color.White; + this.labelMI.Location = new System.Drawing.Point(367, 0); + this.labelMI.Name = "labelMI"; + this.labelMI.Size = new System.Drawing.Size(176, 30); + this.labelMI.TabIndex = 2; + this.labelMI.Text = "MI"; + this.labelMI.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelDI + // + this.labelDI.AutoSize = true; + this.labelDI.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.labelDI.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelDI.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelDI.ForeColor = System.Drawing.Color.White; + this.labelDI.Location = new System.Drawing.Point(185, 0); + this.labelDI.Name = "labelDI"; + this.labelDI.Size = new System.Drawing.Size(176, 30); + this.labelDI.TabIndex = 1; + this.labelDI.Text = "DI"; + this.labelDI.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelMO + // + this.labelMO.AutoSize = true; + this.labelMO.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101))))); + this.labelMO.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelMO.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelMO.ForeColor = System.Drawing.Color.White; + this.labelMO.Location = new System.Drawing.Point(3, 0); + this.labelMO.Name = "labelMO"; + this.labelMO.Size = new System.Drawing.Size(176, 30); + this.labelMO.TabIndex = 0; + this.labelMO.Text = "MO"; + this.labelMO.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelContMO + // + this.labelContMO.AutoSize = true; + this.labelContMO.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.labelContMO.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelContMO.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelContMO.Location = new System.Drawing.Point(3, 689); + this.labelContMO.Name = "labelContMO"; + this.labelContMO.Size = new System.Drawing.Size(176, 30); + this.labelContMO.TabIndex = 5; + this.labelContMO.Text = "25"; + this.labelContMO.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // flowLayoutPanelMO + // + this.flowLayoutPanelMO.AllowDrop = true; + this.flowLayoutPanelMO.BackColor = System.Drawing.SystemColors.ControlLight; + this.flowLayoutPanelMO.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanelMO.Location = new System.Drawing.Point(3, 33); + this.flowLayoutPanelMO.Name = "flowLayoutPanelMO"; + this.flowLayoutPanelMO.Size = new System.Drawing.Size(176, 653); + this.flowLayoutPanelMO.TabIndex = 15; + this.flowLayoutPanelMO.Tag = "MO"; + this.flowLayoutPanelMO.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragDrop); + this.flowLayoutPanelMO.DragEnter += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragEnter); + this.flowLayoutPanelMO.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowLayout_DragOver); + // + // UCTabPageLKW + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tableLayoutPanelTage); + this.Name = "UCTabPageLKW"; + this.Size = new System.Drawing.Size(910, 719); + this.tableLayoutPanelTage.ResumeLayout(false); + this.tableLayoutPanelTage.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanelTage; + private System.Windows.Forms.Label labelContFR; + private System.Windows.Forms.Label labelContDO; + private System.Windows.Forms.Label labelContMI; + private System.Windows.Forms.Label labelContDI; + private System.Windows.Forms.Label labelFR; + private System.Windows.Forms.Label labelDO; + private System.Windows.Forms.Label labelMI; + private System.Windows.Forms.Label labelDI; + private System.Windows.Forms.Label labelMO; + private System.Windows.Forms.Label labelContMO; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelFR; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelDO; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelMI; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelDI; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelMO; + } +} diff --git a/UserControls/UCTabPageLKW.cs b/UserControls/UCTabPageLKW.cs new file mode 100644 index 0000000..342eb32 --- /dev/null +++ b/UserControls/UCTabPageLKW.cs @@ -0,0 +1,128 @@ +using DatenDB; +using Deckungsbeitrag.AA_Klassen; +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.UserControls +{ + public partial class UCTabPageLKW : UserControl + { + public UCTabPageLKW() + { + InitializeComponent(); + } + private void FlowLayout_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent("KundeData")) // Custom Format + e.Effect = DragDropEffects.Copy; + + } + + private void FlowLayout_DragOver(object sender, DragEventArgs e) + { + e.Effect = DragDropEffects.Copy; + } + + private void FlowLayout_DragDrop(object sender, DragEventArgs e) + { + FlowLayoutPanel dropTarget = sender as FlowLayoutPanel; + if (e.Data.GetDataPresent("KundeData")) + { + KundenControl kunde = e.Data.GetData("KundeData") as KundenControl; + if (kunde != null) + { + // Kunde klonen (nicht original bewegen) + KundenControl kundeKopie = (KundenControl)kunde.Clone(); + kundeKopie.Parent = dropTarget; + dropTarget.Controls.Add(kundeKopie); + } + } + } + // ★ SPEICHERN – nutzt TAG der FlowLayoutPanels ★ + public TourenDaten SpeichereDaten() + { + var data = new TourenDaten + { + FahrzeugName = this.Parent?.Text ?? "Unbekannt", + KundenProTag = new List() + }; + + // Alle FlowLayoutPanels durchgehen + foreach (Control ctrl in tableLayoutPanelTage.Controls) + { + if (ctrl is FlowLayoutPanel flp && flp.Tag is string tag) // ← TAG! + { + // Kunden sammeln + foreach (Control kundeCtrl in flp.Controls) + { + if (kundeCtrl is KundenControl kc) + { + data.KundenProTag.Add(new KundeData + { + Name = kc.KundenName, + Region = kc.Region, + Tag = tag // ← Wochentag mit speichern! + }); + } + } + + // Counter finden (labelContMO -> MO, etc.) + string counterName = $"labelCont{tag}"; + var counterLabel = tableLayoutPanelTage.Controls.Find(counterName, true).FirstOrDefault() as Label; + if (counterLabel != null) + data.Counter[tag] = int.Parse(counterLabel.Text); + } + } + + return data; + } + + // ★ LADEN – TAG der FlowLayoutPanels nutzen ★ + public void LadeDaten(TourenDaten data) + { + // Zuerst alle FlowLayoutPanels leeren + foreach (Control ctrl in tableLayoutPanelTage.Controls) + { + if (ctrl is FlowLayoutPanel flp) + flp.Controls.Clear(); + } + + // Kunden nach TAG verteilen + var kundenGruppiert = data.KundenProTag.GroupBy(k => k.Tag); + + foreach (var gruppe in kundenGruppiert) + { + string tag = gruppe.Key; + FlowLayoutPanel zielFlp = tableLayoutPanelTage.Controls + .OfType() + .FirstOrDefault(flp => flp.Tag?.ToString() == tag); + + if (zielFlp != null) + { + foreach (var kundeData in gruppe) + { + var kunde = new KundenControl(kundeData.Name, kundeData.Region); + zielFlp.Controls.Add(kunde); + } + } + + // Counter setzen + if (data.Counter.TryGetValue(tag, out int count)) + { + string counterName = $"labelCont{tag}"; + var counterLabel = tableLayoutPanelTage.Controls.Find(counterName, true).FirstOrDefault() as Label; + counterLabel.Text = count.ToString(); + } + } + } + } +} +//TODO: Kein Clone mehr wenn im Panel bewegt wird. Nur neue Position übernehmen. (Fahrreihenfolge) +//TODO: Kein Clone wenn zwischen den Panelen bewegt wird. \ No newline at end of file diff --git a/UserControls/UCTabPageLKW.resx b/UserControls/UCTabPageLKW.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/UserControls/UCTabPageLKW.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/UserSettingsManager.cs b/UserSettingsManager.cs index 09dff96..d22362c 100644 --- a/UserSettingsManager.cs +++ b/UserSettingsManager.cs @@ -18,6 +18,7 @@ public class UserSettingsManager public Point LocationGroupBox { get; set; } = new Point(0, 0); public Point LocationButtonNeuerUser { get; set; } = new Point(0, 0); public Point LocationButtonNeuerAuftrag { get; set; } = new Point(0, 0); + public Byte[] OLV_State { get; set; } //TODO: UserSetting Properties eintragen und in EinstellungsScreen abrufen. private readonly string _configPath; @@ -52,6 +53,7 @@ public class UserSettingsManager LocationGroupBox = loadedSettings.LocationGroupBox; LocationButtonNeuerUser = loadedSettings.LocationButtonNeuerUser; LocationButtonNeuerAuftrag = loadedSettings.LocationButtonNeuerAuftrag; + OLV_State = loadedSettings.OLV_State; // Weitere Properties hier zuweisen //TODO: Weitere Properties von oben hier zuweisen } diff --git a/Verwaltung.csproj b/Verwaltung.csproj index e338930..7af45e0 100644 --- a/Verwaltung.csproj +++ b/Verwaltung.csproj @@ -82,6 +82,7 @@ packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll + packages\Npgsql.4.1.14\lib\net461\Npgsql.dll @@ -162,6 +163,12 @@ FormNeuerBenutzer.cs + + Form + + + FormTourenplanung.cs + Form @@ -340,6 +347,7 @@ + @@ -353,21 +361,33 @@ - + UserControl - + + KundenControl.cs + + + UserControl + + UCAuftrag.cs - + UserControl - + UCFach.cs + + UserControl + + + UCTabPageLKW.cs + FormArtikelVW.cs @@ -441,6 +461,9 @@ FormProgrammauswahl.cs + + FormTourenplanung.cs + FromAuftragVW.cs @@ -463,12 +486,15 @@ FormKundeVW.cs - + UCAuftrag.cs - + UCFach.cs + + UCTabPageLKW.cs + SettingsSingleFileGenerator @@ -495,6 +521,9 @@ + + + diff --git a/Verwaltung_ReadMe.txt b/Verwaltung_ReadMe.txt index 191bfd2..0eb0598 100644 --- a/Verwaltung_ReadMe.txt +++ b/Verwaltung_ReadMe.txt @@ -1,77 +1,100 @@ ===================================== -NEUIGKEITEN - Version 1.0.4.2 +NEUIGKEITEN - Version 1.0.4.7 ===================================== Build-Info: - Build-Typ: Release Build -- Erledigte TODOs: 19 -- Offene TODOs: 21 -- Install-Reminders: 3 -- Changes: 10 +- Erledigte TODOs: 23 +- Offene TODOs: 34 +- Install-Reminders: 1 +- Changes: 18 -=== ⚙️ INSTALL-REMINDER (3) === -- ⚙️ AufgabeErledigt als Spalte in DB hinzufügen. [Auftrag.cs] -- ⚙️ AufgabeID als Spalte in DB hinzufügen. [Auftrag.cs] -- ⚙️ Spalte Aktiv in DB einfügen. [Aufgabe.cs] +=== ⚙️ INSTALL-REMINDER (1) === +- ⚙️ Spalte Abteilungen in Auftrag muss in Wirl_DB_17012023 eingefügt werden. [FormExpedit.cs] -=== ✨ CHANGES (10) === -- ✨ Aufleger muss keine Aufträge mehr erstellen da Fahrer das machen können. [FormWSVerfolgung.cs] -- ✨ Auftragsliste zeigt hier nur AuftragStatus "Abgeholt" Aufträge. [FormWSVerfolgung.cs] +=== ✨ CHANGES (18) === +- ✨ AbteilungsStatus ist implementiert. [FormExpedit.cs] +- ✨ Als zweite Sortierung wird immer der Liefertag gewählt. [FormExpedit.cs] - ✨ Auftragverwaltung Spalten wurden aktualisiert. Mit Icons, Buttons und Sortierung auf Liefertag. [FormMain.cs] -- ✨ Die Liste zeigt jetzt auch die Aufträge und die Kunden der möglich Aufträge an. (Erleichtert die Kundenauswahl bei Fehlmengecount) [FormListe.cs] -- ✨ Es werden jetzt Meldungen gezeigt damit Aufgaben erledigt und Containeranzahl zuverlässig stimmt. [FormExpedit.cs] +- ✨ Aus und Einblenden der Nachwäsche möglich. [FormExpedit.cs] +- ✨ Bearbeiten in ObjectListView möglich. (Kundename wird aber zurückgesetzt) [FormExpedit.cs] +- ✨ Datumfilter funktioniert. [FormExpedit.cs] - ✨ Fahrer können abgeholte Aufträge erstellen und ausgelieferte Aufträge markieren. [FormMain.cs] +- ✨ Geschäftaufträge werden in neuem Tab angezeigt. [FormExpedit.cs] +- ✨ GroupBox nicht mehr notwendig. Etikette Druck über ObjectListView. [FormExpedit.cs] +- ✨ Highlightfarbe bleibt auch wenn unfocused. (Farbe ändern?) [FormExpedit.cs] +- ✨ Keine Timer da Probleme mit DB-Connection. DataGridView wird neu geladen wenn Auftrag neu gewählt wird. [FormExpedit.cs] - ✨ NeuerAuftrag wird jetzt mit Propertie AuftragTyp aufgerufen. Dadurch ist die Auswahl des AuftragTyp konstanter. [FormNeuerAuftrag.cs] -- ✨ Wenn Auftrag als Vorbereitet markiert wird, wird nachgefragt ob die Aufgabe erledigt wurde. [FormExpedit.cs] -- ✨ Wenn Auftrag nicht gefunden kann er trotzdem einen neuen Erstellen. [FormWSVerfolgung.cs] -- ✨ Wenn saubere Container sind 0 kann Auftrag nicht als Vorbereitet markiert werden. (Damit die Statistik stimmt) [FormExpedit.cs] +- ✨ ObjectListView speichert Status automatisch beim schließen des Fensters und läd wieder wenn neu gestartet wird. [FormExpedit.cs] +- ✨ Rechtsklick auf Spaltenheader ermöglicht Filtern. [FormExpedit.cs] +- ✨ Sortierte Spalte hat leicht andere Farbe. (Besser zu erkennen wonach sortiert wird) [FormExpedit.cs] +- ✨ Suchen eines Auftrags mit Scan möglich. [FormExpedit.cs] +- ✨ Wenn Doppelklick auf Zelle, wird gefragt ob bearbeiten wirklich gewollt. Sonst wird blockiert. [FormExpedit.cs] +- ✨ Wenn HEUTE als Liefertag gewählt, kommt Frage ob heute oder in einer Woche. Wenn JA dann HEUTE. [FormExpedit.cs] -=== ✅ ERLEDIGTE TODOs (19) === -- ✅ : Auch wenn Extra Auftrag benötigt wird funktioniert es über die Auftragsliste. [FormWSVerfolgung.cs] +=== ✅ ERLEDIGTE TODOs (23) === +- ✅ : 2 neue Buttons für "Neue Inventur" und "Neue Standveränderung" [FormMain.cs] - ✅ : Aufgabe wird bei "Vorbereiten ohne Etikett" verarbeitet. [FormExpedit.cs] - ✅ : Auftrag als Vorbereitet markieren geht nur wenn saubere Container nicht 0 sind. [FormExpedit.cs] - ✅ : Auftrag über FormListe holen und daraus den Kunden für Fehlmenge holen. [FormFehlmengeCount.cs] +- ✅ : Bei Fahrer neue Deaktivierung von Controls. [FormMain.cs] +- ✅ : Bei jeder Änderung vor dem Speichern Nachfragen ob wirklich durchführen. [FormExpedit.cs] - ✅ : Bei Transport wir ein Fach mit Aktuellem Auftrag erstellt. Das Alte wird bei Transport gespeichert. [FormAusschlager.cs] -- ✅ : Kunde anzeigen Reihenfolge der Spalten zuerst Suchtext danach Name. [FormListe.cs] -- ✅ : Listentyp.Auftragliste implementiert um über FormWSVerfolgung die Auftragliste abrufen zu können. [FormListe.cs] +- ✅ : DataGridView hinter TabControl? DataGridView in Vordergrund. [FormExpedit.cs] +- ✅ : Etikett Drucken als Button in Row. Dann Vorschau anzeigen und Drucken. [FormExpedit.cs] +- ✅ : Etikett GroupBox entfernen. Änderungen direkt in ObjectListView vornehmen PrintPreview für Etikett. [FormExpedit.cs] +- ✅ : Fehler wenn FormListe mit X geschlossen wird und Kunde null ist wurde behoben. [FormNeuerAuftrag.cs] +- ✅ : Filigran Geschäftkunde in Expedit anzeigen [FormExpedit.cs] +- ✅ : Filtern in Tabelle ermöglichen. [FormExpedit.cs] - ✅ : Logik überlegen wie ein bearbeiteter Auftrag nicht doppelt gewählt werden kann. (Abteilungen zu Auftrag hinzufügen und bei Ausschlager Druck definieren?) [FormFehlmengeCount.cs] - ✅ : Neue Aufgabe Screen erstellen. [FormNeueAufgabe.cs] -- ✅ : Neuer Konstruktor für Auftragliste "Finishing" oder "Aufgelegt". (aufgelegte Aufträge die noch nicht [Auftrag.cs] -- ✅ : Neuer Konstruktor für Auftragliste "Rampe". (abgeholte Aufträge die noch nicht aufgelegt sind) [Auftrag.cs] - ✅ : Nur die Kunden der Aufträge als Liste anzeigen wäre möglich. Macht die Auswahl für das Personal einfacher weil 90% bereits weg fallen. [FormFehlmengeCount.cs] +- ✅ : Sortierung nach Status und Tag. [FormExpedit.cs] - ✅ : Spalten besser erkennbar gestalten damit Mirka die Spalte trifft wenn RechtsClick. [FormExpedit.cs] -- ✅ : Statt Neuen Auftrag wird Auftragsliste mit Status "abgeholt" angezeigt. Dadurch muss Aufleger weder scannen noch Namen eintippen und suchen. [FormWSVerfolgung.cs] -- ✅ : Wenn Fahrer Auftragverwaltung öffnet werden Aufträge mit AuftragStatus "Fertig" angezeigt. Fahrer können dann als "Ausgeliefert" markieren. [FormMain.cs] -- ✅ : Wenn Fahrer registriert kann nur NeuerAuftrag aufgerufen werden. Dort kann er Aufträge erstellen mit dem Status "Abgeholt" (Wichtig für Auftragauswahl bei Waschstraße) [FormMain.cs] -- ✅ : Wenn kein Auftrag gefunden wird, kann ein neuer erstellt werden. [FormWSVerfolgung.cs] +- ✅ : StartUp von Expedit verfeinern. [FormExpedit.cs] +- ✅ : Status manchmal falsch [FormExpedit.cs] +- ✅ : Testen ob umbenennen funktioniert. [FormTourenplanung.cs] - ✅ : Wenn NeuerAuftrag gewählt Fach ändern nicht vergessen. [FormAusschlager.cs] - ✅ : Wenn NeuerAuftrag gewählt wie gehts weiter? [FormAusschlager.cs] -=== 🔄 OFFENE TODOs (21) === +=== 🔄 OFFENE TODOs (34) === - 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [FormExpedit.cs] - 🔄 Alle Icons in einer Spalte anzeigen? I für Anmerkung und ! für Aufgabe?? [FormMain.cs] - 🔄 Artikel Update weiter testen und programmieren. Für ArtikelKurzliste ausprogrammieren. [FormMain.cs] - 🔄 Auftragauswahl aufrufen statt NeuerAuftrag. (Wenn Fahrer Aufträge erstellen) [FormWSVerfolgung.cs] - 🔄 Ausprobieren ob die Ausrichtung jetzt richtig ist. Sowohl beim ersten wie auch zweiten Mal. [Funktionen.cs] +- 🔄 Datum HEUTE auch bei NeuerAuftrag?? [FormExpedit.cs] - 🔄 Deaktivieren wenn SPS funktioniert. Transport wird simuliert. [FormWSVerfolgung.cs] +- 🔄 Design des Controls anpassen. Eventuell im Designer erstellen. [KundenControl.cs] - 🔄 Einkommentieren wenn ArtikelUpdate auf ArtikelKurzliste umgestellt werden kann. [FormMain.cs] +- 🔄 Einmalige Kunden für Geschäft ermöglichen [FormExpedit.cs] - 🔄 Eventuell auch andere ListViews einbinden? [Funktionen.cs] +- 🔄 Filter für Regionen ermöglichen. [FormTourenplanung.cs] +- 🔄 Funktioniert mehrere KundenControls auf einmal DragDrop? [FormTourenplanung.cs] - 🔄 für Ladescreen den Progressbar programieren. (perplexity fragen wie der Status an einen anderen Screen übergeben werden kann) [FormMain.cs] - 🔄 Hier Settings speichern mit UserSettingsManager Klasse. [FormEinstellung.cs] +- 🔄 Kein Clone mehr wenn im Panel bewegt wird. Nur neue Position übernehmen. (Fahrreihenfolge) [UCTabPageLKW.cs] +- 🔄 Kein Clone wenn zwischen den Panelen bewegt wird. [UCTabPageLKW.cs] - 🔄 LadenScreen anzeigen etc. [FormMain.cs] +- 🔄 Max Clones von PanelKunde zu PanelTourenplanung. (Lieferrythmus eingeben?) [FormTourenplanung.cs] - 🔄 Nach Test und Rücksprache eventuell wieder umbauen. Benutzer.Rolle etc. [FormFehlmengeCount.cs] +- 🔄 OLV State speichern. [FormExpedit.cs] +- 🔄 Reihenfolge Spalten richtig stellen. [FormExpedit.cs] - 🔄 Settings hier ändern auf UserSettingsManager Klasse. [FormEinstellung.cs] +- 🔄 Speichern der Touren ermöglichen. Eventuell über .json oder .xml Datei? [FormTourenplanung.cs] - 🔄 Testen ob Get_ArtikelKurzliste funktioniert. [FormMain.cs] +- 🔄 Testen ob Scan mit Prompt bei Suchen funktioniert. Kundenummer und Text etc. (meherere QR-Codes teseten) [FormExpedit.cs] - 🔄 Testen ob SWS-QRCodes gelesen werden können. Nur notwendig bis alle SWS-QRCodes richtig gedruckt und gelesen werden. [Kunde.cs] - 🔄 Überlegen ob das der richtige Weg ist. Eventuell in Expedit sowohl KundeAufgabe wie auch AuftragAufgabe anzeigen? NOTWENDIG? [FormNeuerAuftrag.cs] - 🔄 Umbau in Switch. [FormWSVerfolgung.cs] - 🔄 UserSetting Properties eintragen und in EinstellungsScreen abrufen. [UserSettingsManager.cs] - 🔄 Weitere Properties von oben hier zuweisen [UserSettingsManager.cs] +- 🔄 Wenn GroupBox nicht notwendig, dann löschen. [FormExpedit.cs] - 🔄 Wenn kunde null dann return. [FormNeuerAuftrag.cs] - 🔄 Wenn Nachwäsche oder Müllwäsche alle Artikel anzeigen. [FormFehlmengeCount.cs] -Installation: 19.12.2025 11:14 +Installation: 13.01.2026 13:06 =====================================