Skip to content
Permalink
Browse files

adgadgaga

  • Loading branch information
adl13006 committed Dec 8, 2015
1 parent 5c6a5e0 commit f4bbb417ee8b5dd97daedcb8ba01b8f48f10e5f4
@@ -252,6 +252,7 @@
<Content Include="pages\user-account.html" />
<Content Include="pages\user-home.html" />
<Content Include="pages\user-modal.html" />
<Content Include="pages\user-ordermodal.html" />
<Content Include="pages\user-orders.html" />
<Content Include="pages\user-playlists.html" />
<Content Include="Scripts\angular.min.js" />
@@ -13,6 +13,8 @@ angular.module('routerApp').controller('adminController', function ($scope, $htt
$state.go('home');
}

/* Dealing with Order Processing */


/* BEGIN LOGIC */

@@ -297,6 +297,32 @@ angular.module('routerApp').controller('userController', function ($q, $window,
});
}

// Open window for orders
$scope.openOrder = function (size, orderid) {
$scope.getOrderTracks(orderid);
var modalInstance = $uibModal.open({
animation: $scope.animationsEnabled,
templateUrl: 'pages/user-ordermodal.html',
scope: $scope,
controller: 'userController',
resolve: {
items: function () {
return $scope.items;
}
}
});
}

// Get order tracks for an order number
$scope.getOrderTracks = function (orderid) {
$http.get("http://localhost:50031/api/GetOrderTracks?orderId=" + orderid)
.success(function (response) {
$scope.currordertracks = angular.copy(response);
console.log($scope.currordertracks);
})

};

// Get the current order for the customer
$scope.getMyOrder = function () {
var promise = $http({
@@ -337,10 +363,14 @@ angular.module('routerApp').controller('userController', function ($q, $window,

// From shopping cart to invoice
$scope.buy = function (payid) {
console.log("YAY");
$http.get("http://localhost:50031/api/GenerateInvoice?custId=" + $cookies.get('userid') + "&payId=" + payid + "&orderId=" + $scope.currOrderID)
.success(function (response) {
$state.go('user-orders');
$scope.messages = "Your order has been submitted.";
$http.get("http://localhost:50031/api/CreateOrder?CustomerID=" + $cookies.get('userid'))
.success(function (response) {
$state.go($state.current, {}, { reload: true });
$scope.messages = "Your order has been submitted.";
})
})
}
// Initialize Order Informations
@@ -351,6 +381,19 @@ angular.module('routerApp').controller('userController', function ($q, $window,
$scope.getPayments();
}

// Initialize User Portal Informations
$scope.initPortal = function () {
// $scope.getMyOrders();
}

// Get Invoice for a specific user
$scope.getMyOrders = function () {
$http.get("http://localhost:50031/api/GetCustomerInvoice?custId=" + $cookies.get('userid'))
.success(function (response) {
$scope.currorders = angular.copy(response);
console.log($scope.currorders);
})
}

/* End Function Definitions */

@@ -16,7 +16,7 @@
}
</style>

<div ng-controller="userController">
<div ng-controller="userController" data-ng-init="initPortal()">
<center><h1>~~ Browse our Media ~~</h1></center>
<form name="myForm">
<table>
@@ -46,6 +46,14 @@
<div id="grid1" ui-grid="gridOptions" class="gridStyle"></div>

<br /><br />
<h2> Still need to display Orders </h2><br />
<table>
<tr><th colspan="2"><center><h2>My Orders</h2><br />Click an order to see details</center></th></tr>
<td width="90%"><center>Track Name</center></td>
<td width="10%"><center>Price</center></td>
<tr ng-repeat="x in [1,2,3,4]">
<td width="90%">{{x}}</td>
<td width="10%"><text ng-click="openOrder(x)">{{x}}</text></td>
</tr>
</table>

</div>
@@ -0,0 +1,10 @@

<div ng-controller='userController'>
<h2><center>CATS CATS CATS CATS CATS</center></h2>
<table>
<tr ng-repeat="x in currplaylist">
<td>{{x.TrackName}}</td>
</tr>
</table>
<br /><br />
</div>
@@ -1,6 +1,6 @@

<div ng-controller='userController' data-ng-init="initOrders()">

<div id="messages" class="alert alert-info" data-ng-show="messages" data-ng-bind="messages"></div>
<div class="container">
<div class="row sm-flex-center">
<div class="col-sm-7">

0 comments on commit f4bbb41

Please sign in to comment.
You can’t perform that action at this time.