231 lines
7.5 KiB
C#
231 lines
7.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using ZXing;
|
|
|
|
namespace DatenDB
|
|
{
|
|
public class Fehlermeldungen
|
|
{
|
|
|
|
public Fehlermeldungen()
|
|
{
|
|
|
|
}
|
|
public string NoExtraKunde()
|
|
{
|
|
string s = "Extra Kunde kann nicht gewählt werden. Um Extra Kunden hinzuzugüfen wähle im vorigen Fenster +Kunde.";
|
|
return s;
|
|
}
|
|
/// <summary>
|
|
/// FUNKTIONEN GEBEN DIALOG RESULT RETUR.
|
|
/// </summary>
|
|
/// <returns>DialogResult</returns>
|
|
public DialogResult NoCleanContainer()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Der Auftrag kann nicht abgeschlossen werden. Bitte korrigiere die Anzahl der sauberen Container.";
|
|
string caption = "ACHTUNG";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Warning;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
}
|
|
public DialogResult DifferentCleanContainer()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Die Anzahl der sauberen Container wurde verändert. Möchtest du die Etiketten neu drucken?";
|
|
string caption = "FRAGE";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
|
|
MessageBoxIcon icon = MessageBoxIcon.Question;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
}
|
|
public DialogResult NoAufgabe()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Der Auftrag kann nicht gespeichert werden. Bitte wähl eine Aufgabe aus.";
|
|
string caption = "ACHTUNG";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Exclamation;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
|
|
}
|
|
public DialogResult AuftragAusgeliefert()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Wurde der Auftrag erfolgreich ausgeliefert?";
|
|
string caption = "FRAGE";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
|
MessageBoxIcon icon = MessageBoxIcon.Question;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
}
|
|
public DialogResult AuftragAufAbruf()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Ist der Auftrag wirklich Auf Abruf?";
|
|
string caption = "FRAGE";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
|
MessageBoxIcon icon = MessageBoxIcon.Question;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
}
|
|
public DialogResult AuftragVorhanden(Auftrag auftrag)
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Der Auftrag {Kunde.GetKunde(null, auftrag.KundeID, null).Suchtext} Liefertag {auftrag.Liefertag.ToShortDateString()} erstellt am {auftrag.Erstellt.Value.ToShortDateString()} ist bereits vorhanden. Trotzdem neu erstellen?";
|
|
string caption = "FRAGE";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
|
MessageBoxIcon icon = MessageBoxIcon.Question;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Der Auftrag wurde bereits fertig gestellt. Kein Bearbeiten mehr möglich.
|
|
/// </summary>
|
|
public void AuftragFertig()
|
|
{
|
|
string s = $"Der Auftrag ist bereits fertig und kann nicht mehr bearbeitet werden.";
|
|
string caption = "HINWEIS";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Information;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Keine Aufträge gefunden.
|
|
/// </summary>
|
|
public void KeineAufträge()
|
|
{
|
|
string s = $"KEINE Aufträge zum Anzeigen gefunden. Versuch es mit einem anderen Status.";
|
|
string caption = "HINWEIS";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Information;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Es kann nur ein Auftrag verarbeitet werden.
|
|
/// </summary>
|
|
public void NurEinAuftrag()
|
|
{
|
|
string s = $"Es kann nur ein Auftrag verarbeitet werden.";
|
|
string caption = "HINWEIS";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Information;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Speichern der Liste erfolgreich.
|
|
/// </summary>
|
|
public void Gespeichert()
|
|
{
|
|
string s = $"Es wurden alle Einträge gespeichert.";
|
|
string caption = "HINWEIS";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Information;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Speichern der Liste fehlgeschlagen.
|
|
/// </summary>
|
|
public void Speicherfehler()
|
|
{
|
|
string s = $"Es konnten nicht alle Einträge gespeichert werden.";
|
|
string caption = "FEHLER";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Error;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
public void FehlmengeCount()
|
|
{
|
|
string s = $"Fehlmenge konnte nicht gespeichert werden. VORARBEITER RUFEN!!";
|
|
string caption = "FEHLER";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Error;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Updating der Artikel wird durchgeführt und die DB-Verbindung ist offen.
|
|
/// </summary>
|
|
/// <param name="ex"></param>
|
|
public void IsUpdating(Exception ex)
|
|
{
|
|
string s = $"Update wird gerade durchgeführt. Versuch es später nocheinmal. {Environment.NewLine} Fehler: {ex.Message}";
|
|
string caption = "FEHLER";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Error;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
|
|
}
|
|
|
|
public void Eingabefehler()
|
|
{
|
|
string s = $"Die Eingabe war nicht korrekt. Bitte tragen sie hier nur Zahlen ein.";
|
|
string caption = "FEHLER";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Error;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
public DialogResult SonderNoCleanContainer()
|
|
{
|
|
DialogResult result = DialogResult.Cancel;
|
|
|
|
string s = $"Sonderauftrag ohne sauberen Container abschließen? Es wird KEIN Etikett gedruckt.";
|
|
string caption = "INFO";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
|
MessageBoxIcon icon = MessageBoxIcon.Exclamation;
|
|
|
|
result = MessageBox.Show(s, caption, buttons, icon);
|
|
return result;
|
|
|
|
}
|
|
|
|
public void VerarbeiteteDaten(int saved, int anzahlkunden, int artvorhanden)
|
|
{
|
|
string s = $"Es wurden {anzahlkunden} Kunden gefunden und {saved} Artikel gespeichert. {artvorhanden} Artikel waren bereits vorhanden.";
|
|
string caption = "HINWEIS";
|
|
MessageBoxButtons buttons = MessageBoxButtons.OK;
|
|
MessageBoxIcon icon = MessageBoxIcon.Information;
|
|
MessageBox.Show(s, caption, buttons, icon);
|
|
}
|
|
|
|
public bool HandEingabe()
|
|
{
|
|
bool result;
|
|
string s = $"Kunde Handeingabe?";
|
|
string caption = "FRAGE";
|
|
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
|
MessageBoxIcon icon = MessageBoxIcon.Question;
|
|
|
|
if (MessageBox.Show(s, caption, buttons, icon) == DialogResult.Yes) result = true;
|
|
else result = false;
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|