From 5c762bb4446454c158458f7cd33328f4f4f97939 Mon Sep 17 00:00:00 2001 From: Antonia Lewis Date: Tue, 8 Dec 2015 20:42:25 -0500 Subject: [PATCH] your hearts been aching but you're to shy to say it --- Chinook_Rev1.sql | 12 +++++++++--- .../TeamDBAwesome/SqlService/MySqlService.cs | 3 ++- .../TeamDBAwesome/js/userController.js | 19 ++++++++++++++----- .../TeamDBAwesome/pages/user-home.html | 10 ++++------ .../TeamDBAwesome/pages/user-ordermodal.html | 10 ++++++++-- .../TeamDBAwesome/pages/user-orders.html | 12 +++++++++--- 6 files changed, 46 insertions(+), 20 deletions(-) diff --git a/Chinook_Rev1.sql b/Chinook_Rev1.sql index 7cd5483..ebdf502 100644 --- a/Chinook_Rev1.sql +++ b/Chinook_Rev1.sql @@ -83,7 +83,7 @@ CREATE TABLE `Person` CREATE TABLE `TrackURL` ( `TrackID` INT NOT NULL, - `URL` VARCHAR(45) NOT NULL, + `URL` VARCHAR(150), CONSTRAINT `PK_TrackURL` PRIMARY KEY (`TrackID`) ); @@ -244,9 +244,15 @@ Add IsDefault to Payment **************************/ ALTER TABLE payment ADD COLUMN IsDefault bool; +/************************** +*add things +**************************/ +INSERT INTO TrackURL(TrackID) +SELECT TrackID +FROM Track; - - +UPDATE TrackURL +SET url = "http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a"; diff --git a/TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs b/TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs index 0bc9f41..81dbfb5 100644 --- a/TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs +++ b/TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs @@ -516,7 +516,8 @@ namespace TeamDBAwesome.SqlService } else { - IsDef = int.Parse(EmptyDefault); + //IsDef = int.Parse(EmptyDefault); + IsDef = 0; } Payment LoadPayment = new Payment diff --git a/TeamDBAwesome/TeamDBAwesome/js/userController.js b/TeamDBAwesome/TeamDBAwesome/js/userController.js index 282c566..7ec8814 100644 --- a/TeamDBAwesome/TeamDBAwesome/js/userController.js +++ b/TeamDBAwesome/TeamDBAwesome/js/userController.js @@ -80,7 +80,7 @@ angular.module('routerApp').controller('userController', function ($q, $window, { field: 'AlbumTitle', displayName: ' Album ', width: "15%" }, { field: 'MediaType', displayName: ' Media ', width: "10%" }, { field: 'Genre', displayName: ' Genre ', width: "10%" }, - { field: 'Clip', displayName: ' Clip ', width: "10%" }, + { field: 'Clip', displayName: ' Clip ', width: "10%", cellTemplate: '
' }, { field: 'UnitPrice', displayName: ' Price ', width: "10%" } ]; @@ -254,6 +254,12 @@ angular.module('routerApp').controller('userController', function ($q, $window, }) }; + //Play Audio Clip + $scope.play = function () { + var audio = document.getElementById("audio1"); + audio.play(); + }; + // Get CustomPlaylist Tracks $scope.getMyPlaylistTracks = function (id) { $http.get("http://localhost:50031/api/GetPlaylist?PlaylistID=" + id) @@ -298,8 +304,10 @@ angular.module('routerApp').controller('userController', function ($q, $window, } // Open window for orders - $scope.openOrder = function (size, orderid) { - $scope.getOrderTracks(orderid); + $scope.openOrder = function (orderid) { + console.log(orderid); + $scope.catcats = orderid; + $scope.getOrderTracks(orderid.invoiceId); var modalInstance = $uibModal.open({ animation: $scope.animationsEnabled, templateUrl: 'pages/user-ordermodal.html', @@ -317,6 +325,7 @@ angular.module('routerApp').controller('userController', function ($q, $window, $scope.getOrderTracks = function (orderid) { $http.get("http://localhost:50031/api/GetOrderTracks?orderId=" + orderid) .success(function (response) { + console.log(response); $scope.currordertracks = angular.copy(response); console.log($scope.currordertracks); }) @@ -363,7 +372,7 @@ angular.module('routerApp').controller('userController', function ($q, $window, // From shopping cart to invoice $scope.buy = function (payid) { - console.log("YAY"); + console.log(payid); $http.get("http://localhost:50031/api/GenerateInvoice?custId=" + $cookies.get('userid') + "&payId=" + payid + "&orderId=" + $scope.currOrderID) .success(function (response) { $http.get("http://localhost:50031/api/CreateOrder?CustomerID=" + $cookies.get('userid')) @@ -383,7 +392,7 @@ angular.module('routerApp').controller('userController', function ($q, $window, // Initialize User Portal Informations $scope.initPortal = function () { - // $scope.getMyOrders(); + $scope.getMyOrders(); } // Get Invoice for a specific user diff --git a/TeamDBAwesome/TeamDBAwesome/pages/user-home.html b/TeamDBAwesome/TeamDBAwesome/pages/user-home.html index 8fc9c62..2001818 100644 --- a/TeamDBAwesome/TeamDBAwesome/pages/user-home.html +++ b/TeamDBAwesome/TeamDBAwesome/pages/user-home.html @@ -47,12 +47,10 @@

- - - - - - + + + +

My Orders


Click an order to see details
Track Name
Price
{{x}}{{x}}

My Orders


Click an order to see details
Invoice Number
{{x.invoiceId}}
diff --git a/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html b/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html index 9291766..66dbda3 100644 --- a/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html +++ b/TeamDBAwesome/TeamDBAwesome/pages/user-ordermodal.html @@ -1,8 +1,14 @@ 
-

CATS CATS CATS CATS CATS

+

Invoice ID : {{catcats.invoiceId}}

+

Invoice Date : {{catcats.invoiceDate}}

+

Invoice Address : {{catcats.address}} {{catcats.city}} {{catcats.state}}

+

Apple token : {{catcats.paymment.token}}

+

Email Address : {{catcats.payment.email}}

+

Card number : {{catcats.payment.cardnum}}

+

Card number : {{catcats.payment.expr_date}}

- +
{{x.TrackName}}
diff --git a/TeamDBAwesome/TeamDBAwesome/pages/user-orders.html b/TeamDBAwesome/TeamDBAwesome/pages/user-orders.html index d4cfd39..d3354bb 100644 --- a/TeamDBAwesome/TeamDBAwesome/pages/user-orders.html +++ b/TeamDBAwesome/TeamDBAwesome/pages/user-orders.html @@ -56,15 +56,21 @@
Album Name
Media Type
Genre
- CLIP +
Price
-
+
{{x.TrackName}} {{x.AlbumTitle}} {{x.MediaType}} {{x.Genre}} - CLIP + + +
+ {{x.UnitPrice}}