Translation umgesetzt. Änderungen in FormListe und FormFehlmengeCount.

This commit is contained in:
Kilian Wirl 2026-07-03 09:39:55 +02:00
parent 53d7505353
commit f871642e53
17 changed files with 621 additions and 705 deletions

View File

@ -189,6 +189,7 @@
this.Name = "CustomInputBox";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "CustomInputBox";
this.Load += new System.EventHandler(this.CustomInputBox_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);

View File

@ -16,27 +16,98 @@ namespace Deckungsbeitrag.AA_Forms
{
private QwertzKeyboard keyboard;
private readonly bool isNumeric;
//private readonly string frage;
//private readonly string title;
//private readonly string eingabe;
private bool isFallback = false;
private string title;
private string caption;
private string todo;
private string eingabe;
private string numeric;
public string text;
public CustomInputBox()
private static string Title;
private static string Caption;
private static string Todo;
private static string Eingabe;
public CustomInputBox(string numeric)
{
InitializeComponent();
ControlBox = false;
}
public CustomInputBox(string Frage, string Title, string Eingabe, string numeric) : this()
{
if (numeric == "isNumeric") { this.textBoxText.AccessibleName = "isNumeric"; this.isNumeric = true; }
if (numeric == "isAlpha") { this.textBoxText.AccessibleName = "isAlpha"; this.isNumeric = false; }
if (numeric == "isCalc") { this.textBoxText.AccessibleName = "isClac"; this.isNumeric = true; }
this.labelFrage.Text = Frage;
this.labelEingabe.Text = Eingabe + ":";
this.Text = Title;
if (isNumeric) this.textBoxText.Text = "1";
else this.textBoxText.Text = string.Empty;
}
public CustomInputBox(string frage, string title, string eingabe, string numeric) : this(numeric)
{
Caption = frage;
Eingabe = eingabe;
Title = title;
}
/// <summary>
/// Aufrufen der CustomInputBox. Besser .Show verwenden.
/// </summary>
/// <param name="title">Key von BoxTitel</param>
/// <param name="caption">Key von Message-Text</param>
/// <param name="todo">Key von ToDo</param>
/// <param name="eingabe">Hinweis welche Eingabe erwartet wird</param>
/// <param name="numeric">Eingabeformat für VirtuelKeyboard (isNumeric, isCalc oder isAlpha)</param>
public CustomInputBox(string title, string caption, string todo, string eingabe, string Numeric) : this(Numeric)
{
this.title = title;
this.caption = caption;
this.todo = todo;
this.eingabe = eingabe;
}
/// <summary>
/// Aufrufen der CustomInputBox.
/// </summary>
/// <param name="title">Key von BoxTitel</param>
/// <param name="caption">Key von Message-Text</param>
/// <param name="todo">Key von ToDo</param>
/// <param name="eingabe">Hinweis welche Eingabe erwartet wird</param>
/// <param name="numeric">Eingabeformat für VirtuelKeyboard (isNumeric, isCalc oder isAlpha)</param>
public static DialogResult Show(string title, string caption, string todo, string eingabe, string numeric)
{
CustomInputBox inputBox = new CustomInputBox(title, caption, todo, eingabe, numeric);
return inputBox.ShowDialog();
}
private void CustomInputBox_Load(object sender, EventArgs e)
{
GetTranslation(title, caption, todo, eingabe);
this.buttonOK.Text = TranslationService.T("Button.Ok");
this.buttonAbbrechen.Text = TranslationService.T("Button.Abbrechen");
this.Text = Title;
this.labelFrage.Text = Caption + " ";
this.labelFrage.Text += !string.IsNullOrWhiteSpace(Todo) ? Todo : string.Empty;
this.labelEingabe.Text = !string.IsNullOrWhiteSpace(Eingabe) ? Eingabe + ":" : string.Empty;
if (isNumeric) this.textBoxText.Text = "1";
else this.textBoxText.Text = string.Empty;
}
/// <summary>
/// Die strings werden aus der translation.json ausgelesen und übersetzt.
/// </summary>
/// <param name="title"></param>
/// <param name="caption"></param>
/// <param name="todo"></param>
/// <param name="eingabe"></param>
private static void GetTranslation(string title, string caption, string todo, string eingabe)
{
if (title != null) Title = TranslationService.T(title);
if (caption != null) Caption = TranslationService.T(caption);
if (todo != null) Todo = TranslationService.T(todo);
if (eingabe != null) Eingabe = TranslationService.T(eingabe);
}
private void TextBoxText_Click(object sender, EventArgs e)
@ -84,7 +155,7 @@ namespace Deckungsbeitrag.AA_Forms
if (int.TryParse(textBoxText.Text, out int value)) this.text = textBoxText.Text;
else
{
MessageBox.Show("Bitte nur ganze Zahlen eingeben.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
CustomMessageBox.Show("Titel.Fehler", "Text.Fehler.NurZahlen", null, new string[] { "Ok" });
e.Cancel = true;
this.textBoxText.Clear();
}
@ -94,5 +165,29 @@ namespace Deckungsbeitrag.AA_Forms
this.text = textBoxText.Text;
}
}
/// <summary>
/// Tastendruck wird erkannt und verarbeitet.
/// </summary>
/// <param name="keyData"></param>
/// <returns></returns>
protected override bool ProcessDialogKey(Keys keyData)
{
// Taste T löst Übersetzung in FallbackLanguage aus bzw. setzt die Übersetzung wieder auf CurrentLanguage zurück.
if (Form.ModifierKeys == Keys.None && keyData == Keys.T)
{
if (!isFallback) TranslationService.SetLanguage(TranslationService.FallbackLanguage);
else TranslationService.SetLanguage(Program._settings.Culture);
isFallback = !isFallback;
CustomInputBox_Load(this, null);
return true;
}
return base.ProcessDialogKey(keyData);
}
}
}

View File

@ -35,8 +35,8 @@
this.tLPButtons = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.buttonAlternativ = new System.Windows.Forms.Button();
this.buttonAbbrechen = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.tLPButtons.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
@ -99,8 +99,8 @@
this.tLPButtons.Name = "tLPButtons";
this.tLPButtons.RowCount = 1;
this.tLPButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tLPButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tLPButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tLPButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
this.tLPButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
this.tLPButtons.Size = new System.Drawing.Size(647, 60);
this.tLPButtons.TabIndex = 10;
//
@ -127,7 +127,7 @@
this.buttonOK.FlatAppearance.BorderSize = 0;
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonOK.ForeColor = System.Drawing.Color.White;
this.buttonOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.buttonOK.Location = new System.Drawing.Point(5, 5);
this.buttonOK.Margin = new System.Windows.Forms.Padding(5);
this.buttonOK.Name = "buttonOK";
@ -138,26 +138,6 @@
this.buttonOK.UseVisualStyleBackColor = false;
this.buttonOK.Click += new System.EventHandler(this.Button_Click);
//
// buttonAbbrechen
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.CausesValidation = false;
this.buttonAbbrechen.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonAbbrechen.FlatAppearance.BorderColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.White;
this.buttonAbbrechen.Location = new System.Drawing.Point(425, 5);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(5);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(200, 50);
this.buttonAbbrechen.TabIndex = 5;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.Button_Click);
//
// buttonAlternativ
//
this.buttonAlternativ.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -168,7 +148,7 @@
this.buttonAlternativ.FlatAppearance.BorderSize = 0;
this.buttonAlternativ.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAlternativ.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAlternativ.ForeColor = System.Drawing.Color.White;
this.buttonAlternativ.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.buttonAlternativ.Location = new System.Drawing.Point(215, 5);
this.buttonAlternativ.Margin = new System.Windows.Forms.Padding(5);
this.buttonAlternativ.Name = "buttonAlternativ";
@ -179,6 +159,26 @@
this.buttonAlternativ.Visible = false;
this.buttonAlternativ.Click += new System.EventHandler(this.Button_Click);
//
// buttonAbbrechen
//
this.buttonAbbrechen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbbrechen.BackColor = System.Drawing.Color.Red;
this.buttonAbbrechen.CausesValidation = false;
this.buttonAbbrechen.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonAbbrechen.FlatAppearance.BorderColor = System.Drawing.Color.Red;
this.buttonAbbrechen.FlatAppearance.BorderSize = 0;
this.buttonAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAbbrechen.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonAbbrechen.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(53)))), ((int)(((byte)(101)))));
this.buttonAbbrechen.Location = new System.Drawing.Point(425, 5);
this.buttonAbbrechen.Margin = new System.Windows.Forms.Padding(5);
this.buttonAbbrechen.Name = "buttonAbbrechen";
this.buttonAbbrechen.Size = new System.Drawing.Size(200, 50);
this.buttonAbbrechen.TabIndex = 5;
this.buttonAbbrechen.Text = "Abbrechen";
this.buttonAbbrechen.UseVisualStyleBackColor = false;
this.buttonAbbrechen.Click += new System.EventHandler(this.Button_Click);
//
// CustomMessageBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);

View File

@ -23,11 +23,26 @@ namespace Deckungsbeitrag.AA_Forms
private string todo;
private string[] buttons;
private static string[] Inputs;
private static string Title;
private static string Caption;
private static string Todo;
private static string[] Buttons;
/// <summary>
/// Ist die Übersetzung in FallbackLanguage oder nicht.
/// </summary>
private bool isFallback = false;
/// <summary>
/// Aufrufen der CustomMessageBox. Besser .Show verwenden.
/// </summary>
/// <param name="title"></param>
/// <param name="caption"></param>
/// <param name="todo"></param>
/// <param name="buttons"></param>
public CustomMessageBox(string title, string caption, string todo, string[] buttons)
{
InitializeComponent();
@ -35,37 +50,64 @@ namespace Deckungsbeitrag.AA_Forms
this.title = title;
this.caption = caption;
this.todo = todo;
this.buttons = buttons;
}
/// <summary>
/// Aufrufen der CustomMessageBox.
/// </summary>
/// <param name="title">FormTitel</param>
/// <param name="caption">Message-Text</param>
/// <param name="todo">ToDo</param>
/// <param name="buttons">Welche Buttonnamen [0]=Button OK, [1]=Button Abbrechen, [2]=Button Alternative</param>
public static DialogResult Show(string title, string caption, string todo, string[] buttons)
/// <param name="title">Key von FormTitel</param>
/// <param name="caption">Key von Message-Text</param>
/// <param name="todo">Key von ToDo</param>
/// <param name="buttons">Buttonnamen [0]=Button OK, [1]=Button Abbrechen, [2]=Button Alternative (werden nachträglich in Key generiert)</param>
/// <param name="inputs">Infotexte die in der Message angezeigt werden sollen. Nur wenn todo = NULL</param>
public static DialogResult Show(string title, string caption, string todo, string[] buttons, string[] inputs = null)
{
if (inputs != null) Inputs = inputs;
CustomMessageBox messageBox = new CustomMessageBox(title, caption, todo, buttons);
return messageBox.ShowDialog();
}
/// <summary>
/// Beim Laden der Box wird die Übersetzung geholt sowie die Texte in den Controls gesetzt und die Buttons aktualisiert.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CustomMessageBox_Load(object sender, EventArgs e)
{
GetTranslation(title, caption, todo);
Buttons = buttons;
Buttons = this.buttons;
this.labelText.Text = Caption;
this.Text = Title;
if (Todo == null)
{
this.labelToDo.Visible = false;
if (Inputs != null)
{
this.labelToDo.Text = string.Empty;
foreach (string s in Inputs) this.labelToDo.Text += s + "\n";
}
else this.labelToDo.Visible = false;
}
else this.labelToDo.Text = Todo;
GetButtons();
}
/// <summary>
/// Die Buttons werden entsprechend mit übersetztem Text und AccessibleName aktualisiert.
/// </summary>
private void GetButtons()
{
if (Buttons.Length == 1)
@ -78,7 +120,7 @@ namespace Deckungsbeitrag.AA_Forms
{
this.buttonAbbrechen.Visible = true;
this.buttonOK.Text = TranslationService.T($"Button.{Buttons[0]}");
this.buttonAbbrechen.Text = TranslationService.T($"button.{Buttons[1]}");
this.buttonAbbrechen.Text = TranslationService.T($"Button.{Buttons[1]}");
this.buttonOK.AccessibleName = Buttons[0];
this.buttonAbbrechen.AccessibleName = Buttons[1];
}
@ -93,13 +135,29 @@ namespace Deckungsbeitrag.AA_Forms
this.buttonAlternativ.AccessibleName = Buttons[2];
}
}
/// <summary>
/// Die strings werden aus der translation.json ausgelesen und übersetzt.
/// </summary>
/// <param name="title"></param>
/// <param name="caption"></param>
/// <param name="todo"></param>
private static void GetTranslation(string title, string caption, string todo)
{
Title = TranslationService.T(title);
Caption = TranslationService.T(caption);
Todo = TranslationService.T(todo);
if (todo != null) Todo = TranslationService.T(todo);
}
/// <summary>
/// Wenn Button geklickt wird, wird nach AccessibleName der DialogStatus gesetzt. Danach wird die Box geschlossen.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
@ -119,12 +177,23 @@ namespace Deckungsbeitrag.AA_Forms
this.Close();
}
/// <summary>
/// Tastendruck wird erkannt und verarbeitet.
/// </summary>
/// <param name="keyData"></param>
/// <returns></returns>
protected override bool ProcessDialogKey(Keys keyData)
{
// Taste T löst Übersetzung aus.
// Taste T löst Übersetzung in FallbackLanguage aus bzw. setzt die Übersetzung wieder auf CurrentLanguage zurück.
if (Form.ModifierKeys == Keys.None && keyData == Keys.T)
{
this.Close();
if (!isFallback) TranslationService.SetLanguage(TranslationService.FallbackLanguage);
else TranslationService.SetLanguage(Program._settings.Culture);
isFallback = !isFallback;
CustomMessageBox_Load(this, null);
return true;
}

View File

@ -1,5 +1,6 @@
using BrightIdeasSoftware;
using DatenDB;
using Deckungsbeitrag.AA_Forms;
using Deckungsbeitrag.AA_Klassen;
using Deckungsbeitrag.UserControls;
//using HarfBuzzSharp;
@ -268,7 +269,7 @@ namespace Deckungsbeitrag
}
}
}
else { MessageBox.Show("Bitte nur ganze Zahlen eingeben.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Cancel = true; }
else { CustomMessageBox.Show("Titel.Fehler", "Text.Fehler.NurZahlen", null, new string[] { "Ok" }); e.Cancel = true; }
this.objectListViewArtikel.RefreshObject(e.RowObject);
}

View File

@ -1,5 +1,6 @@
using BrightIdeasSoftware;
using DatenDB;
using Deckungsbeitrag.AA_Forms;
using Npgsql;
using System;
using System.CodeDom;
@ -354,10 +355,10 @@ namespace Deckungsbeitrag
else _kunde = Kunde.GetKunde(null, null, text.ToLower());
// Wenn kein Auftrag gefunden muss der Zettel zum Expedit gebracht werden. ÜBERGANGSZEIT FALLS AUFTRAG NICHT VON FAHRER ERFASST.
if (_kunde == null) { MessageBox.Show("Der Auftrag konnte nicht gefunden werden. Bring die Karte zur Mirka.", "ACHTUNG", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
if (_kunde == null) { CustomMessageBox.Show("Titel.Achtung", "Text.Achtung.AuftragNotFound", null, new string[] { "Ok" }); ; return; }
List<Auftrag> auftList = Auftrag.FindeAuftragVonKunde(_kunde, zusatz, null, (DateTime?)null);
if (auftList.Count == 0) { meldung.GetFehler(this, "Es konnte kein Auftrag zugewünschten Kunden gefunden werden.\nBitte Informiere deinen Vorgesetzten."); return; }
if (auftList.Count == 0) { CustomMessageBox.Show("Titel.Achtung", "Text.Achtung.AuftragNotFound", "Todo.VorgesetzenInformieren", new string[] { "Ok" }); return; }
// Alten Auftrag Speichern (Status Gewaschen) wenn neuer Auftrag gefunden wurde.
if (auftrag != null)

View File

@ -127,7 +127,7 @@ namespace Deckungsbeitrag.AA_Forms
if (e.Button == MouseButtons.Right)
{
if (MessageBox.Show($"Möchtest du den Auftrag vom Kunde {exAuftrag.KundeName} mit Liefertag {exAuftrag.Liefertag:d} auswählen?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
if (CustomMessageBox.Show("Titel.Frage", "Text.Frage.AuswahlBestaetigen", null, new string[] { "Ja", "Nein" }, new string[] { $"{exAuftrag.KundeName}", $"{exAuftrag.Liefertag:d}" }) == DialogResult.No) return;
}
this.kunde = Kunde.GetKunde(null, exAuftrag.KundeID, null);

View File

@ -148,7 +148,7 @@ namespace Deckungsbeitrag
{
var cultures = new []
{
new { Code = "de-DE", Name = "Deutsch" },
new { Code = "de-AT", Name = "Deutsch" },
new { Code = "en-US", Name = "English (United States) -> Englisch" },
new { Code = "bs-BA", Name = "Bosanski (Bosna) -> Bosnisch" },
new { Code = "bg-BG", Name = "български (България) -> Bulgarisch" },

View File

@ -225,9 +225,8 @@ namespace Deckungsbeitrag
private async void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{
AuftragTyp? auftragTyp = null;
string[] buttons = { "Geschäft", "Abbrechen", "Standart" };
CustomMessageBox messageBox = new CustomMessageBox($"{TranslationService.T("Titel.Auswahl")}", $"{TranslationService.T("Text.Auswahl.Auftrag")}", null, buttons);
CustomMessageBox messageBox = new CustomMessageBox("Titel.Auswahl", "Text.Auswahl.Auftrag", null, new string[] { "Geschäft", "Abbrechen", "Standart" });
if (messageBox.ShowDialog() == DialogResult.Ignore)
{
auftragTyp = (AuftragTyp?)Enum.Parse(typeof(AuftragTyp), messageBox.buttontext);
@ -886,11 +885,7 @@ namespace Deckungsbeitrag
private void HandleBatchAbschliessen(ObjectListView olv)
{
var count = olv.CheckedItems.Count;
Program.title = TranslationService.T("Titel.Frage");
Program.caption = TranslationService.T("Text.Frage.BatchAbschließen");
Program.todo = null;
Program.buttons = new string[] { TranslationService.T("Button.Ja"), TranslationService.T("Button.Nein") };
var result = CustomMessageBox.Show(Program.title, Program.caption, Program.todo, Program.buttons);
var result = CustomMessageBox.Show("Titel.Frage", "Text.Frage.BatchAbschließen", null, new string[] { "Ja", "Nein" });
if (result == DialogResult.No)
return;
@ -965,11 +960,7 @@ namespace Deckungsbeitrag
if (this.auftrag.ContainerClean > 10)
{
Program.title = TranslationService.T("Titel.Frage");
Program.caption = TranslationService.T("Text.Frage.EtikettContainer");
Program.todo = null;
Program.buttons = new string[] { TranslationService.T("Button.Ja"), TranslationService.T("Button.Nein") };
var res = CustomMessageBox.Show(Program.title, Program.caption, Program.todo, Program.buttons);
var res = CustomMessageBox.Show("Titel.Frage", "Text.Frage.EtikettContainer", null, new string[] { "Ja", "Nein" });
nocont = (res == DialogResult.No);
}
@ -980,11 +971,7 @@ namespace Deckungsbeitrag
}
catch (Exception ex)
{
Program.title = TranslationService.T("Titel.Fehler");
Program.caption = TranslationService.T("Text.Fehler.Drucken");
Program.todo = TranslationService.T("ToDo.DruckFehler");
Program.buttons = new string[] { TranslationService.T("Button.Ok") };
CustomMessageBox.Show(Program.title, Program.caption, Program.todo, Program.buttons);
CustomMessageBox.Show("Titel.Fehler", "Text.Fehler.Drucken", "ToDo.DruckFehler", new string[] { "Ok" });
Program.AddFehler(this.benutzer, ex.Message, ex.StackTrace, null);
return false;
@ -1025,8 +1012,7 @@ namespace Deckungsbeitrag
if (this.auftrag.ContainerClean == 0)
{
string[] buttons = { "Ja", "Nein", "Abbrechen" };
CustomMessageBox messageBox = new CustomMessageBox($"{TranslationService.T("Titel.Frage")}", $"{TranslationService.T("Text.Frage.ContainerSauberNull")}", null, buttons);
CustomMessageBox messageBox = new CustomMessageBox("Titel.Frage", "Text.Frage.ContainerSauberNull", null, new string[] { "Ja", "Nein", "Abbrechen" });
rslt = messageBox.ShowDialog();
}
@ -1064,7 +1050,7 @@ namespace Deckungsbeitrag
letzterLiefertag = this.auftrag.Liefertag;
return;
}
CustomInputBox inputBox = new CustomInputBox($"{TranslationService.T("Text.Frage.ContainerAnzahl")}\n{TranslationService.T("ToDo.ContainerAnzahl")}", $"{TranslationService.T("Titel.Frage")}", $"{TranslationService.T("Containeranzahl")}", "isNumeric");
CustomInputBox inputBox = new CustomInputBox("Titel.Frage", "Text.Frage.ContainerAnzahl", "ToDo.ContainerAnzahl", "Containeranzahl", "isNumeric");
if (inputBox.ShowDialog() == DialogResult.OK)
{
eingabe = inputBox.text;
@ -1189,11 +1175,7 @@ namespace Deckungsbeitrag
if (this.auftrag.Status == AuftragStatus.Vorbereitet)
{
Program.title = TranslationService.T("Titel.Frage");
Program.caption = TranslationService.T("Text.Frage.ContainerSauberChanged");
Program.todo = null;
Program.buttons = new string[] { TranslationService.T("Button.Ja"), TranslationService.T("Button.Nein") };
if (CustomMessageBox.Show(Program.title, Program.caption, Program.todo, Program.buttons) == DialogResult.Yes)
if (CustomMessageBox.Show("Titel.Frage", "Text.Frage.ContainerSauberChanged", null, new string[] { "Ja", "Nein" }) == DialogResult.Yes)
{
Funktionen.Etikett_Drucken(this.auftrag, nocont);
}
@ -1233,12 +1215,8 @@ namespace Deckungsbeitrag
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
Program.title = TranslationService.T("Titel.Frage");
Program.caption = TranslationService.T("Text.Frage.TrelloKarteErstellen");
Program.todo = null;
Program.buttons = new string[] { TranslationService.T("Button.Ja"), TranslationService.T("Button.Nein") };
if (CustomMessageBox.Show(Program.title, Program.caption, Program.todo, Program.buttons) == DialogResult.No) { TrelloKarte = false; goto default; }
if (CustomMessageBox.Show("Titel.Frage", "Text.Frage.TrelloKarteErstellen", null, new string[] { "Ja", "Nein" }) == DialogResult.No) { TrelloKarte = false; goto default; }
try
{

View File

@ -530,7 +530,7 @@ namespace Deckungsbeitrag
}
private void EtikettDrucken()
{
if (MessageBox.Show("Möchtest du JETZT Etiketten für die erfolgten Änderung drucken?", "FRAGE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (CustomMessageBox.Show("Titel.Frage", "Text.Frage.EtiketteDrucken", null, new string[] { "Ja", "Nein" }) == DialogResult.Yes)
{
if (Funktionen.SonderEtikett_Drucken((int)this.kunde.KundeID, auftragDictionary, auftrag) == DialogResult.OK)
{
@ -686,7 +686,7 @@ namespace Deckungsbeitrag
{
if (auftrag != null)
{
if (nwClicked) if (MessageBox.Show("ZAHLEN VERWERFEN?", "ABBRECHEN", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { nwClicked = false; return; }
if (nwClicked) if (CustomMessageBox.Show("Titel.Frage", "Text.Frage.Verwerfen", null, new string[] { "Ja", "Nein" }) == DialogResult.No) { nwClicked = false; return; }
if (this.benutzer == null | (userid != null && !userid.Contains("reklamation")))
{
// AbteilungsStatus Begonnen wird hier gesetzt.

View File

@ -95,12 +95,12 @@ namespace Deckungsbeitrag
this.textBoxKunde.Location = new System.Drawing.Point(12, 16);
this.textBoxKunde.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxKunde.Name = "textBoxKunde";
this.textBoxKunde.Size = new System.Drawing.Size(393, 32);
this.textBoxKunde.Size = new System.Drawing.Size(393, 38);
this.textBoxKunde.TabIndex = 0;
this.textBoxKunde.Text = "Hier eingeben";
this.textBoxKunde.Click += new System.EventHandler(this.TextBoxKunde_Click);
this.textBoxKunde.TextChanged += new System.EventHandler(this.TextBoxKunde_TextChanged);
this.textBoxKunde.Leave += new System.EventHandler(this.TextBoxKunde_Leave);
this.textBoxKunde.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxKunde_KeyDown);
//
// label1
//

View File

@ -367,7 +367,7 @@ namespace Deckungsbeitrag
private void TextBoxKunde_TextChanged(object sender, EventArgs e)
{
TextBox textbox = (TextBox)sender;
if (!textbox.Text.StartsWith("SCAN") && textbox.Text.Length >= 4)
if ((!textbox.Text.StartsWith("SCAN") && textbox.Text.Length >= 4) || textbox.Text.StartsWith("?"))
{
// TextChanged tritt nur ein wenn x Sekunden keine Eingabe erfolgt. Logik befindet sich in Timer_Tick
timer.Stop(); // Alten Timer beenden
@ -377,56 +377,7 @@ namespace Deckungsbeitrag
private async void Timer_Tick(object sender, EventArgs e)
{
timer.Stop(); // Timer stoppen
if (textBoxKunde.ForeColor != Color.Black & !this.textBoxKunde.Text.ToLower().StartsWith("https")) { return; }
else
{
if (string.IsNullOrEmpty(textBoxKunde.Text) || this.textBoxKunde.Text == "Hier eingeben") { return; }
// Wenn kein Fragezeichen am Anfang wird Kundenliste erstellt.
if (!textBoxKunde.Text.StartsWith("?"))
{
string text;
if (textBoxKunde.Text.StartsWith("SCAN"))
{
if (textBoxKunde.Text.ToLower().StartsWith("scanhttps"))
{
int index = 1;
index += textBoxKunde.Text.IndexOf("=", index);
int i = textBoxKunde.Text.IndexOf("%", index);
text = textBoxKunde.Text.Substring(index, i - index);
textBoxKunde.Text = text;
}
else text = this.textBoxKunde.Text.Substring(4);
}
else text = this.textBoxKunde.Text;
if (kategorie == 0)
{
this.Kundenliste = Kunde.GetTmpList(text, this.kndService);
ListViewKunde_Load();
}
else
{
List<View_Auftrag_Expedit> _allÍtems = await View_Auftrag_Expedit.GetAuftragExpeditAsync(statusFilter: AuftragStatus.Gewaschen, typFilter: AuftragTyp.Standart, kategorie: kategorie, undFertig: true);
string term = text.Trim().ToLower();
if (!string.IsNullOrWhiteSpace(term))
{
var filtered = string.IsNullOrWhiteSpace(term) ? _allÍtems : _allÍtems.Where(x => x.KundeName != null && x.KundeName.ToLower().Contains(term)).ToList();
FillListView(filtered);
}
else FillListView(_allÍtems);
}
return;
}
else
{
this.listViewKunde.Visible = this.listViewKunde.Enabled = false;
this.buttonOK.Visible = this.buttonOK.Enabled = true;
this.Height = this.buttonOK.Bottom + 100;
} // Wenn Fragezeichen am Anfang wird OK-Button aktiviert.
}
TextBoxKunde_Leave(sender, e);
}
private void ListViewKunde_MouseClick(object sender, MouseEventArgs e)
{
@ -561,6 +512,13 @@ namespace Deckungsbeitrag
}
return;
}
else
{
this.listViewKunde.Visible = this.listViewKunde.Enabled = false;
this.buttonOK.Visible = this.buttonOK.Enabled = true;
this.Height = this.buttonOK.Bottom + 100;
} // Wenn Fragezeichen am Anfang wird OK-Button aktiviert.
}
private void ButtonNeuerAuftrag_Click(object sender, EventArgs e)
{
@ -574,5 +532,19 @@ namespace Deckungsbeitrag
{
if (keyboard != null) keyboard.Close();
}
private void TextBoxKunde_KeyDown(object sender, KeyEventArgs e)
{
TextBox txtScan = (TextBox)sender;
if (e.KeyCode == Keys.Enter)
{
e.SuppressKeyPress = true;
string code = txtScan.Text.Trim();
//txtScan.Clear();
if (!string.IsNullOrEmpty(code))
TextBoxKunde_Leave(txtScan, null);
}
}
}
}

View File

@ -6,7 +6,7 @@
</sectionGroup>
</configSections>
<appSettings>
<add key="ConnectionString" value="user id=postgres;password=Ki985941Wi;host=10.10.10.1;port=5432;database=Wirl_DB_17012023;Timeout=15" />
<add key="ConnectionString" value="user id=expedit;password=yZNN4xnsWM;host=10.10.10.1;port=5432;database=Wirl_DB_17012023;Timeout=15" />
<add key="SortimentPfad" value="N:\\TECHNIK\\Software\\Wirl-Verwaltung\\Listen\\Kundensortiment.txt" />
<add key="InventurPfad" value="N:\BÜRO\KUNDEN\INVENTUREN\Verwaltung" />
<add key="BildPfad" value="C:\\Users\\KilianWirl\\OneDrive - gehgassi GmbH\\Wäscherei Wirl\\Programme\\Deckungsbeitrag\\Deckungsbeitrag\\Star.png" />

View File

@ -161,17 +161,13 @@ namespace Deckungsbeitrag
_settings.Load();
// Laden der Translation.json
//ConvertTranslationJson();
ConvertTranslationJson();
// Check, Install und Update wenn Update vorhanden.
if (CheckAndInstallUpdate())
{
title = TranslationService.T("Titel.Achtung");
caption = TranslationService.T("Text.Achtung.UpdateFertig");
todo = TranslationService.T("ToDo.UpdateFertig");
buttons = new string[] { TranslationService.T("Button.Ok") };
CustomMessageBox.Show(title, caption, todo, buttons);
CustomMessageBox.Show("Titel.Achtung", "Text.Achtung.UpdateFertig", "ToDo.UpdateFertig", new string[] { "Ok" });
Software_Updated = true;
Settings.Default.LastSoftwareUpdate = DateTime.Now;
@ -222,8 +218,8 @@ namespace Deckungsbeitrag
if (userid.StartsWith("ms") | userid.StartsWith("ps"))
{
//FormShowUserControl showControl = new FormShowUserControl("Sprache");
//showControl.ShowDialog();
FormShowUserControl showControl = new FormShowUserControl("Sprache");
showControl.ShowDialog();
Maschine maschine = Maschine.GetMaschine(null, userid);
if (maschine == null)
@ -308,10 +304,9 @@ namespace Deckungsbeitrag
private static void ConvertTranslationJson()
{
//TODO: Pfad anpassen wenn LIVE.
TranslationService.Convert(
@"N:\TECHNIK\Software\Wirl-Verwaltung\Test\TranslationExcel.xlsx",
@"N:\TECHNIK\Software\Wirl-Verwaltung\Test\translations.json",
"Sheet1");
TranslationService.Convert(@"N:\TECHNIK\Software\Wirl-Verwaltung\Test\TranslationExcel.xlsx", @"N:\TECHNIK\Software\Wirl-Verwaltung\Test\translations.json", "Sheet1");
if (_settings.Culture == null) { _settings.Culture = "de-AT"; }
TranslationService.Load();
TranslationService.SetLanguage(_settings.Culture);
@ -642,18 +637,7 @@ namespace Deckungsbeitrag
// Prüfen ob neue Version ist größer als aktuelle Version.
if (new Version(newVersion).CompareTo(new Version(currentVersion)) > 0)
{
title = TranslationService.T("Titel.Achtung");
caption = TranslationService.T("Text.Achtung.Update");
todo = TranslationService.T("ToDo.Update");
buttons = new string[] { TranslationService.T("Button.Ok") };
DialogResult result = CustomMessageBox.Show(title, caption, todo, buttons);
//DialogResult result = DialogResult.Yes;
//DialogResult result = MessageBox.Show(
// $"Ein Update wird durchgeführt. Schließe es ab um weiter zu kommen.",
// "ACHTUNG UPDATE",
// MessageBoxButtons.OK,
// MessageBoxIcon.Exclamation);
DialogResult result = CustomMessageBox.Show("Titel.Achtung", "Text.Achtung.Update", "ToDo.Update", new string[] { "Ok" });
string msiPath = Path.Combine(updatePath, $"SetupVerwaltung{newVersion}.msi");
@ -685,7 +669,7 @@ namespace Deckungsbeitrag
string csvPath = Path.Combine(updatePath, "Install_Historie.txt");
if (File.Exists(csvPath))
{
File.AppendAllText(csvPath, $"{DateTime.Now} {userid} hat Version: {newVersion} erfolgreich installiert.\n", Encoding.UTF8);
File.AppendAllText(csvPath, $"\n{DateTime.Now} {userid} hat Version: {newVersion} erfolgreich installiert.\n", Encoding.UTF8);
}
return true;

View File

@ -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.1.8.3")]
[assembly: AssemblyFileVersion("1.1.8.3")]
[assembly: AssemblyVersion("1.1.8.8")]
[assembly: AssemblyFileVersion("1.1.8.8")]

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
=====================================
NEUIGKEITEN - Version 1.1.8.3
NEUIGKEITEN - Version 1.1.8.8
=====================================
Build-Info:
@ -73,5 +73,5 @@ Build-Info:
Keine Install-Reminder vorhanden ✅
Installation: 01.07.2026 13:04
Installation: 02.07.2026 13:56
=====================================