Skip to content
Snippets Groups Projects
Commit f200d98d authored by sknobl2s's avatar sknobl2s
Browse files

Transaction beim CLickEvent im Warenkorb hinzugefügt

parent 6ac94a45
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,14 @@ import com.vaadin.ui.Panel;
import com.vaadin.ui.Table;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.s4s.exceptions.DAOException;
import org.s4s.modell.dto.Product;
import org.s4s.modell.dto.Warenkorb;
import org.s4s.process.control.TransactionControl;
import org.s4s.services.util.Roles;
import org.s4s.services.util.Views;
......@@ -90,8 +95,15 @@ public class WarenkorbView extends TemplateView {
});
Button buyButton = new Button("Kaufen!");
buyButton.addClickListener((event) -> {
buyButton.addClickListener((Button.ClickEvent event) -> {
TransactionControl t = new TransactionControl();
try {
t.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);
}
});
buttonLayout.addComponent(buyButton);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment