Assignment3 Instructions
Assignment3 Instructions
In this project, you’ll validate the data a user enters in a data-driven web app.
INTERNAL
USE
Specifications
When the app starts, it should display quarterly sales data and provide a drop-down that allows a user
to filter by employee.
The web app should have a page to enter a new employee, and a page to enter new sales data. To keep
things simple, this app doesn’t provide edit or delete capabilities.
Here are the requirements for valid data for a new employee:
o First name, last name, date of birth, date of hire, and manager are required.
o Date of birth and date of hire must be valid dates that are in the past.
o Date of hire must not be before 1/1/1995, the date the company was founded.
o A new employee may not have the same first name, last name, and date of birth of an
employee that’s already in the database.
o A new employee may not have a manager with the same first name, last name, and date of
birth. That is, employee and manager may not be the same person.
Here are the requirements for valid data for a new sales amount:
o Quarter, year, amount, and employee are required.
o Quarter must be between 1 and 4.
o Year must be after the year 2000.
o Amount must be greater than 0.
o New sales data may not have the same quarter, year, and employee as sales data that’s
already in the database.
The web app should include the jQuery validation libraries so validation happens on the client, as a
convenience to users. However, for security, all validation should take place on the server as well. To
keep things simple, you can make your custom validation attributes only validate on the server. Thus,
they will only fire after all client-side validation has passed.
To make it possible to enter a new employee, you can edit the context file so it provides some seed
data so the database includes at least one employee that you can select as a manager. For example,
you might want to add data for an employee something like this:
new Employee
{
EmployeeId = 1,
Firstname = "Ada",
Lastname = "Lovelace",
DOB = new DateTime(1956, 12, 10),
DateOfHire = new DateTime(1995, 1, 1),
ManagerId = 0 // has no manager
}
INTERNAL
USE
Project 13-1 Add paging, sorting, and filtering to the
Quarterly Sales app
In this project, you’ll update the Quarterly Sales app from project 11-1 so the table that displays sales
data allows for paging, sorting, and filtering.
Specifications
When the app starts, it should display a table of sales data with the following features:
o Drop-downs that allow a user to filter sales by employee, year, and/or quarter.
o Links in the table header that allow a user to sort sales by employee, year, quarter, or amount.
o The first time a user clicks on a sorting link, the data should sort in ascending order. If the
user continues clicking on that link, the sorting should toggle between descending and
ascending order.
o Display a page of sales records, rather than all the sales records, and provide links below the
table that allow the user to navigate through the pages.
The app should have a user-friendly URL that shows the page and page size, sort order and sort
direction, and what values are being filtered by.
Note: The Bookstore app from chapter 13 uses a FilterPrefix class to add user-friendly prefixes to the
filter segments. However, it’s simpler to use static content in the route to achieve the same result. For
example, this app can provide filter segments with a static route like this:
.../filterby/employee-{employee}/year-{year}/qtr-{quarter}
INTERNAL
USE