diff --git a/AA-Forms/FormAufleger.Designer.cs b/AA-Forms/FormAufleger.Designer.cs index dde8d16..d760a08 100644 --- a/AA-Forms/FormAufleger.Designer.cs +++ b/AA-Forms/FormAufleger.Designer.cs @@ -80,7 +80,7 @@ this.tLPAuftrag.Dock = System.Windows.Forms.DockStyle.Fill; this.tLPAuftrag.ForeColor = System.Drawing.Color.Black; this.tLPAuftrag.Location = new System.Drawing.Point(0, 0); - this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tLPAuftrag.Margin = new System.Windows.Forms.Padding(4); this.tLPAuftrag.Name = "tLPAuftrag"; this.tLPAuftrag.RowCount = 4; this.tLPAuftrag.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F)); @@ -182,7 +182,7 @@ this.fLP_T5.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T5.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T5.Location = new System.Drawing.Point(1108, 66); - this.fLP_T5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.fLP_T5.Margin = new System.Windows.Forms.Padding(4); this.fLP_T5.Name = "fLP_T5"; this.fLP_T5.Size = new System.Drawing.Size(271, 551); this.fLP_T5.TabIndex = 19; @@ -195,7 +195,7 @@ this.fLP_T4.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T4.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T4.Location = new System.Drawing.Point(832, 66); - this.fLP_T4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.fLP_T4.Margin = new System.Windows.Forms.Padding(4); this.fLP_T4.Name = "fLP_T4"; this.fLP_T4.Size = new System.Drawing.Size(268, 551); this.fLP_T4.TabIndex = 18; @@ -208,7 +208,7 @@ this.fLP_T3.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T3.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T3.Location = new System.Drawing.Point(556, 66); - this.fLP_T3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.fLP_T3.Margin = new System.Windows.Forms.Padding(4); this.fLP_T3.Name = "fLP_T3"; this.fLP_T3.Size = new System.Drawing.Size(268, 551); this.fLP_T3.TabIndex = 17; @@ -221,7 +221,7 @@ this.fLP_T2.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T2.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T2.Location = new System.Drawing.Point(280, 66); - this.fLP_T2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.fLP_T2.Margin = new System.Windows.Forms.Padding(4); this.fLP_T2.Name = "fLP_T2"; this.fLP_T2.Size = new System.Drawing.Size(268, 551); this.fLP_T2.TabIndex = 16; @@ -309,7 +309,7 @@ this.fLP_T1.BackColor = System.Drawing.SystemColors.ControlLight; this.fLP_T1.Dock = System.Windows.Forms.DockStyle.Fill; this.fLP_T1.Location = new System.Drawing.Point(4, 66); - this.fLP_T1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.fLP_T1.Margin = new System.Windows.Forms.Padding(4); this.fLP_T1.Name = "fLP_T1"; this.fLP_T1.Size = new System.Drawing.Size(268, 551); this.fLP_T1.TabIndex = 15; @@ -320,7 +320,7 @@ this.textBoxScan.Dock = System.Windows.Forms.DockStyle.Fill; this.textBoxScan.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxScan.Location = new System.Drawing.Point(4, 687); - this.textBoxScan.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.textBoxScan.Margin = new System.Windows.Forms.Padding(4); this.textBoxScan.Name = "textBoxScan"; this.textBoxScan.Size = new System.Drawing.Size(268, 46); this.textBoxScan.TabIndex = 25; diff --git a/AA-Forms/FormAuftragDetail.Designer.cs b/AA-Forms/FormAuftragDetail.Designer.cs index 3be87cb..68cb570 100644 --- a/AA-Forms/FormAuftragDetail.Designer.cs +++ b/AA-Forms/FormAuftragDetail.Designer.cs @@ -42,8 +42,6 @@ this.labelContainer = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); - this.buttonSWS = new System.Windows.Forms.Button(); - this.buttonSpeichern = new System.Windows.Forms.Button(); this.label7 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.comboBoxPriority = new System.Windows.Forms.ComboBox(); @@ -89,17 +87,17 @@ // buttonFertig // this.buttonFertig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFertig.BackColor = System.Drawing.Color.Turquoise; + this.buttonFertig.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); this.buttonFertig.FlatAppearance.BorderSize = 0; this.buttonFertig.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonFertig.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.buttonFertig.ForeColor = System.Drawing.Color.Black; - this.buttonFertig.Location = new System.Drawing.Point(286, 615); + this.buttonFertig.Location = new System.Drawing.Point(557, 615); this.buttonFertig.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonFertig.Name = "buttonFertig"; this.buttonFertig.Size = new System.Drawing.Size(267, 50); this.buttonFertig.TabIndex = 14; - this.buttonFertig.Text = "Auftrag abschließen"; + this.buttonFertig.Text = "Speichern/Abschließen"; this.buttonFertig.UseVisualStyleBackColor = false; this.buttonFertig.Click += new System.EventHandler(this.buttonFertig_Click); // @@ -227,40 +225,6 @@ this.label6.TabIndex = 32; this.label6.Text = "schmutzig"; // - // buttonSWS - // - this.buttonSWS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSWS.BackColor = System.Drawing.Color.Yellow; - this.buttonSWS.FlatAppearance.BorderSize = 0; - this.buttonSWS.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonSWS.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonSWS.ForeColor = System.Drawing.Color.Black; - this.buttonSWS.Location = new System.Drawing.Point(14, 615); - this.buttonSWS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonSWS.Name = "buttonSWS"; - this.buttonSWS.Size = new System.Drawing.Size(267, 50); - this.buttonSWS.TabIndex = 34; - this.buttonSWS.Text = "Sonderetikett drucken"; - this.buttonSWS.UseVisualStyleBackColor = false; - this.buttonSWS.Click += new System.EventHandler(this.buttonSWS_Click); - // - // buttonSpeichern - // - this.buttonSpeichern.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSpeichern.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.buttonSpeichern.FlatAppearance.BorderSize = 0; - this.buttonSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonSpeichern.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.buttonSpeichern.ForeColor = System.Drawing.Color.Black; - this.buttonSpeichern.Location = new System.Drawing.Point(558, 615); - this.buttonSpeichern.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonSpeichern.Name = "buttonSpeichern"; - this.buttonSpeichern.Size = new System.Drawing.Size(267, 50); - this.buttonSpeichern.TabIndex = 36; - this.buttonSpeichern.Text = "Änderungen speichern"; - this.buttonSpeichern.UseVisualStyleBackColor = false; - this.buttonSpeichern.Click += new System.EventHandler(this.buttonSpeichern_Click); - // // label7 // this.label7.AutoSize = true; @@ -421,8 +385,6 @@ this.Controls.Add(this.comboBoxPriority); this.Controls.Add(this.label10); this.Controls.Add(this.label7); - this.Controls.Add(this.buttonSpeichern); - this.Controls.Add(this.buttonSWS); this.Controls.Add(this.label6); this.Controls.Add(this.label5); this.Controls.Add(this.pictureBoxMinus); @@ -471,8 +433,6 @@ private System.Windows.Forms.Label labelContainer; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; - private System.Windows.Forms.Button buttonSWS; - private System.Windows.Forms.Button buttonSpeichern; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label10; private System.Windows.Forms.ComboBox comboBoxPriority; diff --git a/AA-Forms/FormAuftragDetail.cs b/AA-Forms/FormAuftragDetail.cs index b010354..fdf3277 100644 --- a/AA-Forms/FormAuftragDetail.cs +++ b/AA-Forms/FormAuftragDetail.cs @@ -36,7 +36,7 @@ namespace Deckungsbeitrag //WENN AUFTRAG SPEICHERN private bool _tosave = false; - public bool tosave + public bool Tosave { get { return _tosave; } set @@ -44,15 +44,15 @@ namespace Deckungsbeitrag _tosave = value; if (_tosave) { - buttonSpeichern.Enabled = true; - buttonSpeichern.BackColor = Color.FromArgb(0,192,0); + buttonFertig.Enabled = true; + buttonFertig.BackColor = Color.FromArgb(0,192,0); } } } //WENN AUFTRAG ABZUSCHLIESSEN private bool _toclose = false; - public bool toclose + public bool Toclose { get { return _toclose; } set @@ -73,9 +73,6 @@ namespace Deckungsbeitrag //this.BackColor = Properties.Settings.Default.Wirlblau; labelContainer_TextChanged(this.labelContainer, EventArgs.Empty); - //SPEICHERN UND ABSCHLIESSEN BUTTONS WERDEN FUNKTIONSLOS UND GRAU - buttonSpeichern.Enabled = buttonFertig.Enabled = false; - buttonSpeichern.BackColor = buttonFertig.BackColor = Color.Gray; } public FormAuftragDetail(Auftrag auftrag, Benutzer benutzer) : this() { @@ -107,13 +104,13 @@ namespace Deckungsbeitrag if (this.auftrag.Typ != AuftragTyp.Inventur || (this.auftrag.Typ == AuftragTyp.Inventur & this.auftrag.Status == AuftragStatus.Herrichten)) Load_OLV(); else { - if (this.auftrag.Status == AuftragStatus.Warten) buttonSpeichern.Visible = buttonFertig.Visible = buttonSWS.Visible = false; + if (this.auftrag.Status == AuftragStatus.Warten) buttonFertig.Visible = false; Load_UCInventur(this.auftrag); } this.ClientSize = new Size(this.oLVArtikel.Right + 10, this.ClientSize.Height); //WENN STATUS VORBEREITET BUTTON FERTIG ENABLEN - if (auftrag.Status == AuftragStatus.Vorbereitet) { buttonFertig.Enabled = true; buttonFertig.BackColor = Color.FromArgb(0, 192, 0); toclose = true; } + if (auftrag.Status == AuftragStatus.Vorbereitet) { buttonFertig.Enabled = true; buttonFertig.BackColor = Color.FromArgb(0, 192, 0); Toclose = true; } } private void Load_UCInventur(Auftrag _auftrag) @@ -179,7 +176,7 @@ namespace Deckungsbeitrag } private void comboBox_SelectedValueChanged(object sender, EventArgs e) { - tosave = true; + Tosave = true; } private void labelContainer_TextChanged(object sender, EventArgs e) { @@ -187,11 +184,48 @@ namespace Deckungsbeitrag else { this.pictureBoxMinus.Enabled = this.pictureBoxDirtMinus.Enabled = true; this.pictureBoxMinus.BackColor = this.pictureBoxDirtMinus.BackColor = Color.Red; } } + //ÄNDERUNGEN SPEICHERN + private void AuftragSpeichern() + { + auftrag.Liefertag = dTPLiefertag.Value; + auftrag.ContainerClean = int.Parse(this.labelContainer.Text); + auftrag.Container = int.Parse(this.labelContDirt.Text); + auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID; + auftrag.Priority = this.comboBoxPriority.SelectedIndex == -1 ? Priority.None : ((Priority)this.comboBoxPriority.SelectedItem); + auftrag.ZusatzInfo = this.textBoxZusatz.Text; + auftrag.Save(); + + if (auftrag.Typ == AuftragTyp.Regelmäßig || (auftrag.Typ == AuftragTyp.Inventur & auftrag.Status == AuftragStatus.Herrichten)) + { + foreach (OLVListItem item in this.oLVArtikel.Items) + { + AuftragArtikel art = (AuftragArtikel)item.RowObject; + if (item.Checked) art.Erledigt = true; + else art.Erledigt = false; + + art.Save(); + } + if (auftrag.Typ == AuftragTyp.Inventur) + { + WriteToCSV(dictionary); + } + } + Tosave = false; + } + //SCHMUTZWÄSCHESCHEIN DRUCKEN + private void EtikettDrucken() + { + //DONE: Bestand von allen Artikeln speichern und für Druck vorbereiten. + //TODO: Erstellen von SonderAuftrag und Drucken von Etikett testen. + if (MessageBox.Show("Möchtest du Etiketten für die Änderung drucken?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + Funktionen.SonderEtikett_Drucken(this.auftrag, dictionary); + etikettgedruckt = true; + } + } - /// - /// TOSAVE - /// + #region ToSave //BEI CLICK AUF CONTAINER +/- SPEICHERN WIRD AKITV private void Container_Click(object sender, EventArgs e) @@ -212,7 +246,7 @@ namespace Deckungsbeitrag if (pb.Name.ToString().Contains("Minus")) cont--; this.labelContainer.Text = cont.ToString(); } - tosave = true; + Tosave = true; } //BEI CLICK AUF DATUM SPEICHERN WIRD AKTIV @@ -224,7 +258,7 @@ namespace Deckungsbeitrag if (ctr.Name.Contains("dTP")) { ctr.Enabled = true; - tosave = true; + Tosave = true; } } } @@ -233,67 +267,11 @@ namespace Deckungsbeitrag private void oLVArtikel_ItemCheck(object sender, ItemCheckEventArgs e) { ObjectListView olv = (ObjectListView)sender; - if (e.NewValue != e.CurrentValue) { tosave = true; } - } - - - - /// - /// TOCLOSE - /// - private void oLVArtikel_ItemChecked(object sender, ItemCheckedEventArgs e) - { - ObjectListView olv = (ObjectListView)sender; - if (olv.Items.Count == olv.CheckedItems.Count) toclose = true; - foreach(OLVListItem item in olv.CheckedItems) - { - AuftragArtikel auftragArtikel = (AuftragArtikel)item.RowObject; - auftragArtikel.Erledigt = true; - auftragArtikel.Save(); - } - } - - /// - /// BUTTONS - /// - - //ÄNDERUNGEN SPEICHERN - private void buttonSpeichern_Click(object sender, EventArgs e) - { - if (tosave) - { - auftrag.Liefertag = dTPLiefertag.Value; - auftrag.ContainerClean = int.Parse(this.labelContainer.Text); - auftrag.Container = int.Parse(this.labelContDirt.Text); - auftrag.ArbeiterID = this.comboBoxFahrer.SelectedIndex == -1 ? null : ((Benutzer)this.comboBoxFahrer.SelectedItem).BenutzerID; - auftrag.Priority = this.comboBoxPriority.SelectedIndex == -1 ? Priority.None : ((Priority)this.comboBoxPriority.SelectedItem); - auftrag.ZusatzInfo = this.textBoxZusatz.Text; - auftrag.Save(); - - if (auftrag.Typ == AuftragTyp.Regelmäßig || (auftrag.Typ == AuftragTyp.Inventur & auftrag.Status == AuftragStatus.Herrichten)) - { - foreach (OLVListItem item in this.oLVArtikel.Items) - { - AuftragArtikel art = (AuftragArtikel)item.RowObject; - if (item.Checked) art.Erledigt = true; - else art.Erledigt = false; - - art.Save(); - } - if (auftrag.Typ == AuftragTyp.Inventur) - { - WriteToCSV(dictionary); - } - } - tosave = false; - } - - - this.DialogResult = DialogResult.OK; - this.Close(); - + if (e.NewValue != e.CurrentValue) { Tosave = true; } } + #endregion + #region Button-Click //AUFTRAG ABBRECHEN private void buttonAbbrechen_Click(object sender, EventArgs e) { @@ -315,26 +293,51 @@ namespace Deckungsbeitrag this.DialogResult = DialogResult.Cancel; this.Close(); } - + //AUFTRAG ABSCHLIESSEN private void buttonFertig_Click(object sender, EventArgs e) { - if (toclose) + EtikettDrucken(); + if (Tosave) AuftragSpeichern(); + if (Toclose) { - if (auftrag.Typ < AuftragTyp.Standerhöhung || auftrag.Typ > AuftragTyp.Regelmäßig) - if (int.Parse(this.labelContainer.Text) == 0) if (meldung.NoCleanContainer() == DialogResult.OK) return; + if (int.Parse(this.labelContainer.Text) == 0) + { + switch (auftrag.Typ) + { + case AuftragTyp.Geschäft: + meldung.NoCleanContainer(); + return; + case AuftragTyp.Standart: + meldung.NoCleanContainer(); + return; + case AuftragTyp.Inventur: + break; + case AuftragTyp.SOLL_Erhoehung: + break; + case AuftragTyp.SOLL_Verminderung: + break; + case AuftragTyp.Regelmäßig: + break; + case AuftragTyp.AufAbruf: + meldung.NoCleanContainer(); + return; + case AuftragTyp.Laufzettel: + break; + default: + break; + } + } if (int.Parse(this.labelContainer.Text) != auftrag.ContainerClean) { switch (meldung.DifferentCleanContainer()) { case DialogResult.Cancel: - break; + return; case DialogResult.Yes: { auftrag.ContainerClean = int.Parse(this.labelContainer.Text); - auftrag.Liefertag = dTPLiefertag.Value; - //WENN BEARBEITET UND AUSGEDRUCKT WIRD GEDRUCKT VERÄNDERT UND ERSTELLT IST URSPRUNGSDATUM auftrag.Gedruckt = DateTime.Now; auftrag.GedrucktVon = benutzer.BenutzerID; auftrag.Status = AuftragStatus.Fertig; @@ -346,25 +349,15 @@ namespace Deckungsbeitrag } else nocont = false; - DialogResult result = Funktionen.Etikett_Drucken(auftrag, nocont); - if (result == DialogResult.OK) - { - this.auftrag.Save(); - this.Close(); - } + Funktionen.Etikett_Drucken(auftrag, nocont); } break; case DialogResult.No: { auftrag.ContainerClean = int.Parse(this.labelContainer.Text); - auftrag.Liefertag = dTPLiefertag.Value; - //WENN BEARBEITET UND NICHT GEDRUCKT WIRD ERSTELLT VERÄNDERT UND GEDRUCKT IST URSPRUNGSDATUM auftrag.Erstellt = DateTime.Now; auftrag.ErstelltVon = (int)benutzer.BenutzerID; auftrag.Status = AuftragStatus.Fertig; - - this.auftrag.Save(); - this.Close(); } break; default: @@ -376,8 +369,10 @@ namespace Deckungsbeitrag auftrag.Erledigt = DateTime.Now; auftrag.ErledigtVon = (int)benutzer.BenutzerID; auftrag.Status = AuftragStatus.Fertig; - auftrag.Save(); } + auftrag.Save(); + + // Wenn Inventur wird Fertig-File erstellt. if (auftrag.Typ == AuftragTyp.Inventur) { string loadPath = Path.Combine(ConfigurationManager.AppSettings["DateiSavePfad"], "Listen\\Inventuren") ?? "Inventuren"; @@ -390,30 +385,32 @@ namespace Deckungsbeitrag File.Delete(Path.Combine(loadPath, invFiles[0])); } } - toclose = tosave = false; + Toclose = Tosave = false; } this.DialogResult = DialogResult.OK; this.Close(); - } - //SCHMUTZWÄSCHESCHEIN DRUCKEN - private void buttonSWS_Click(object sender, EventArgs e) + + #endregion + + /// + /// TOCLOSE + /// + private void oLVArtikel_ItemChecked(object sender, ItemCheckedEventArgs e) { - //TODO: Bestand von allen Artikeln speichern und für Druck vorbereiten. - //TODO: Eventuell die Zahlen in CSV speichern und von dort für Druck verwenden?! - //TODO: Erstellen von SonderAuftrag und Drucken von Etikett testen. - if (MessageBox.Show("Möchtest du Etiketten für die Änderung drucken?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + ObjectListView olv = (ObjectListView)sender; + if (olv.Items.Count == olv.CheckedItems.Count) Toclose = true; + foreach(OLVListItem item in olv.CheckedItems) { - Funktionen.SonderEtikett_Drucken(this.auftrag, dictionary); - - - etikettgedruckt = true; + AuftragArtikel auftragArtikel = (AuftragArtikel)item.RowObject; + auftragArtikel.Erledigt = true; + auftragArtikel.Save(); } - } + /// /// SonderAuftrag in CSV-Liste eintragen. Jede Änderung wird in eine Zeile eingetragen. Rek./NW/Rest /// @@ -491,10 +488,6 @@ namespace Deckungsbeitrag } - /// - /// UNUSED THINGS - /// - //PRINT PAGE FÜR DRUCK private void FormAuftragDetail_Shown(object sender, EventArgs e) { @@ -539,7 +532,7 @@ namespace Deckungsbeitrag ObjectListView olv = (ObjectListView)sender; AuftragArtikel auftragArtikel = (AuftragArtikel)e.RowObject; if (e.Column.Text == "Anzahl") diff = (int)e.Value - ((int)e.NewValue); - if (diff > 0) tosave = true; + if (diff > 0) Tosave = true; auftragArtikel.Anzahl = (int)e.NewValue; auftragArtikel.Save(); @@ -612,7 +605,7 @@ namespace Deckungsbeitrag } private void oLVArtikel_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { - tosave = true; + Tosave = true; } private void FormAuftragDetail_Resize(object sender, EventArgs e) @@ -629,7 +622,7 @@ namespace Deckungsbeitrag private void FormAuftragDetail_FormClosing(object sender, FormClosingEventArgs e) { - if (tosave) + if (Tosave) { if (MessageBox.Show("Möchtest du die Änderungen wirklich verwerfen?", "ÄNDERUNGEN VERWERFEN", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { diff --git a/AA-Forms/FormExpedit.cs b/AA-Forms/FormExpedit.cs index 77364b9..b65126b 100644 --- a/AA-Forms/FormExpedit.cs +++ b/AA-Forms/FormExpedit.cs @@ -355,7 +355,6 @@ namespace Deckungsbeitrag dirtCol.ShowTextInHeader = false; dirtCol.MinimumWidth = dirtCol.MaximumWidth = 80; } - var cleanCol = Find("Sauber"); if (cleanCol != null) { @@ -386,6 +385,12 @@ namespace Deckungsbeitrag fertigCol.MinimumWidth = fertigCol.MaximumWidth = 80; } + // --- Tour-Column --- + var tourCol = Find("Tour"); + if (tourCol != null) + { + if (this.benutzer.Rolle != BenutzerRolle.Expedit || this.benutzer.Rolle != BenutzerRolle.Frottee) tourCol.IsEditable = true; + } } private void Olv_CellToolTipShowing(object sender, ToolTipShowingEventArgs e) { @@ -566,7 +571,7 @@ namespace Deckungsbeitrag } break; default: - if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.Standerhöhung || _auftrag.Typ == AuftragTyp.Standverminderung || _auftrag.Typ == AuftragTyp.Inventur) + if (_auftrag.Typ == AuftragTyp.Regelmäßig || _auftrag.Typ == AuftragTyp.SOLL_Erhoehung || _auftrag.Typ == AuftragTyp.SOLL_Verminderung || _auftrag.Typ == AuftragTyp.Inventur) { FormAuftragDetail auftragDetail = new FormAuftragDetail(_auftrag, this.benutzer); if (auftragDetail.ShowDialog() == DialogResult.OK) @@ -965,18 +970,22 @@ namespace Deckungsbeitrag e.Cancel = true; return; } - else if (meldung.GetFrage(this, $"Möchtest du die gewählte Zelle wirklich bearbeiten?", false) == DialogResult.No) { e.Cancel = true; return; } + + if (meldung.GetFrage(this, $"Möchtest du die gewählte Zelle wirklich bearbeiten?", false) == DialogResult.No) { e.Cancel = true; return; } if (e.Column.AspectName == "Tour") { Saison saison = Saison.GetAktivSaison(); List list = Tour.GetSaisonListe(saison); + var row = (View_Auftrag_Expedit)e.RowObject; + var aktuelleTour = list.Find(x => x.TourID == row.TourID); + ComboBox touren = new ComboBox { Bounds = e.CellBounds, DropDownStyle = ComboBoxStyle.DropDownList, DisplayMember = "Bezeichnung", - DataSource = list + DataSource = list, }; e.Control = touren; } diff --git a/AA-Forms/FormFehlmengeCount.cs b/AA-Forms/FormFehlmengeCount.cs index 38bddd3..60e5116 100644 --- a/AA-Forms/FormFehlmengeCount.cs +++ b/AA-Forms/FormFehlmengeCount.cs @@ -363,6 +363,11 @@ namespace Deckungsbeitrag } int buttons = flowPanel.Controls.OfType