From e2cd80c67715fdeeb733f7b4dacb70fdbcacb351 Mon Sep 17 00:00:00 2001 From: Marc3308 Date: Tue, 19 Nov 2024 11:01:39 +0100 Subject: [PATCH] Added Schulden Support and everything else --- .../org/example/framework/framecreater.java | 53 ++++++++++++++++-- .../org/example/framework/framecreater.class | Bin 18019 -> 19436 bytes .../classes/org/example/objekts/kunden.class | Bin 1254 -> 1254 bytes 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/example/framework/framecreater.java b/src/main/java/org/example/framework/framecreater.java index 430e456..04028cd 100644 --- a/src/main/java/org/example/framework/framecreater.java +++ b/src/main/java/org/example/framework/framecreater.java @@ -123,7 +123,7 @@ public class framecreater implements ActionListener { vorlage.setBounds(10+(80*(counter%4)),100+(100*(counter/4)),80,100 ); vorlage.addActionListener(e -> { frame.dispose(); - profilframe(); + onmedienclick(m); }); return vorlage; } @@ -297,7 +297,7 @@ public class framecreater implements ActionListener { panel.add(nummer); //text feld - JLabel schulden=new JLabel("Schulden: "+k.getSchulden()); + JLabel schulden=new JLabel("Schulden: "+k.getSchulden()+"€"); schulden.setBounds( 10,30,200,25); panel.add(schulden); @@ -306,7 +306,6 @@ public class framecreater implements ActionListener { schuldenzuruck.setBounds(170,30,80,25); schuldenzuruck.addActionListener( e -> { if(!schuldenabezahlen.contains(k))schuldenabezahlen.add(k); - profilframe(); }); panel.add(schuldenzuruck); @@ -350,6 +349,15 @@ public class framecreater implements ActionListener { Startframe(); }); panel.add(abmelden); + + //admin schulden erlass knopf + JButton admin=new JButton("Gebüren Verbuchen"); + admin.setBounds(170,725,200,25); + admin.addActionListener(e -> { + frame.dispose(); + adminclick(); + }); + if(getAngemeldeterbenuter()==0)panel.add(admin); } public static void onmedienclick(Medien m){ @@ -413,13 +421,50 @@ public class framecreater implements ActionListener { m.setAusgeliehen(-1); schuldenberechnung(m,kundenliste.get(getAngemeldeterbenuter())); kundenliste.get(getAngemeldeterbenuter()).getAusgeliehen().remove(m); - Startframe(); + profilframe(); }); if(m.getAusgeliehen()<0 && getAngemeldeterbenuter()>=0)panel.add(ausleiehen); if(m.getAusgeliehen()>=0 && m.getAusgeliehen()==getAngemeldeterbenuter())panel.add(zuruckgeben); } + public static void adminclick(){ + //frame + JFrame frame=new JFrame("Gebüren Verbuchen"); + JPanel panel=new JPanel(); + frame.setSize(300,100+(schuldenabezahlen.size()*30)); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setVisible(true); + frame.add(panel); + panel.setLayout(null); + + schuldenabezahlen.forEach(k -> { + //info feld + JLabel kunde=new JLabel("Nr: "+k.getnummer()+" Schulden: "+k.getSchulden()+"€"); + kunde.setBounds(10,schuldenabezahlen.indexOf(k)*25,200,25); + panel.add(kunde); + + //admin schulden erlass knopf + JButton admin=new JButton("Bezahlt"); + admin.setBounds(200,schuldenabezahlen.indexOf(k)*25,80,25); + admin.addActionListener(e -> { + frame.dispose(); + k.setSchulden(0.0); + schuldenabezahlen.remove(k); + adminclick(); + }); + panel.add(admin); + }); + //back + JButton back=new JButton("Zurück"); + back.setBounds(10,schuldenabezahlen.size()*25,80,25); + back.addActionListener(e -> { + frame.dispose(); + profilframe(); + }); + panel.add(back); + } + public static void schuldenberechnung(Medien m, kunden k){ LocalDate datenow=getDatum(); LocalDate datethen=k.getAusgeliehen().get(m); diff --git a/target/classes/org/example/framework/framecreater.class b/target/classes/org/example/framework/framecreater.class index 4e55c69389192b7b11ade8c17f51e0e2a46e12e3..4eb138e4ad478379cf2d0fdf05ce86038da5d628 100644 GIT binary patch delta 7133 zcma)A33yahvaUMmq?gC1GUI}t33^rM(I!2RK38w5YOSu<10G7I;SMfgikhm| z_~n9^vptj|e|+*Mm9t%RBTvwHBIPs1)aflHt<4R(f0gcU@lX#=@K8^wV+xbYe4;DG zz37C4r!#5uTbnwMRxhoK*Q=!d-gLrA**r_**~U$t*d#Y2}Lp4Yy8d28=G|(H}En$2Q+S^C}W?y|H$a&O^vnwhT5je zWx9tlc!fsCxQQt_ySyx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