Gruppe I: Loeschfunktion fuer Kunden und Produkte hinzugefuegt
parent
0968eea111
commit
1cd04c4fe9
|
|
@ -1 +0,0 @@
|
||||||
9
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
AN-2026-000001;2026-06-24;K-000001;2026-07-24;OFFEN;0.00;0.00;0.00
|
|
||||||
AN-2026-000002;2026-06-24;K-000001;2026-07-24;OFFEN;0.00;0.00;0.00
|
|
||||||
AN-2026-000003;2026-06-24;K-000001;2026-07-24;UEBERFUEHRT;0.00;0.00;0.00
|
|
||||||
AN-2026-000004;2026-06-24;K-000099;2026-07-24;OFFEN;0.00;0.00;0.00
|
|
||||||
AN-2026-000005;2026-06-24;K-000001;2026-07-24;UEBERFUEHRT;0.00;0.00;0.00
|
|
||||||
AN-2026-000006;2026-06-24;K-000001;2026-07-24;UEBERFUEHRT;0.00;0.00;0.00
|
|
||||||
AN-2026-000007;2026-06-24;K-000001;2026-07-24;UEBERFUEHRT;0.00;0.00;0.00
|
|
||||||
AN-2026-000008;2026-06-24;K-000001;2026-07-24;UEBERFUEHRT;0.00;0.00;0.00
|
|
||||||
AN-2026-000009;2026-06-24;K-000001;2026-07-24;OFFEN;20.00;3.80;23.80
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
K-000002;Ref GmbH;Str. 1;68163;Mannheim;DE111111111;ref@ref.de;0621-111111;;AKTIV
|
|
||||||
K-000003;Muster GmbH;Hauptstr. 1;68163;Mannheim;DE123456789;info@muster.de;0621-123456;;AKTIV
|
|
||||||
K-000004;Edit GmbH;Str. 1;68163;Mannheim;DE333333333;neu@edit.de;0621-333333;;AKTIV
|
|
||||||
K-000006;Test AG;Teststr. 1;68163;Mannheim;DE987654321;test@test.de;0621-654321;;AKTIV
|
|
||||||
K-000007;Muster GmbH;Hauptstr. 1;68163;Mannheim;DE123456789;info@muster.de;0621-123456;;AKTIV
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7
|
1
|
||||||
|
|
@ -1 +1 @@
|
||||||
8
|
1
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
P-000002;Verfuegbar;9.99;0.19;5;;
|
|
||||||
P-000003;Ausverkauft;9.99;0.19;0;;
|
|
||||||
P-000004;Hammer;5.99;0.19;20;;
|
|
||||||
P-000006;Edit Artikel;15.00;0.19;10;;
|
|
||||||
P-000007;Ref Artikel;1.00;0.19;5;;
|
|
||||||
P-000008;Testprodukt;19.99;0.19;100;;
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
5
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
R-2026-000001;2026-06-24;K-000001;2026-06-24;2026-06-24;2026-07-08;AN-2026-000003;OFFEN;true;0.00;0.00;0.00
|
|
||||||
R-2026-000002;2026-06-24;K-000001;2026-06-24;2026-06-24;2026-07-08;AN-2026-000005;OFFEN;false;0.00;0.00;0.00
|
|
||||||
R-2026-000003;2026-06-24;K-000001;2026-06-24;2026-06-24;2026-07-08;AN-2026-000006;OFFEN;false;0.00;0.00;0.00
|
|
||||||
R-2026-000004;2026-06-24;K-000001;2026-06-24;2026-06-24;2026-07-08;AN-2026-000007;OFFEN;false;20.00;3.80;23.80
|
|
||||||
R-2026-000005;2026-06-24;K-000001;2026-06-24;2026-06-24;2026-07-08;AN-2026-000008;OFFEN;false;20.00;3.80;23.80
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -27,6 +27,7 @@ public class KundenPanel extends JPanel {
|
||||||
add(erstelleKopf(), BorderLayout.NORTH);
|
add(erstelleKopf(), BorderLayout.NORTH);
|
||||||
add(erstelleTabelle(), BorderLayout.CENTER);
|
add(erstelleTabelle(), BorderLayout.CENTER);
|
||||||
add(erstelleFormular(), BorderLayout.EAST);
|
add(erstelleFormular(), BorderLayout.EAST);
|
||||||
|
add(erstelleAktionen(), BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JPanel erstelleKopf() {
|
private JPanel erstelleKopf() {
|
||||||
|
|
@ -124,6 +125,41 @@ public class KundenPanel extends JPanel {
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JPanel erstelleAktionen() {
|
||||||
|
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
|
||||||
|
panel.setBackground(Color.WHITE);
|
||||||
|
panel.setBorder(BorderFactory.createCompoundBorder(
|
||||||
|
BorderFactory.createLineBorder(new Color(202, 220, 252)),
|
||||||
|
BorderFactory.createEmptyBorder(5, 10, 5, 10)
|
||||||
|
));
|
||||||
|
|
||||||
|
JButton loeschenBtn = erstelleButton("Ausgewaehlten Kunden loeschen", new Color(180, 50, 50));
|
||||||
|
loeschenBtn.addActionListener(e -> {
|
||||||
|
int zeile = tabelle.getSelectedRow();
|
||||||
|
if (zeile == -1) {
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
"Bitte waehlen Sie einen Kunden aus.",
|
||||||
|
"Kein Kunde ausgewaehlt", JOptionPane.WARNING_MESSAGE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String kundenId = (String) tabellenModell.getValueAt(zeile, 0);
|
||||||
|
int bestaetigung = JOptionPane.showConfirmDialog(this,
|
||||||
|
"Moechten Sie den Kunden " + kundenId + " wirklich loeschen?",
|
||||||
|
"Loeschen bestaetigen", JOptionPane.YES_NO_OPTION);
|
||||||
|
if (bestaetigung == JOptionPane.YES_OPTION) {
|
||||||
|
boolean ok = service.kundeLoschen(kundenId);
|
||||||
|
if (ok) {
|
||||||
|
ladeKunden();
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
"Kunde wurde erfolgreich geloescht.",
|
||||||
|
"Erfolg", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panel.add(loeschenBtn);
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
private JTextField erstelleFeld(JPanel panel, String label) {
|
private JTextField erstelleFeld(JPanel panel, String label) {
|
||||||
JLabel lbl = new JLabel(label);
|
JLabel lbl = new JLabel(label);
|
||||||
lbl.setFont(new Font("Calibri", Font.PLAIN, 12));
|
lbl.setFont(new Font("Calibri", Font.PLAIN, 12));
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public class ProduktPanel extends JPanel {
|
||||||
add(erstelleKopf(), BorderLayout.NORTH);
|
add(erstelleKopf(), BorderLayout.NORTH);
|
||||||
add(erstelleTabelle(), BorderLayout.CENTER);
|
add(erstelleTabelle(), BorderLayout.CENTER);
|
||||||
add(erstelleFormular(), BorderLayout.EAST);
|
add(erstelleFormular(), BorderLayout.EAST);
|
||||||
|
add(erstelleAktionen(), BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JPanel erstelleKopf() {
|
private JPanel erstelleKopf() {
|
||||||
|
|
@ -129,6 +130,41 @@ public class ProduktPanel extends JPanel {
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JPanel erstelleAktionen() {
|
||||||
|
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
|
||||||
|
panel.setBackground(Color.WHITE);
|
||||||
|
panel.setBorder(BorderFactory.createCompoundBorder(
|
||||||
|
BorderFactory.createLineBorder(new Color(202, 220, 252)),
|
||||||
|
BorderFactory.createEmptyBorder(5, 10, 5, 10)
|
||||||
|
));
|
||||||
|
|
||||||
|
JButton loeschenBtn = erstelleButton("Ausgewaehlten Artikel loeschen", new Color(180, 50, 50));
|
||||||
|
loeschenBtn.addActionListener(e -> {
|
||||||
|
int zeile = tabelle.getSelectedRow();
|
||||||
|
if (zeile == -1) {
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
"Bitte waehlen Sie einen Artikel aus.",
|
||||||
|
"Kein Artikel ausgewaehlt", JOptionPane.WARNING_MESSAGE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String produktId = (String) tabellenModell.getValueAt(zeile, 0);
|
||||||
|
int bestaetigung = JOptionPane.showConfirmDialog(this,
|
||||||
|
"Moechten Sie den Artikel " + produktId + " wirklich loeschen?",
|
||||||
|
"Loeschen bestaetigen", JOptionPane.YES_NO_OPTION);
|
||||||
|
if (bestaetigung == JOptionPane.YES_OPTION) {
|
||||||
|
boolean ok = service.produktLoeschen(produktId);
|
||||||
|
if (ok) {
|
||||||
|
ladeProdukte();
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
"Artikel wurde erfolgreich geloescht.",
|
||||||
|
"Erfolg", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panel.add(loeschenBtn);
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
private JTextField erstelleFeld(JPanel panel, String label) {
|
private JTextField erstelleFeld(JPanel panel, String label) {
|
||||||
JLabel lbl = new JLabel(label);
|
JLabel lbl = new JLabel(label);
|
||||||
lbl.setFont(new Font("Calibri", Font.PLAIN, 12));
|
lbl.setFont(new Font("Calibri", Font.PLAIN, 12));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue