DISC 4372 Midterm Spring 2009 Parks

1. (60 points) An architectural/engineering firm wished to keep track of drawings for their projects. A project table contains the descriptive data for each project. Assume the project table that has:

proj_id int not null,
proj_name varchar(40) not null,
primary key (proj_id)

Further, there is a table of drawings called drawings that contains the information related to all the project drawings (there will be several) for a project are stored. Specifically, the drawings table has:

proj_id int not null,
drawing_set int IDENTITY (1,1),
drawing_type char(1) not null,   ["A"=architectural, "N"=engineering, "E"=electrical, "M"=mechanical, "L"=landscape]
drawing_desc varchar(40) not null,
drawing_file varchar(60),
drawing_date varchar(30),
drawing_version int,
primary key (proj_id,drawing_set)

Rebuild the table for this exam here

Write an update asp program for modifying existing drawings in a project. This will be a four step (pass) process:

  1. On the first pass, provide a list of all available projects from the project table. Display each proj_id and proj_name on a line, ordered by ascending proj_id. Allow the user to click on a proj_id and pass the proj_id to the next step via a querystring.
  2. Return a page with the proj_id and proj_name displayed at the top. Provide a list of all drawings for the project (i.e., the proj_id chosen in the previous step) showing: drawing_set, drawing_type, drawing_date, and drawing_desc. The drawing_set value shown should be a clickable link that passes the drawing_set number to the next pass. proj_id must also be passed.
  3. (a) Return a page with drawing_set, drawing_type, drawing_desc as they exist in the table row for the drawing_set/proj_id provided from the previous step. (b) additionally, provide 3 textboxes for: drawing_file; drawing_date; and drawing_version with the data from the table row displayed so that it may be modified. Remember that proj_id must also be passed. Provide a single submit button which returns the data to the next step.
  4. Update the data in the appropriate row in the drawings table. Use transaction control. Parameterize the SQL. Do NOT edit the data.. Report the outcome of the update attempt to the user.
Use querystrings in ALL passes (i.e., no POST method forms).

See the working answer program here
See the source code for the answer program here

2. (40 points) Using the data in the drawings table above, write an asp program that shows the entire contents of the drawings table ordered by: (1) drawing_set in ascending order, and (2) by the drawing_type in ascending order in an HTML table. Include one HTML column for each column of the drawings table (as shown above). Substitute the words: "architectural", "engineering", "electrical", "mechanical" or "landscape" for the one-characters codes stored in drawing_type field. Additionally, provide a column with the proj_name from the project table. Count and display the number of drawings at the end of the report. DO NOT PROVIDE HEADINGS.

See the working answer program here
See the source code for the answer program here