Primary Objectives:

  1. Be able to write a MVC web application that uses a multi-table, relational database instance that you created
  2. Be able to create models with foreign keys and navigation properties
  3. Be able to implement CRUD functionality with non-trivial models
  4. Learn to write more complex T-SQL scripts to create more complex database tables
  5. Practice more LINQ
  6. Implement custom attribute checking

Overall Requirements:

  • You must use a “Code First with an Existing Database” workflow
  • Use a script to create your tables, populate them with sample data and another to delete them; the script(s) need to be added and committed to your git repository
  • All pages must use strongly typed views
  • Use only fluent (dot notation) LINQ syntax

"As a student in CS 460 who is preparing for the final exam, I wish to create a complex web application from scratch -- including database, CRUD functionality and some AJAX -- so that I can practice and get a good grade on the exam."

Circle Limit III by M.C.Escher
Circle Limit III by M.C.Escher

This assignment is based off last years CS 460 Programming Final Exam.

Questions/Tasks:

There are Artists. They paint, sketch, sculpt, draw, ... to produce ArtWorks. People like to categorize works of art into various categories, which we'll call Genres; these categorizations can be called Classifications. Artists produce many works of art. Works of art can be classified under multiple genres (examples follow).

  1. Create a new MVC application in your homework Git repository. Do all your work for this homework in a new feature branch.
  2. Begin with the domain model. There are four entities: Artist, ArtWork, Genre and Classification. This page explains the relations between entities and provides seed data. All relations must be present as named constraints in your database schema. Draw or generate an E-R diagram of your database schema.

    Write an UP and a DOWN script (in App_Data) to create and destroy the database in LocalDB or SQLServer.

  3. Using your UP script (in App_Data), seed the data above into your database tables.
  4. Place a menu item on the shared layout to select one of three views: Artists, ArtWorks and Classifications. Each of these views should show all artists, works of art and classifications, respectively, that are in the database. i.e. they are each a list view. Also add a home page with some form of a welcome.
  5. Commit your work to your local Git repository now. This is so that you can show at least one commit on your development branch for your in-progress work.
  6. Implement CRUD functionality for Artists.

    Here are the 5 items needed:

    • Artist Index/List page
    • Artist Create page (Create)
    • Artist Details page (Read)
    • Artist Edit page (Update)
    • Artist Delete page (Delete)
  7. Add attribute checking to the Artist Edit page to make sure that no attributes are optional, the Name must be no longer than 50 characters and the birthdate cannot be in the future.
  8. Add buttons to the home page, one for every Genre. Use a Razor foreach loop to create the buttons. When a button is clicked, all the works of art that are classified under that Genre are displayed in a table or list on the main page (replacing any that were there from previously clicking a button). Display the artwork title and artists name, sorted by title. You must retrieve and display this data using AJAX.
  9. That's it; put it in your Portfolio!