--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.customer.bean;
+
+import java.util.Iterator;
+import org.mxchange.jcore.client.Client;
+import org.mxchange.jcore.contact.Contact;
+import org.mxchange.jcore.contact.Gender;
+import org.mxchange.pizzaapplication.BasePizzaServiceSystem;
+import org.mxchange.pizzaapplication.beans.CustomerBean;
+import org.mxchange.pizzaapplication.customer.PizzaServiceCustomer;
+
+/**
+ * A customer bean which hides the customer instance
+ *
+ * @author Roland Haeder
+ */
+public class PizzaServiceCustomerBean extends BasePizzaServiceSystem implements CustomerBean {
+ /**
+ * Default constructor
+ */
+ public PizzaServiceCustomerBean () {
+ // Instance customer
+ Contact customer = new PizzaServiceCustomer();
+
+ // Init bundle
+ this.initBundle();
+
+ // And set it here
+ this.setContact(customer);
+ }
+
+ @Override
+ public String getBirthday () {
+ // Deligate to "hidden" object
+ return this.getContact().getBirthday();
+ }
+
+ @Override
+ public void setBirthday (final String birthday) {
+ // Deligate to "hidden" object
+ this.getContact().setBirthday(birthday);
+ }
+
+ @Override
+ public String getCellphoneNumber () {
+ // Deligate to "hidden" object
+ return this.getContact().getCellphoneNumber();
+ }
+
+ @Override
+ public void setCellphoneNumber (final String cellphoneNumber) {
+ // Deligate to "hidden" object
+ this.getContact().setCellphoneNumber(cellphoneNumber);
+ }
+
+ @Override
+ public String getCity () {
+ // Deligate to "hidden" object
+ return this.getContact().getCity();
+ }
+
+ @Override
+ public void setCity (final String city) {
+ // Deligate to "hidden" object
+ this.getContact().setCity(city);
+ }
+
+ @Override
+ public String getComment () {
+ // Deligate to "hidden" object
+ return this.getContact().getComment();
+ }
+
+ @Override
+ public void setComment (final String comment) {
+ // Deligate to "hidden" object
+ this.getContact().setComment(comment);
+ }
+
+ @Override
+ public String getCompanyName () {
+ // Deligate to "hidden" object
+ return this.getContact().getCompanyName();
+ }
+
+ @Override
+ public void setCompanyName (final String companyName) {
+ // Deligate to "hidden" object
+ this.getContact().setCompanyName(companyName);
+ }
+
+ @Override
+ public String getCountryCode () {
+ // Deligate to "hidden" object
+ return this.getContact().getCountryCode();
+ }
+
+ @Override
+ public void setCountryCode (final String countryCode) {
+ // Deligate to "hidden" object
+ this.getContact().setCountryCode(countryCode);
+ }
+
+ @Override
+ public String getEmailAddress () {
+ // Deligate to "hidden" object
+ return this.getContact().getEmailAddress();
+ }
+
+ @Override
+ public void setEmailAddress (final String emailAddress) {
+ // Deligate to "hidden" object
+ this.getContact().setEmailAddress(emailAddress);
+ }
+
+ @Override
+ public String getFamilyName () {
+ // Deligate to "hidden" object
+ return this.getContact().getFamilyName();
+ }
+
+ @Override
+ public void setFamilyName (final String familyName) {
+ // Deligate to "hidden" object
+ this.getContact().setFamilyName(familyName);
+ }
+
+ @Override
+ public String getFaxNumber () {
+ // Deligate to "hidden" object
+ return this.getContact().getFaxNumber();
+ }
+
+ @Override
+ public void setFaxNumber (final String faxNumber) {
+ // Deligate to "hidden" object
+ this.getContact().setFaxNumber(faxNumber);
+ }
+
+ @Override
+ public Gender getGender () {
+ // Deligate to "hidden" object
+ return this.getContact().getGender();
+ }
+
+ @Override
+ public void setGender (final Gender gender) {
+ // Deligate to "hidden" object
+ this.getContact().setGender(gender);
+ }
+
+ @Override
+ public long getHouseNumber () {
+ // Deligate to "hidden" object
+ return this.getContact().getHouseNumber();
+ }
+
+ @Override
+ public void setHouseNumber (final long houseNumber) {
+ // Deligate to "hidden" object
+ this.getContact().setHouseNumber(houseNumber);
+ }
+
+ @Override
+ public String getPhoneNumber () {
+ // Deligate to "hidden" object
+ return this.getContact().getPhoneNumber();
+ }
+
+ @Override
+ public void setPhoneNumber (final String phoneNumber) {
+ // Deligate to "hidden" object
+ this.getContact().setPhoneNumber(phoneNumber);
+ }
+
+ @Override
+ public String getStreet () {
+ // Deligate to "hidden" object
+ return this.getContact().getStreet();
+ }
+
+ @Override
+ public void setStreet (final String street) {
+ // Deligate to "hidden" object
+ this.getContact().setStreet(street);
+ }
+
+ @Override
+ public String getSurname () {
+ // Deligate to "hidden" object
+ return this.getContact().getSurname();
+ }
+
+ @Override
+ public void setSurname (final String surname) {
+ // Deligate to "hidden" object
+ this.getContact().setSurname(surname);
+ }
+
+ @Override
+ public String getTranslatedGender () {
+ // Deligate to "hidden" object
+ return this.getContact().getTranslatedGender();
+ }
+
+ @Override
+ public long getZipCode () {
+ // Deligate to "hidden" object
+ return this.getContact().getZipCode();
+ }
+
+ @Override
+ public void setZipCode (final long zipCode) {
+ // Deligate to "hidden" object
+ this.getContact().setZipCode(zipCode);
+ }
+
+ @Override
+ public boolean isOwnContact () {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public Iterator<Object> iterator () {
+ // Deligate to "hidden" object
+ return this.getContact().iterator();
+ }
+
+ @Override
+ public void show (final Client client) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+}
Author : Roland Haeder
--%>
-<%@page errorPage="errorHandler.jsp" %>
+<%@page import="org.mxchange.jcore.contact.Gender"%>
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map"%>
<%@page import="org.mxchange.pizzaapplication.product.Product"%>
<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
-<%@page import="org.mxchange.pizzaapplication.customer.Customer" %>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.CustomerBean" type="Customer" />
+<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
+
<jsp:setProperty name="customer" property="*" />
<%
<legend title="Bitte geben Sie Ihre Daten ein.">Bitte Ihre Daten eingeben:</legend>
<div class="data_row">
+ <div class="data_left">
+ <label for="gender">Anrede</label>
+ </div>
+ <div class="data_right">
+ <select name="gender" id="gender" size="1">
+ <%
+ Gender[] genders = Gender.values();
+ for (Gender gender : genders) {
+ %>
+ <option value="<%=gender.getDatabaseValue()%>"><%=gender%></option>
+ <%
+ }
+ %>
+ </select>
+ </div>
+ <div class="clear"></div>
+ </div>
+
<div class="data_row">
<div class="data_left">
<label for="companyname">Firmenname:</label>
<div class="clear"></div>
</div>
+ <div class="data_row">
<div class="data_left">
<label for="surname">Vorname:</label>
</div>