Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from gregorwolf/master
Browse files Browse the repository at this point in the history
Add Street and correct HouseNumber field
  • Loading branch information
svenkohlhaas authored Apr 7, 2017
2 parents 66e920d + 997e177 commit ba13ff3
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ sap.ui.define([
var birthDate = this.byId("birthId").getValue();
var eMail = this.byId("newEmailId").getValue().toLowerCase();
var street = this.byId("streetId").getValue();
var houseNumber = this.byId("houseNumberId").getValue();
var city = this.byId("cityId").getValue();
var postalCode = this.byId("postalId").getValue();
var country = this.byId("countryListId").getSelectedKey();
Expand All @@ -194,9 +195,27 @@ sap.ui.define([
validationFlag = false;
}

if(validationFlag === false || firstName.length === 0 || lastName.length === 0 || birthDate.length === 0 || eMail.length === 0 || street.length === 0 || city.length === 0 || postalCode.length === 0 || country.length === 0 ||
name.length === 0 || cardNumber.length === 0 || secNumber.length === 0 || (!street.match(myInteger)) === true || (!postalCode.match(myInteger)) === true || (name.match(myInteger)) === true || (!cardNumber.match(myInteger)) === true ||
firstName.match(myInteger) === true || lastName.match(myInteger) === true || city.match(myInteger) === true || country.match(myInteger) === true)
if(validationFlag === false ||
firstName.length === 0 ||
lastName.length === 0 ||
birthDate.length === 0 ||
eMail.length === 0 ||
street.length === 0 ||
city.length === 0 ||
postalCode.length === 0 ||
country.length === 0 ||
name.length === 0 ||
cardNumber.length === 0 ||
secNumber.length === 0 ||
(!houseNumber.match(myInteger)) === true ||
(!postalCode.match(myInteger)) === true ||
(name.match(myInteger)) === true ||
(!cardNumber.match(myInteger)) === true ||
firstName.match(myInteger) === true ||
lastName.match(myInteger) === true ||
street.match(myInteger) === true ||
city.match(myInteger) === true ||
country.match(myInteger) === true)
{
sap.m.MessageToast.show(oBundle.getText("soPopup.errorMessage"));
}
Expand All @@ -206,6 +225,7 @@ sap.ui.define([
sap.ui.getCore().byId("dateBirth").setText(this.byId("birthId").getValue());
sap.ui.getCore().byId("emailAddress").setText(this.byId("newEmailId").getValue());
sap.ui.getCore().byId("street").setText(this.byId("streetId").getValue());
sap.ui.getCore().byId("houseNumber").setText(this.byId("houseNumberId").getValue());
sap.ui.getCore().byId("city").setText(this.byId("cityId").getValue());
sap.ui.getCore().byId("postalCode").setText(this.byId("postalId").getValue());
sap.ui.getCore().byId("country").setText(this.byId("countryListId").getSelectedKey());
Expand Down Expand Up @@ -256,9 +276,9 @@ sap.ui.define([
"DateOfBirth":date,
"PostalCode":this.byId("postalId").getValue(),
"City":this.byId("cityId").getValue(),
"HouseNumber":this.byId("houseNumberId").getValue(),
"Street":this.byId("streetId").getValue(),
"Country":this.byId("countryListId").getSelectedKey()

};

$.ajax({
Expand Down Expand Up @@ -488,6 +508,7 @@ sap.ui.define([
that.byId("newEmailId").setValue("");
that.byId("birthId").setValue("");
that.byId("streetId").setValue("");
that.byId("houseNumberId").setValue("");
that.byId("cityId").setValue("");
that.byId("countryListId").setSelectedKey("");
that.byId("postalId").setValue("");
Expand All @@ -503,6 +524,7 @@ sap.ui.define([
that.byId("newEmailId").setValue(result[0].EmailAddress);
that.byId("birthId").setDateValue(new Date(result[0].DateOfBirth));
that.byId("streetId").setValue(result[0].Street);
that.byId("houseNumberId").setValue(result[0].HouseNumber);
that.byId("cityId").setValue(result[0].City);
that.byId("countryListId").setSelectedKey(result[0].Country);
that.byId("postalId").setValue(result[0].PostalCode);
Expand Down Expand Up @@ -570,8 +592,15 @@ sap.ui.define([
},

checkCustomerInformation: function(){
if(this.byId("firstNameId").getValue().length === 0 || this.byId("lastnameId").getValue().length === 0 || this.byId("birthId").getValue().length === 0 || this.byId("newEmailId").getValue().length === 0 ||
this.byId("streetId").getValue().length === 0 || this.byId("cityId").getValue().length === 0 || this.byId("postalId").getValue().length === 0 || this.byId("countryListId").getSelectedKey().length === 0){
if( this.byId("firstNameId").getValue().length === 0 ||
this.byId("lastnameId").getValue().length === 0 ||
this.byId("birthId").getValue().length === 0 ||
this.byId("newEmailId").getValue().length === 0 ||
this.byId("streetId").getValue().length === 0 ||
this.byId("houseNumberId").getValue().length === 0 ||
this.byId("cityId").getValue().length === 0 ||
this.byId("postalId").getValue().length === 0 ||
this.byId("countryListId").getSelectedKey().length === 0){

this._wizard.invalidateStep(this.getView().byId("creditCardStep"));
}
Expand All @@ -597,6 +626,7 @@ sap.ui.define([
this.byId("newEmailId").setValue("");
this.byId("birthId").setValue("");
this.byId("streetId").setValue("");
this.byId("houseNumberId").setValue("");
this.byId("cityId").setValue("");
this.byId("countryListId").setSelectedKey("");
this.byId("postalId").setValue("");
Expand Down
3 changes: 3 additions & 0 deletions espm-cloud-web/src/main/webapp/webshop/i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ check.newEmail=Email address
check.holderNewEmail=Enter your email address
check.DOB=Date of Birth
check.address=Address
check.holderStreet=Street
check.holderStreetNumber=Street Number
check.holderCity=City name
check.holderPostalCode=Postal code
Expand Down Expand Up @@ -115,6 +116,7 @@ review.titlenameAddressForm=Name and Address
review.firstname=First name
review.lastname=Last name
review.street=Street
review.streetNumber=Street Number
review.city=City
review.postalCode=Postal code
review.country=Country
Expand All @@ -132,6 +134,7 @@ sales.address=Address
sales.customerName=Customer name
sales.email=Email
sales.street=Street
sales.streetNumber=Street Number
sales.city=City
sales.country = Country
sales.lineItemTableHeader=Products
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
<Label text="{i18n>check.DOB}" required="true"/>
<DatePicker id="birthId" displayFormat="medium" type="sap.ui.model.type.Date" valueFormat="yyyy-MM-dd" change="validateDateField"/>
<Label text="{i18n>check.address}" required="true"/>
<Input id="streetId" placeholder="{i18n>check.holderStreetNumber}" type="sap.ui.model.type.Integer" liveChange="validateNumberInputField" value=""/>
<Input id="streetId" placeholder="{i18n>check.holderStreet}" type="sap.ui.model.type.String" liveChange="validateStringInputField" value=""/>
<Input id="houseNumberId" placeholder="{i18n>check.holderStreetNumber}" type="sap.ui.model.type.Integer" liveChange="validateNumberInputField" value=""/>
<Input id="cityId" placeholder="{i18n>check.holderCity}" type="sap.ui.model.type.String" liveChange="validateStringInputField" value=""/>
<Input id="postalId" placeholder="{i18n>check.holderPostalCode}" type="sap.ui.model.type.Integer" liveChange="validateNumberInputField" value=""/>
<Label text="{i18n>check.country}" required="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
<Text text="{EmailAddress}"/>
<Label text="{i18n>sales.street}"/>
<Text text="{Street}" />
<Label text="{i18n>sales.streetNumber}"/>
<Text text="{HouseNumber}" />
<Label text="{i18n>sales.city}"/>
<Text text="{City}, {PostalCode}" />
<Label text="{i18n>sales.country}"/>
Expand All @@ -81,8 +83,7 @@
</cells>
</ColumnListItem>
</Table>
<core:HTML id="pdfHTMLId">

<core:HTML id="pdfHTMLId">
</core:HTML>
<footer>
<Bar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,21 @@
<Label text="{i18n>review.firstname}"/>
<Text id="firstname" text=""/>
<Label text="{i18n>review.lastname}"/>
<Text id="lastName" text="{/productName}"/>
<Text id="lastName" text=""/>
<Label text="{i18n>check.DOB}"/>
<Text id="dateBirth" text="{/productWeight}"/>
<Text id="dateBirth" text=""/>
<Label text="{i18n>check.newEmail}"/>
<Text id="emailAddress" text="{/productWeight}"/>
<Text id="emailAddress" text=""/>
<Label text="{i18n>review.street}"/>
<Text id="street" text="{/productManufacturer}"/>
<Text id="street" text=""/>
<Label text="{i18n>review.streetNumber}"/>
<Text id="houseNumber" text=""/>
<Label text="{i18n>review.city}"/>
<Text id="city" text="{/productDescription}"/>
<Text id="city" text=""/>
<Label text="{i18n>review.postalCode}"/>
<Text id="postalCode" text="{/productDescription}"/>
<Text id="postalCode" text=""/>
<Label text="{i18n>review.country}"/>
<Text id="country" text="{/productDescription}"/>
<Text id="country" text=""/>
</form:content>
</form:SimpleForm>

Expand All @@ -110,7 +112,7 @@
<Label text="{i18n>check.nameOnCard}r"/>
<Text id="cardOwner" text=""/>
<Label text="{i18n>check.cardNumber}"/>
<Text id="cardNumber" text="{/productDescription}"/>
<Text id="cardNumber" text=""/>
</form:content>
</form:SimpleForm>
</content>
Expand Down

0 comments on commit ba13ff3

Please sign in to comment.