Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Search started, Order page added
Added descriptions from requirements to each page. Wrote two versions of
search, one to match the current implementation and one that matches the
requirements. Decided we need an order page.
  • Loading branch information
adl13006 committed Nov 25, 2015
1 parent 107340c commit 4fd6904
Show file tree
Hide file tree
Showing 13 changed files with 301 additions and 56 deletions.
Binary file modified API_REF.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions TeamDBAwesome/TeamDBAwesome/TeamDBAwesome.csproj
Expand Up @@ -218,6 +218,7 @@
<Content Include="pages\templates\user-header.html" />
<Content Include="pages\user-account.html" />
<Content Include="pages\user-home.html" />
<Content Include="pages\user-orders.html" />
<Content Include="pages\user-playlists.html" />
<Content Include="Scripts\angular.min.js" />
<Content Include="Scripts\bootstrap.js" />
Expand Down
8 changes: 8 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/app.js
Expand Up @@ -47,6 +47,14 @@ app.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
'footer': {templateUrl: 'pages/templates/footer.html'}
}
})
.state('user-orders', {
url: '/orders',
views: {
'header': { templateUrl: 'pages/templates/user-header.html' },
'content': { templateUrl: 'pages/user-orders.html' },
'footer': { templateUrl: 'pages/templates/footer.html' }
}
})
.state('user-account', {
url: '/manageaccount',
views: {
Expand Down
44 changes: 39 additions & 5 deletions TeamDBAwesome/TeamDBAwesome/js/userController.js
Expand Up @@ -13,29 +13,59 @@ angular.module('routerApp').controller('userController', function ($q, $window,
$http.get("http://localhost:50031/api/GetCustomer?PersonID=" + customerid)
.success(function (response) {
$scope.user = angular.copy(response);
console.log($scope.user);
console.log(response);
})
}
// Update User Information
$scope.updateUser = function () {
console.log("Update User");
var promise = $http({
method: "post",
url: "http://localhost:50031/api/NewCustomer",
url: "http://localhost:50031/api/UpdateCustomer",
headers: {
contentType: "application/json"
},
data: $scope.user
}).
success(function (data, status, headers, config) {
$scope.messages = 'You are now registered and may now log in. ';
$scope.messages = 'You have successfully updated your information. ';
}).
error(function (error, status, headers, config) {
$scope.messages = 'There was a network error. Try again later.';
});
}

// Dealing with Search
$scope.columns = [
{ field: 'TrackId', displayName: ' ', cellTemplate: '<center><button data-ng-click="addToCart(12)" class="btn btn-success btn-xs">Purchase</button></center></td>' },
{ field: 'TrackName', displayName: ' Track Name'},
{ field: 'AlbumTitle', displayName: ' Album Title '},
{ field: 'MediaType', displayName: ' Media Type ' },
{ field: 'Genre', displayName: ' Genre ' },
{ field: 'Clip', displayName: ' Sound Clip '},
{ field: 'UnitPrice', displayName: ' Unit Price ' }
];

$scope.gridOptions = {
data: null,
enableSorting: true,
columnDefs: $scope.columns,
onRegisterApi: function (gridApi) {
$scope.gridApi = gridApi;
var cellTemplate = 'ui-grid/selectionRowHeader';
$scope.gridApi.core.addRowHeaderColumn({ name: 'rowHeaderCol', displayName: '', width: 30, cellTemplate: cellTemplate });
}
};


// Search Function
$scope.search = function (token) {
console.log(token);
$http.get("http://localhost:50031/api/Search?search=" + token)
.success(function (response) {
$scope.data = angular.copy(response);
$scope.gridOptions.data = $scope.data.Track;
});
}

/* Begin Function Definitions */
$scope.authenticateUser = function (id, pass) {
return $q(function (resolve, reject) {
Expand All @@ -58,6 +88,10 @@ angular.module('routerApp').controller('userController', function ($q, $window,
})
}

$scope.addToCart = function (trackid) {
console.log(trackid);
}

$scope.logout = function () {
$scope.messages = 'You have been logged out.';
$cookies.remove("PWD");
Expand Down
26 changes: 8 additions & 18 deletions TeamDBAwesome/TeamDBAwesome/pages/admin-customerinfo.html
Expand Up @@ -3,24 +3,14 @@

<h2 class=''>Customer Info</h2><div>

<!-- <div id="messages" class="alert alert-info" data-ng-show="messages" data-ng-bind="messages"></div> -->
<!-- <div id="messages" class="alert alert-info" data-ng-show="messages" data-ng-bind="messages"></div> -->
<!-- Generate a current list of questions w/ toggle disable -->
Review Customer Demographic Screen – this screen should be similar to the edit profile
screen (see Figure 1 again) but it should include the ability to search for a customer by
different means. This could include any of: First and Last Names, Company Name,
Address/City/State/Country/Postal Code, Phone, Fax, and Email; whatever seems
appropriate.

<!-- Generate a current list of questions w/ toggle disable -->

<accordion>
<!-- Page 1 -->
<accordion-group heading="Customer Accordian Example 1">
<table>
Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas non imperdiet ante, in eleifend nunc. Cras sollicitudin vehicula faucibus. Ut egestas tincidunt fermentum. Vestibulum eu nibh imperdiet lorem vulputate pulvinar vel ut turpis. Aenean rutrum et leo eu tincidunt. Praesent egestas velit eget odio interdum sollicitudin. Maecenas et feugiat erat. Nunc venenatis elit eu maximus porttitor. Mauris facilisis vestibulum purus et condimentum. Fusce ex erat, ullamcorper sed turpis nec, sollicitudin accumsan nibh. Maecenas sodales nulla id nibh efficitur euismod vitae a massa. Aliquam efficitur dignissim libero, eu dapibus nibh pulvinar pulvinar.
</table>
</accordion-group>
<!-- Page 2 -->
<accordion-group heading="Customer Accordian Example 2">
<table>
Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas non imperdiet ante, in eleifend nunc. Cras sollicitudin vehicula faucibus. Ut egestas tincidunt fermentum. Vestibulum eu nibh imperdiet lorem vulputate pulvinar vel ut turpis. Aenean rutrum et leo eu tincidunt. Praesent egestas velit eget odio interdum sollicitudin. Maecenas et feugiat erat. Nunc venenatis elit eu maximus porttitor. Mauris facilisis vestibulum purus et condimentum. Fusce ex erat, ullamcorper sed turpis nec, sollicitudin accumsan nibh. Maecenas sodales nulla id nibh efficitur euismod vitae a massa. Aliquam efficitur dignissim libero, eu dapibus nibh pulvinar pulvinar.
</table>
</accordion-group>

</div>
</div>
</div>
<br><Br><br>
5 changes: 5 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/pages/admin-home.html
Expand Up @@ -4,6 +4,11 @@
<h2>Welcome Admin</h2>
<h3>Display Orders to move to invoice</h3>
<br><br>
Active Order Screen - where clicking an order from the dashboard goes to another screen to
show the status and content of each order. This should have a similar content and structure
to the “Pending/Completed Orders and Status Screen” of the Customer. This will also
involve additional capabilities for processing the order and interacting with customers on
screen that is enabled from the click.
</div>
</div>
<div ui-view></div>
Expand Down
18 changes: 17 additions & 1 deletion TeamDBAwesome/TeamDBAwesome/pages/admin-mediacenter.html
@@ -1,5 +1,21 @@
<div ng-controller='adminController'>
<div class="text-center">
<h1 class=''>Media Center Here</h1>
<h1 class=''>Media Center Here</h1><br /><br />
Enter/Edit New Media Screen – as shown in Figure 4 for the UConnJobSearch app, there
needs to a screen to enter all of the information on a new media item including: track name,
album name, artist name, composer name, genre name, and/or media name; this means
entering new artists, albums, genres, media types, and tracks. You may also need to add
new track names as well. <br /><br />
Create/Manage Playlists: A screen that for a Employee to create/manage/modify playlists
(nPlaylist and PlaylistTrack entities/tables) for the Chinook web app, which requires
detailed search capabilities for tracks (track name, album name, artist name, composer
name, genre name, and/or media name). This has the ability to modify an existing Chinook
playlist (add or remove tracks or remove the entire playlist). This also has the ability to
create a new named Chinook playlist which will allow the Employee to perform a detailed
search and select tracks. The Search Screen, as shown in Figure 3 for the UConn Job Search,
the upper left should have a set of options to search media by track name, album name, artist
name, composer name, genre name, and/or media name, return the results. You will need to
support multiple pages for the result sets since there can be many results based on the search
criteria. <br /><br />
</div>
</div>
18 changes: 17 additions & 1 deletion TeamDBAwesome/TeamDBAwesome/pages/admin-view.html
@@ -1,5 +1,21 @@
<div ng-controller='adminController'>
<div class="text-center">
<h1 class=''>Results View here</h1>
</div>
</div><br /><br />
o Sales Reporting: There a number of dimensions that can be used singularly or combined.
The duration dimension would support search by day, month, year, or date range. The
location dimension of would support by city/state/country. The media dimension would
allow different combinations of: track name, album name, artist name, composer name,
genre name, and/or media. The customer dimension would include: single customer, set
of customers (selected by administrator), customers in a city, customers in a state,
customers in a country. Any one or more could be combined. The sales reporting would
be taken from the Invoice and InvoiceLine Tables for the appropriate costs (sales can be
total or broken down – another dimension) which could include both the UnitPrice
(Track) as well as the total Sales (all UnitPrices for all tracks) and the Quantity
(InvoiceLine Table).<br />
Inventory Reporting: Drop down selections for: A screen that has the ability to run a
wide range of reports on media by track name, artist, composer, genre, media,
milliseconds, bytes, and/or composer. These can be summary reports by artist name, by
compose, genre, etc. The report needs to work for all combinations. This is utilizing the
media dimension
</div>
68 changes: 47 additions & 21 deletions TeamDBAwesome/TeamDBAwesome/pages/templates/user-header.html
@@ -1,27 +1,53 @@
<style>
.navbar-xs { min-height:60px; height: 60px; }
.navbar-xs .navbar-brand{ padding: 0px 12px;font-size: 16px;line-height: 28px; }
.navbar-xs .navbar-nav > li > a { padding-top: 0px; padding-bottom: 0px; line-height: 28px; }
.navbar-xs {
min-height: 60px;
height: 60px;
}

.navbar-xs .navbar-brand {
padding: 0px 12px;
font-size: 16px;
line-height: 28px;
}

.navbar-xs .navbar-nav > li > a {
padding-top: 0px;
padding-bottom: 0px;
line-height: 28px;
}
</style>


<nav class="navbar navbar-inverse navbar-fixed-top navbar-xs" role="navigation">
<div class="container">
<div class="navbar ">
<ul class="nav navbar-nav navbar-right navbar-xs" style="margin-top: 12px;">
<li><a ui-sref="user-home">
<center><span class="glyphicon glyphicon glyphicon-home" aria-hidden="true"><br></span>&nbsp;User Portal</center>
</a></li>
<li><a ui-sref="user-account">
<center><span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true"><br></span>&nbsp;Manage Account</center>
</a></li>
<li><a ui-sref="user-playlists">
<center><span class="glyphicon glyphicon glyphicon glyphicon-equalizer" aria-hidden="true"><br></span>&nbsp;Playlist Editor</center>
</a></li>
<li><a ui-sref="home">
<center> <span class="glyphicon glyphicon glyphicon glyphicon-console" aria-hidden="true"><br></span>&nbsp;Logout</center>
</a></li>
</ul>
</div>
</div>
<div class="container">
<div class="navbar ">
<ul class="nav navbar-nav navbar-right navbar-xs" style="margin-top: 12px;">
<li>
<a ui-sref="user-home">
<center><span class="glyphicon glyphicon glyphicon-home" aria-hidden="true"><br></span>&nbsp;User Portal</center>
</a>
</li>
<li>
<a ui-sref="user-account">
<center><span class="glyphicon glyphicon glyphicon-edit" aria-hidden="true"><br></span>&nbsp;Manage Account</center>
</a>
</li>
<li>
<a ui-sref="user-playlists">
<center><span class="glyphicon glyphicon glyphicon glyphicon-equalizer" aria-hidden="true"><br></span>&nbsp;Playlist Editor</center>
</a>
</li>
<li>
<a ui-sref="user-orders">
<center><span class="glyphicon glyphicon glyphicon-shopping-cart" aria-hidden="true"><br></span>&nbsp;My Orders</center>
</a>
</li>
<li>
<a ui-sref="home">
<center> <span class="glyphicon glyphicon glyphicon glyphicon-console" aria-hidden="true"><br></span>&nbsp;Logout</center>
</a>
</li>
</ul>
</div>
</div>
</nav>
5 changes: 4 additions & 1 deletion TeamDBAwesome/TeamDBAwesome/pages/user-account.html
Expand Up @@ -61,7 +61,10 @@
<div class="form-actions">
<button type="submit" ng-disabled="form.$invalid || vm.dataLoading" data-ng-click="updateUser(user)" class="btn btn-primary">Submit Changes</button>
</div>
</form>
</form><br /><br />
<h2>Update Payment Methods</h2><br />
Set/edit payment types Screen – design a screen that lets a customer choose credit card,
check, paypal, Google Pay, and Apple Pay options.
</div>

</div>

0 comments on commit 4fd6904

Please sign in to comment.