Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
User homepage done.
  • Loading branch information
adl13006 committed Dec 9, 2015
1 parent 8d7ac36 commit 84518cd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 49 deletions.
30 changes: 18 additions & 12 deletions TeamDBAwesome/TeamDBAwesome/js/homeController.js
@@ -1,7 +1,7 @@
angular.module('routerApp').controller('homeController', function ($scope, $http, urlService, $q, $state, $cookies, $rootScope, HolderService) {

/* BEGIN FUNCTIONS FUNCTIONS */

console.log($cookies.get('userid'));
// Function to register new users.
$scope.createUser = function (newUser) {
// TODO: Make Service fit into things.
Expand Down Expand Up @@ -57,17 +57,23 @@ angular.module('routerApp').controller('homeController', function ($scope, $http
}

$scope.toUserPage = function (user) {
$http.get("http://localhost:50031/api/GetCustomer?PersonID=" + user.username)
.success(function (response) {
if (response.CustomerID == null) {
$scope.messages = 'You have entered an incorrect User';
}
else {
$cookies.put("userid", user.username);
console.log($cookies.get('userid'));
$state.go('user-home');
}
})
if (!user.password) $scope.messages = "Please enter a password.";
else {
$http.get("http://localhost:50031/api/GetCustomer?PersonID=" + user.username)
.success(function (response) {
if (response.CustomerID == 0) {
$scope.messages = 'You have entered an incorrect User';
}
else {
$cookies.put("userid", user.username);
console.log($cookies.get('userid'));
$state.go('user-home');
}
})
.error(function (error, status, headers, config) {
$scope.messages = 'We could not find that user in the database.';
});
}
}

/* BEGIN LOGIC */
Expand Down
22 changes: 11 additions & 11 deletions TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html
@@ -1,16 +1,16 @@

<div ng-controller='userController'>
<h4>Invoice ID : {{catcats.invoiceId}}</h4>
<h4>Invoice Date : {{catcats.invoiceDate}}</h4>
<h4>Invoice Address : {{catcats.address}} {{catcats.city}} {{catcats.state}}</h4>
<h4 ng-show="catcats.payment.token">Apple token : {{catcats.paymment.token}}</h4>
<h4 ng-show="catcats.payment.email">Email Address : {{catcats.payment.email}}</h4>
<h4 ng-show="catcats.payment.cardnum">Card number : {{catcats.payment.cardnum}}</h4>
<h4 ng-show="catcats.payment.expr_date">Card number : {{catcats.payment.expr_date}}</h4>

<table>
<tr ng-repeat="x in currordertracks">
<td>{{x.TrackName}}</td>
</tr>
<tr><td><h4>Invoice ID</h4> </td><td>{{catcats.invoiceId}}</td> </tr>
<tr><td><h4>Invoice Address :</h4> </td><td>{{catcats.address}} {{catcats.city}} {{catcats.state}}</td> </tr>
<tr ng-show="catcats.payment.token"><td><h4>Apple token </h4> </td><td>{{catcats.paymment.token}}</td> </tr>
<tr ng-show="catcats.payment.email"><td><h4>Email Address </h4> </td><td>{{catcats.payment.email}}</td> </tr>
<tr ng-show="catcats.payment.cardnum"><td><h4>Card number </h4> </td><td>{{catcats.payment.cardnum}}</td> </tr>
<tr ng-show="catcats.payment.expr_date"><td><h4>Expiration Date </h4> </td><td>{{catcats.payment.expr_date}}</td> </tr>
<tr><td><h4>Invoice Total</h4> </td><td>{{catcats.total}}</td> </tr>

</table>
<br /><br />


</div>
35 changes: 9 additions & 26 deletions TeamDBAwesome/TeamDBAwesome/pages/user-orders.html
Expand Up @@ -96,41 +96,24 @@
<p>Choose your payment method</p>
<ul>
<li ng-repeat="x in currpayments">
<label>
Payment Type: {{x.Type}}
<input type="radio" ng-model="$parent.pay" name="pay" value="{{x.PayId}}" required />
<label ng-show="x.is_default == 1">
<b>Default Payment Type: </b> <b ng-show="x.token && !x.email">Apple Pay {{x.token}}</b> <b ng-show="x.expr_date">Credit Card {{x.cardnum}}</b> <b ng-show="x.email">Google Pay {{x.email}}</b>
<input type="radio" ng-model="$parent.pay" name="pay" value="{{x.PayId}}" />
</label>
<label ng-show="x.is_default == 0">
Payment Type: <b ng-show="x.token && !x.email">Apple Pay {{x.token}}</b> <b ng-show="x.expr_date">Credit Card {{x.cardnum}}</b> <b ng-show="x.email">Google Pay {{x.email}}</b>
<input type="radio" ng-model="$parent.pay" name="pay" value="{{x.PayId}}" />
</label>
</li>
</ul>

</form>
<div align="right"><button ng-disabled="myForm.$invalid" data-ng-click="buy(pay)" class="btn btn-primary btn-lg"> Purchase Cart </button></div>
<div ng-show="pay" align="right"><button ng-disabled="myForm.$invalid" data-ng-click="buy(pay)" class="btn btn-primary btn-lg"> Purchase Cart </button></div>
<div ng-show="!pay" align="right"> <b>You have no payment method selected! <br />Please select a payment method or add one in Manage account.</b> </div>



<br /><br /><br /><br /><br /><br /><br /><br />





Link to Order Screen that lets a customer select a playlist to order (from MyPlaylist
or Playlist) or as selected by track via the detailed searching of tracks by track name,
album name, artist name, composer name, genre name, and/or media name. The
Order screen is tied to a Shopping Cart.<br />
Pending/Completed Orders and Status Screen – this should drill down to one order in a read
only mode to view a specific order when reached from the selection on the Customer
Dashboard<br />Order Screen: A screen for that lets a customer select a playlist to order (from MyPlaylist or
Playlist) or as selected by track via the detailed searching of tracks by track name, album
name, artist name, composer name, genre name, and/or media name. The Order screen is
tied to a Shopping Cart. You need to decide the way for customers to select either playlists
(their own in MyPlaylists or in Playlists) or from tracks that are then included in a shopping
cart.<br />

Shopping Cart Screen – to show the items that are being placed for potential order. Time
permitting, you should add the ability to edit the order (remove tracks) but this is not an
immediate initial features.



</div>

0 comments on commit 84518cd

Please sign in to comment.