ITC 172 Assignments

Overview

These assignments each explore particular tasks in VB and ASP. They emphasize one or two specific skills. The end of the quarter project is meant to provide a more comprehensive excercise which brings together all the skills you have practiced

The assignments may be modified at any time. I will provide in class exampes for each assignment and post them for your reference.

Turning in Assignments

For most assignments you can turn in the source code of the web page and the VB code behind. You can also zip the website folder and send the whole thing to me if you wish. Send them to spconger@gmail.com(it has more room than my Exchange email address at school

Sometimes I will ask to see the assignment in class, because there are elements that may be hard to judge from the code alone.

Grading

For each assignment I will judge it according to the skills listed. If I give you less than the full 10 points, I will tell you what skill I deducted points for and why. You can redo it to get the full points if you wish.

If I respond to your assignment with a good, or OK, it means you have received all 10 points and I am satisfied with it.


Assignment One

In this assignment we will allow the user to enter their name and zip code and then return the location of an Automart service shop in their zipcode or a message that there is not location in their area. Although it is a bit of an overkill, We will create a class that takes the zip code through a constructor, compares it to a array of zip codes. We will have a parallel array that contains the name and address of the location (this can just be a long string in a single dimension array). If the zip code the customer sends, matches a zip code in the array, a class method will return the location name and address.The class should have a property for the zipcode, a method that matches the array, and a method that returns the message (address or sorry)

Here are a list of the locations of the shops and their zipcodes

Central Area 98122
Kent East 98222
Bellevue 98322
South Tacoma 98422
CDA 83814

Skills


Assignment Two

We are going to list all the services offered at Automart services with a check mark for each. When services are checked and a button clicked the page will return the total cost of the services, the tax (.089) and the total with tax.You can use a two dimensional array of services and prices. Add a simple css style sheet to spruce the page up. (the style sheet does not have to be very sophisticated or complex. I encourage you to use css style sheets from now on, but will not require them.)

Here is a list of the services and prices

Oil change and Lube $ 45.50
air filter change $ 20.50
Radiator flush $ 89.99
Change Transmission fluid $ 65.40
Wiper Blade $ 25.00
Rotate Tires $ 40.50
replace break lights $ 18.75

Skills


Assignment Three

For this assignment we will take some customer information and then pass it to a second page where we will re show the information and thank the user for their interest. Make text boxes (with the appropriate labels) for the customers first and last names, Address, City, Zip code, phone and email. When they click the submit button, transfer the information to the next page, and arrange it with labels. Add a thank you for their participation. You can use the query string method, cookies or Session state variables to transfer the information between pages. (for an extra challenge try all three)

Skills


Assignment Four

For this assignment we will let a customer set up an appointment. Add drop down list that contains all the locations. Add a calendar control to your web form. Let the customer enter their name, phone number, and email, select a location from the drop down list (use the same locations we used for Assignment one), click on a date from the calendar (we won't worry about time), and then click the submit key to pass to a second web page that confirms the appointment. Use the validation controls to require the name, and phone number fields. Validate the form of the phone and the email fields. For an added feature you can test whether the date is a weekend and return a message that Automart is not open on weekends.

Skills


Assignment Five

Now we start talking to an actual database using ADO. For this assignment we will create two web pages. The first one will let us add a customer and vehicle to the Automart database, the second page will display all customers. Link the two pages

First we will connect to the database. The first page will contain text boxes to allow a customer to enter all their information including their vehicle information. You should validate the fields and incorporate some error trapping. This will require two insert statements, one into customer and one into vehicle. Use command parameters for the insert values.

For the second page, Add a drop down list of vehicle license plates. Get the license plates from the database. When a user selects a license, return the customer information associated with that car. To do this you will need to create a join. It should look like the following.

Select CLastName, CFirstName, CEmail
From Customer c
Inner Join Vehicle v
On c.CID=v.CID
Where VLicense=@License

Make sure the autopostback property of the Drop down list is set to true. You can display the customer details with labels.

Skills


Assignment Six

For this assigment we are going to use what are called "data aware" controls. First add a list box. Use the new data source wizard to bind it to the locations table. Retrieve the LID and the location name. Display the name and use the LID as the value field. Then add a GridView control. Use the new data source control. Add your own sql. Add this SQL:

SELECT sh.SHDate, 
c.CLastName, 
c.CfirstName, 
v.VLicense, 
v.VType, 
v.VYear, 
c.CID, 
v.CID AS Expr1, 
sh.LID FROM Customer AS c 
INNER JOIN Vehicle AS v 
ON c.CID = v.CID 
INNER JOIN ServiceHistory AS sh 
ON v.VLicense = sh.VLicense 
WHERE (sh.LID = @LID)

Make it so that when the user changes the selection in the drop down list, the grid view shows all the customers who have used that location. Make sure that you set the autopostback property of the drop down list to true. You may want to set the v.CID visible property to false.

Skills


Project overview

The project is designed for you to put all the pieces together. Ideally you should work in groups of three or four. The first step is to come up with a project idea. First the project must be database driven. You can use our database, or create a new one. I want the project to include some elements we haven't covered so that you can practice your research skills. It is essential to know how to find the information you need.

Instructions

Determine the project idea, write it up. I must approve it

The project should include

To turn in

These are things I want to see from the project

  1. A written description of the proposed project
  2. The project folder zipped (if you email it to me change the .zip extension to .piz)
  3. a list of resources used
  4. A check list of all the required items
  5. A list of group members and their contributions

The presentation

Each group will present their project. The presentation does not need to go over every little thing you did. Rather you should focus on the following


Assignment Seven

For this assignment we will use filestream to create and write and read a log file that records when the web page connects to the SQL server. Create a web page similar to assignment 5. (You can even use assignment 5 if you wish) Add a method to the page to log connections to a file. It should log the time and the server name(?). Add a second web page that has a multiline text box. Add a button that will load the file into the text box and another that will delete it. Create error handling code to handle file not found code and other errors.

Skills


Assignment eight

For this assignment we will use the Web Configuration tool and set up form authentication. We are going to create a very simple application in which users must log on, and what pages they can see depends upon their role.

Instructions

  1. Use the web site configuration tool to switch to forms authentification and to create two roles "HR" and "Guest"
  2. Create 3 users, one who is a member of the HR role and two who are members of the guest role
  3. This application will use several pages.
  4. Login.aspx This page will have the login control and will direct users who successfully log in to the Welcome.aspx page
  5. The Welcome page, which contains two hyperlinks, one to Employees.aspx and one to loctions.aspx.
  6. Employees.aspx should have the loginview control. In the Logged in template put a DataView that is bound to a SQLDataSource control that connects to the mechanics Table. Include all the fields. Use the Advanced button to make these fields editable. And add the update button. This page should only be viewable if the user currently logged in is a member of the HR role. If the user is not a member of the HR role, they should be redirected to the NoPrivs.aspx page. In the anonymous template include a message and a loginstatus control
  7. NoPrivs.aspx, should have text saying something about not having permissions to view the employee page and a link back to the welcome page
  8. The Location page should have a loginView control also, but anyone in any role can view it as long as they are logged in. In the loggedin view include a datalist that shows all the Locations and their address information. You can use a sqlDataSources. In the anonymous section include a message something like, please log in to see the product list, and a loginStatus control.
  9. You will only have to enter two lines of actual code in the application. This will be in the PageLoad event of the Employees.aspx. In it you will have to test for the users role.(you can also use roles in the logged in template instead)
If User.IsInRole("HR")=false then
    Response.Redirect("NoPrivs.aspx")
End If
	

Skills