This commit is contained in:
Le Deng
2017-03-08 08:44:38 -05:00
parent 5adc96fd58
commit e4f7a3675f
6 changed files with 56 additions and 25 deletions

View File

@@ -930,12 +930,12 @@
<workItem from="1486538831944" duration="450000" /> <workItem from="1486538831944" duration="450000" />
<workItem from="1488378219247" duration="650000" /> <workItem from="1488378219247" duration="650000" />
<workItem from="1488461561430" duration="18419000" /> <workItem from="1488461561430" duration="18419000" />
<workItem from="1488731165185" duration="12950000" /> <workItem from="1488731165185" duration="13962000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="74962000" /> <option name="totallyTimeSpent" value="75974000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="797" extended-state="0" /> <frame x="0" y="23" width="1280" height="797" extended-state="0" />

View File

@@ -85,31 +85,31 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="userPayment : ${userPaymentList}"> <tr *ngFor="let userPayment : userPaymentList">
<td> <td>
<input type="radio" name="defaultUserPaymentId" th:value="${userPayment.id}" th:checked="${userPayment.defaultPayment}" /> <input type="radio" name="defaultUserPaymentId" [(ngModel)]="userPayment.id" />
<span>default</span> <span>default</span>
</td> </td>
<td th:text="${userPayment.cardName}">...</td> <td>{{{userPayment.cardName}}}</td>
<td> <td>
<a th:href="@{/updateCreditCard(id=${userPayment.id})}"><i <a><i
class="fa fa-pencil"></i></a> class="fa fa-pencil"></i></a>
<a th:href="@{/removeCreditCard(id=${userPayment.id})}"><i <a><i
class="fa fa-times"></i></a> class="fa fa-times"></i></a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<button class="btn btn-primary" type="submit">Save</button> <button md-raised-button class="mat-primary" type="submit">Save</button>
</form> </form>
</md-tab> </md-tab>
<md-tab label="Add(Update) Credit Card"> <md-tab label="Add(Update) Credit Card">
<form th:action="@{/addNewCreditCard}" method="post"> <form (ngSubmit)="addUpdateCreditCard()" method="post">
<div class="bg-info" th:if="${updateUserPaymentInfo}">User info updated.</div> <div class="bg-info" *ngIf="updateUserPaymentInfo">User info updated.</div>
<input hidden="hidden" name="id" th:value="${userPayment.id}" /> <input hidden="hidden" name="id" [(ngModel)]="userPayment.id" />
<div class="form-group"> <div class="form-group">
<h5>* Give a name for your card: </h5> <h5>* Give a name for your card: </h5>
<input type="text" class="form-control" id="cardName" placeholder="Card Name" th:name="cardName" required="required" th:value="${userPayment.cardName}" /> <input type="text" class="form-control" id="cardName" placeholder="Card Name" name="cardName" required="required" [(ngModel)]="userPayment.cardName" />
</div> </div>
<!--Billing Address--> <!--Billing Address-->
<hr/> <hr/>
@@ -118,29 +118,29 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="billingName">* Name</label> <label for="billingName">* Name</label>
<input type="text" class="form-control" id="billingName" placeholder="Recevier Name" th:name="userBillingName" required="required" th:value="${userBilling.userBillingName}" /> <input type="text" class="form-control" id="billingName" placeholder="Recevier Name" name="userBillingName" required="required" [(ngModel)]="userBilling.userBillingName" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="billingAddress">* Street Address</label> <label for="billingAddress">* Street Address</label>
<input type="text" class="form-control" id="billingAddress" required="required" placeholder="Street Address 1" th:name="userBillingStreet1" th:value="${userBilling.userBillingStreet1}" /> <input type="text" class="form-control" id="billingAddress" required="required" placeholder="Street Address 1" name="userBillingStreet1" [(ngModel)]="userBilling.userBillingStreet1" />
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" placeholder="Street Address 2" th:name="userBillingStreet2" th:value="${userBilling.userBillingStreet2}" /> <input type="text" class="form-control" placeholder="Street Address 2" name="userBillingStreet2" [(ngModel)]="userBilling.userBillingStreet2" />
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-4">
<div class="form-group"> <div class="form-group">
<label for="billingCity">* City</label> <label for="billingCity">* City</label>
<input type="text" class="form-control" id="billingCity" required="required" placeholder="Your billing shippingAddressCity" th:name="userBillingCity" th:value="${userBilling.userBillingCity}" /> <input type="text" class="form-control" id="billingCity" required="required" placeholder="Your billing shippingAddressCity" name="userBillingCity" [(ngModel)]="userBilling.userBillingCity" />
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<div class="form-group"> <div class="form-group">
<label for="billingState">* State</label> <label for="billingState">* State</label>
<select id="billingState" class="form-control" th:name="userBillingState" th:value="${userBilling.userBillingState}" required="required"> <select id="billingState" class="form-control" name="userBillingState" [(ngModel)]="userBilling.userBillingState" required="required">
<option value="" disabled="disabled">Please select an option... <option value="" disabled="disabled">Please select an option...
</option> </option>
<option th:each="state : ${stateList}" th:text="${state}" th:selected="(${userBilling.userBillingState}== ${state})">... <option *ngFor="let state : stateList">{{state}}
</option> </option>
</select> </select>
</div> </div>
@@ -148,7 +148,7 @@
<div class="col-xs-4"> <div class="col-xs-4">
<div class="form-group"> <div class="form-group">
<label for="billingZipcode">* Zipcode</label> <label for="billingZipcode">* Zipcode</label>
<input type="text" class="form-control" id="billingZipcode" required="required" placeholder="Zipcode" th:name="userBillingZipcode" th:value="${userBilling.userBillingZipcode}" /> <input type="text" class="form-control" id="billingZipcode" required="required" placeholder="Zipcode" name="userBillingZipcode" [(ngModel)]="userBilling.userBillingZipcode" />
</div> </div>
</div> </div>
</div> </div>
@@ -163,7 +163,7 @@
<br/> <br/>
<div class="form-group"> <div class="form-group">
<label for="cardType">* Select Card Type:</label> <label for="cardType">* Select Card Type:</label>
<select class="form-control" id="cardType" th:name="type" th:value="${userPayment.type}"> <select class="form-control" id="cardType" name="type" [(ngModel)]="userPayment.type">
<option value="visa">Visa</option> <option value="visa">Visa</option>
<option value="mastercard">Mastercard</option> <option value="mastercard">Mastercard</option>
<option value="discover">Discover</option> <option value="discover">Discover</option>
@@ -172,12 +172,12 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="cardHolder">* Card Holder</label> <label for="cardHolder">* Card Holder</label>
<input type="text" class="form-control" id="cardHolder" required="required" placeholder="Card Holder Name" th:name="holderName" th:value="${userPayment.holderName}" /> <input type="text" class="form-control" id="cardHolder" required="required" placeholder="Card Holder Name" name="holderName" [(ngModel)]="userPayment.holderName" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="cardNumber">* Card Number</label> <label for="cardNumber">* Card Number</label>
<div class="input-group"> <div class="input-group">
<input required="required" id="cardNumber" type="tel" class="form-control" name="cardNumber" placeholder="Valid Card Number" th:name="cardNumber" th:value="${userPayment.cardNumber}" /> <input required="required" id="cardNumber" type="tel" class="form-control" name="cardNumber" placeholder="Valid Card Number" name="cardNumber" [(ngModel)]="userPayment.cardNumber" />
<span class="input-group-addon"><i class="fa fa-credit-card" <span class="input-group-addon"><i class="fa fa-credit-card"
aria-hidden="true"></i></span> aria-hidden="true"></i></span>
</div> </div>
@@ -190,7 +190,7 @@
<label>* Expiration Date</label> <label>* Expiration Date</label>
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-6">
<select class="form-control" name="expiryMonth" required="required" th:value="${userPayment.expiryMonth}"> <select class="form-control" name="expiryMonth" required="required" [(ngModel)]="userPayment.expiryMonth">
<option disabled="disabled"> <option disabled="disabled">
--Month-- --Month--
</option> </option>
@@ -209,7 +209,7 @@
</select> </select>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<select class="form-control" name="expiryYear" th:value="${userPayment.expiryYear}"> <select class="form-control" name="expiryYear" [(ngModel)]="userPayment.expiryYear">
<option disabled="disabled">--Year-- <option disabled="disabled">--Year--
</option> </option>
<option value="17">2017</option> <option value="17">2017</option>
@@ -233,7 +233,7 @@
<div class="col-xs-5 col-md-5 pull-right"> <div class="col-xs-5 col-md-5 pull-right">
<div class="form-group"> <div class="form-group">
<label for="cardCVC">CV Code</label> <label for="cardCVC">CV Code</label>
<input id="cardCVC" type="tel" class="form-control" name="cardCVC" placeholder="CVC" th:name="cvc" th:value="${userPayment.cvc}" /> <input id="cardCVC" type="tel" class="form-control" name="cardCVC" placeholder="CVC" name="cvc" [(ngModel)]="userPayment.cvc" />
</div> </div>
</div> </div>
</div> </div>

View File

@@ -29,6 +29,7 @@ export class MyProfileComponent implements OnInit {
private user: User = new User(); private user: User = new User();
constructor (private loginService: LoginService, private userService: UserService, private router: Router){ constructor (private loginService: LoginService, private userService: UserService, private router: Router){
} }

View File

@@ -0,0 +1,10 @@
export class UserBilling {
public id: number;
public userBillingName: string;
public userBillingStreet1: string;
public userBillingStreet2: string;
public userBillingCity: string;
public userBillingState: string;
public userBillingCountry: string;
public userBillingZipcode: string;
}

View File

@@ -0,0 +1,14 @@
import {UserBilling} from './user-billing';
export class UserPayment {
public id: number;
public type: string;
public cardName: string;
public cardNumber: string;
public expiryMonth: number;
public expiryYear: number;
public cvc: number;
public holderName: string;
public defaultPayment: boolean;
public userBilling: UserBilling;
}

View File

@@ -1,7 +1,13 @@
import {UserPayment} from './user-payment';
export class User { export class User {
public id: number; public id: number;
public firstName: string; public firstName: string;
public lastName: string; public lastName: string;
public username: string; public username: string;
public password: string; public password: string;
public email: string;
public phone: string;
public enabled: boolean;
public userPaymentList: UserPayment[];
} }