diff --git a/src/main/java/org/s4s/gui/InitView.java b/src/main/java/org/s4s/gui/InitView.java index ca28a8b136b822410a4ef27c909df3e8cfa07f65..4f125e2d5bb20581ca995ed5dcbc0e77e6f74e78 100644 --- a/src/main/java/org/s4s/gui/InitView.java +++ b/src/main/java/org/s4s/gui/InitView.java @@ -45,6 +45,7 @@ public class InitView extends UI { navi.addView(Views.SHOPERSTELLUNGSBESTAETIGUNG, ShoperstellungsBestätigung.class); navi.addView(Views.REGISTRIERUNGSBESTAETIGUNG, RegistrierungsBestaetigung.class); navi.addView(Views.KONTAKTBESTAETIGUNG, Kontaktbestaetigung.class); + navi.addView(Views.TRANSAKTIONSBESTAETIGUNG, TransaktionsBestaetigung.class); //Test der RegistrierungsView UI.getCurrent().getNavigator().navigateTo(Views.WELCOME); setHeight(100f, Unit.PERCENTAGE); diff --git a/src/main/java/org/s4s/gui/views/TransaktionsBestaetigung.java b/src/main/java/org/s4s/gui/views/TransaktionsBestaetigung.java new file mode 100644 index 0000000000000000000000000000000000000000..0a8e827505b719b17553facf06f47736ff022485 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/TransaktionsBestaetigung.java @@ -0,0 +1,51 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import org.s4s.services.util.Views; + +/** + * + * @author Sebas + */ +public class TransaktionsBestaetigung extends TemplateView implements View { + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + private void setUp() { + Panel panel = new Panel(); + panel.setSizeUndefined(); + + VerticalLayout content = new VerticalLayout(); + + Button button = new Button("Zurück zur Startseite"); + button.addClickListener(e + -> UI.getCurrent().getNavigator().navigateTo(Views.WELCOME)); + + Label label = new Label("Vielen Dank für ihre Einkauf"); + + content.addComponent(label); + content.addComponent(button); + + content.setMargin(true); + + panel.setContent(content); + //this.addComponent(panel); + //this.setComponentAlignment(panel, Alignment.MIDDLE_CENTER); + + super.setUpFooterAndHeader(panel); + } +} diff --git a/src/main/java/org/s4s/gui/views/WarenkorbView.java b/src/main/java/org/s4s/gui/views/WarenkorbView.java index 3964888cc5f2dbea8d035b9c72ec3fc8f1f15b93..2469cda2b11ac0a83c4b85caa27eb649f89f5f24 100644 --- a/src/main/java/org/s4s/gui/views/WarenkorbView.java +++ b/src/main/java/org/s4s/gui/views/WarenkorbView.java @@ -96,14 +96,15 @@ public class WarenkorbView extends TemplateView { Button buyButton = new Button("Kaufen!"); buyButton.addClickListener((Button.ClickEvent event) -> { - TransactionControl t = new TransactionControl(); + TransactionControl tr = new TransactionControl(); try { - t.createTransactions(); + tr.createTransactions(); } catch (DAOException ex) { Logger.getLogger(WarenkorbView.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(WarenkorbView.class.getName()).log(Level.SEVERE, null, ex); } + UI.getCurrent().getNavigator().navigateTo(Views.TRANSAKTIONSBESTAETIGUNG); }); buttonLayout.addComponent(buyButton); diff --git a/src/main/java/org/s4s/services/util/Views.java b/src/main/java/org/s4s/services/util/Views.java index 7a7a35e3a7520a0cce258bcf88841144b8ef13f2..06dba718019b7356e1157a50072ffe5e00ad375f 100644 --- a/src/main/java/org/s4s/services/util/Views.java +++ b/src/main/java/org/s4s/services/util/Views.java @@ -24,6 +24,7 @@ public final class Views { public final static String SHOPERSTELLUNGSBESTAETIGUNG = "shoperstellungsbestaetigung"; public final static String REGISTRIERUNGSBESTAETIGUNG = "registrierungsbestaetigung"; public final static String KONTAKTBESTAETIGUNG = "kontaktbestaetigung"; + public final static String TRANSAKTIONSBESTAETIGUNG = "transaktionsbestaetigung"; private Views() {