diff --git a/TeamDBAwesome/TeamDBAwesome/js/homeController.js b/TeamDBAwesome/TeamDBAwesome/js/homeController.js index 2260504..265cb7d 100644 --- a/TeamDBAwesome/TeamDBAwesome/js/homeController.js +++ b/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. @@ -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 */ diff --git a/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html b/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html index 66dbda3..9029680 100644 --- a/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html +++ b/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html @@ -1,16 +1,16 @@ 
{{x.TrackName}} | -|
Invoice ID | {{catcats.invoiceId}} |
Invoice Address : | {{catcats.address}} {{catcats.city}} {{catcats.state}} |
Apple token | {{catcats.paymment.token}} |
Email Address | {{catcats.payment.email}} |
Card number | {{catcats.payment.cardnum}} |
Expiration Date | {{catcats.payment.expr_date}} |
Invoice Total | {{catcats.total}} |
Choose your payment method