Home > 2011 Winter BTI420 > BTI420 Lab 1

BTI420 Lab 1

January 17, 2011 Leave a comment Go to comments

Lab 1 helps you learn about the “web forms” page lifecycle. You also get a good workout with a new language, C#. It is due on Monday January 24.

.

BTI420 Lab 1 – due Mon Jan 24

Assigned: During Week 2

Due date: Monday, January 24, 2011, at 9:00am ET

Grade value: 3% of your final course grade

Grading method: The following will be checked:

  • Your “labs/lab1.aspx” page
  • Correct interactive operation of the page’s logic
  • Accurate numerical calculations

.

Objective(s)

Use some ASP.NET “list” web server controls

Start to learn about layout capabilities and formatting in ASP.NET Web Forms

Begin using a number of .NET Framework classes

Deploy your work to your warp-based web site

.

Introduction to the problem that you will solve

The Red Dog Bus Company (2011) needs a new point-of-purchase bus trip ticketing application for its ticket agents. The company currently has four bus routes:

  • Toronto to Barrie ($10.10 per ticket)
  • Toronto to Peterborough ($12.30 per ticket)
  • Toronto to Montreal ($42.00 per ticket)
  • Toronto to Thunder Bay ($114.30 per ticket)

Your job is to create a simple ASP.NET Web Form using the C# language. Your web form should keep track of the number of empty seats on each of the four routes. When the program is first run, all routes will have 38 empty seats. The ticket agent should be presented with a screen that looks like the example below.

(Your page may look different from the following example.)

.

Specifications

In the root of your web site, create a folder called “labs”. In that folder, create a Web Form called “lab1.aspx”. Choose the option to “Place code in separate file”.

The screen should show a listing of the available tickets remaining on each of the bus routes.

Hint: Use a table (from the Visual Studio menu) to help lay out the data.

The cell contents will be “Label” web server controls.

The program should allow the user to make a ticket purchase by following these steps:

  1. Select the route from a drop-down or listbox list control
  2. Select the number of tickets required using a different control, preferably another list control
  3. Complete the purchase transaction

.

The “Ticket Availability Status” area must show up-to-date numbers of available tickets.

This example shows the result after a number of transactions have taken place:

(The following example is from a past semester. Your page will look different.)

lab2sequence2routes

.

The example shows a “radio button list” web control in the Step 2 (select the number of tickets) area. You can use a different control if you wish (but don’t annoy the user). One of the controls MUST be a list control. Make sure you use two different types of controls for steps 1 and 2 (that is – don’t use “dropdown lists” for both controls).

Your application should somehow check to ensure that it is NOT possible to select more tickets than are available on a bus route. There are many ways to accomplish this goal; one way is shown below, where it creates only the exact number of radio buttons for the number of tickets remaining on the route.

(Your page may look different from the following example.)

lab2sequence2tickets

.

While making selections from the list controls, the selection’s status should appear in a label control, as shown in the following example:

(Your page may look different from the following example.)

lab2sequence2transaction

.

You do NOT have to use file I/O to successfully complete this lab.

Also, you do not have to use “state persistence” techniques to persist values between postbacks.

Use on-page storage mechanisms (i.e. Label text and ListItem text and value attributes!).

Don’t make this lab exercise too complicated!

If you want to see a live working example of this lab, visit this URL:
http://warp.senecac.on.ca/bti420_111a03/labs/lab1.aspx

This lab will help you learn C# language and syntax, ASP.NET web form operation and programming, Visual Studio usage, and more of the .NET Framework base class library.

Feel free to look in books, on the web, ask your friends for help, talk to your professor, etc. However, don’t just copy someone else’s code without first understanding it yourself. Everyone will struggle a bit, but that’s the point. Don’t get discouraged if you need help. This is a learning experience.

.

Bonus! (no marks)

Make your web form keep and display a running list of transactions that were completed. Put this list at the bottom of the page after each postback, as shown in the following example:

(Your page may look different from the following example.)

lab2sequence2transactionlist

.

Deploying your work to the warp web server

Every BTI420 student has an account on the warp.senecac.on.ca web server.

Please read this post about initializing and configuring your warp web site.

Then, read about deploying content to your warp web site:

Beginning ASP.NET 4 in C# and VB
Chapter 19, pages 706 through 709
COPYING YOUR WEB SITE section

Finally, deploy this Lab 1 to the right location on your warp web site.

.

Submitting your work

Update your warp web site home page to add a link to this lab.

When you complete a lab exercise, you are placing it online, to the warp server. Therefore, you do NOT have to submit paperwork to your professor. Just do the lab, and your professor will find it (as long as it is in the right location!).

Note: As an experienced student, we expect you to be able to follow instructions. When your professor marks this lab, a helper “lab marker” program will browse to your web site’s “default.aspx” page, and expect to find a hyperlink to “~/labs/lab1.aspx”.

So… make sure you understand: This lab should be located at the URL:
http://warp.senecac.on.ca/xxxxxxxx/labs/lab1.aspx (where “xxxxxxxx” is your login ID)

.


Advertisements
Categories: 2011 Winter BTI420
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: