ASP.Net MVC 5 Homework 9 Artist Database in Azure

View on GitHub

ASP.Net MVC 5 Homework 9 Artist Database in Azure

This demo page is the same as HW8 because I demonstrated HW8 in Azure. The database and web app were all in deployed in Azure already.

The process that I went through to deploy in Azure.

Start new resource group

New Resource Group

Create the a new empty database, resource group, and server.

New Database and Server

Allow IP address in server

Allow IP Address

Create new Web App

New Web App

Database connection string location

Connection String

Enter connection string in application settings

Enter Connection String

Enter deployment credentials

Deployment Credentials

Set up new connection in ADO

ADO Connection

Publish app

Publish

Deploy app

Deploy

The Homepage

The homepage has a list of buttons with different genres. Each button will display a list of artworks by their genres. A loading spinner will display while the content is being retrieved so that you knwo it’s doing something in the background. Once the artwork has been retrieved, it will be displayed using ajax.

Homepage Index

After clicking a genre button a spinner pops up so the user knows it is working on the request.

Homepage spinner

List of portrait genres.

Portrait Genre

List of renaissance genres.

Renaissance Genre

List of surrealism genres.

Surrealism Genre

List of tesselation genres.

Tesselation Genre

The following is a demonstration of Artist creation and manipulation

Creating an artist.

Artist List

Entering invalid data into the name and place of birth.

Create Artist Bad Name

Entering invalid date.

Artist Invalid Date

Entering valid data for a user.

Artist Good Input

Artist list after creating John Birks.

Artist John Birks

Artist details page.

Artist Details

Updating an artist.

Artist Update

Delete artist page.

Artist Delete

After deleting Alexander Molodyh.

Artist Deleted

A list of ArtWork

ArtWork List

A list fo Classifications.

Classification

These are the database tables with the sample data.

Artist table

Artist Table

ArtWork table

ArtWork Table

Genre table

Genre Table

Classification table

Classification Table

The database up script

/*
 * Author: Alexander Molodyh
 * Date: 11/28/2017
 * Class: CS460
 * Assignment: HW8
 *
 */

/*Artist table*/
CREATE TABLE dbo.Artist
(
	ArtistName NVARCHAR(50) NOT NULL,
	DOB DATETIME2 NOT NULL,
	BirthCity NCHAR(100) NOT NULL,
	CONSTRAINT [PK_dbo.ArtistName] PRIMARY KEY CLUSTERED (ArtistName ASC)
);


/*ArtWork table*/
CREATE TABLE dbo.ArtWork 
(
	ArtWorkTitle NVARCHAR(50) NOT NULL,
	Artist NVARCHAR(50) NOT NULL
	CONSTRAINT [PK_dbo.ArtWorkTitle] PRIMARY KEY CLUSTERED (ArtWorkTitle ASC),
	CONSTRAINT [FK_dbo.Artist] FOREIGN KEY (Artist) REFERENCES dbo.Artist(ArtistName)
);


/*Genre table*/
CREATE TABLE dbo.Genre
(
	GenreName NVARCHAR(40) NOT NULL,
	CONSTRAINT [PK_dbo.Genre] PRIMARY KEY CLUSTERED (GenreName ASC)
);


/*Classification table*/
CREATE TABLE dbo.Classification
(
	ArtWork NVARCHAR(50) NOT NULL,
	Genre NVARCHAR(40) NOT NULL,
	CONSTRAINT [PK_dbo.ArtWork_Genre] PRIMARY KEY CLUSTERED (ArtWork, Genre ASC),
	CONSTRAINT [FK_dbo.ArtWork] FOREIGN KEY (ArtWork) REFERENCES dbo.ArtWork(ArtWorkTitle),
	CONSTRAINT [FK_dbo.Genre] FOREIGN KEY (Genre) REFERENCES dbo.Genre(GenreName)
);


/*Artist sample data*/
INSERT INTO dbo.Artist
(
    ArtistName,
    DOB,
    BirthCity
)
VALUES
    ('MC Escher', DATETIME2FROMPARTS(1898,6,17,1,1,1,5,1), 'Leeuwarden, Netherlands'),
	('Leonardo Da Vinci', DATETIME2FROMPARTS(1519, 5, 2,1,1,1,5,1), 'Vinci, Italy'),
	('Hatip Mehmed Efendi', DATETIME2FROMPARTS(1680, 11, 18,1,1,1,5,1), 'Unknown'),
	('Salvador Dali', DATETIME2FROMPARTS(1904, 5, 11,1,1,1,5,1), 'Figueres, Spain');


/*Genre sample data*/
INSERT INTO dbo.Genre
(
    GenreName
)
VALUES
('Tesselation'),
('Surrealism'),
('Portrait'),
('Renaissance');


/*ArtWork sample data*/
INSERT INTO dbo.ArtWork
(
    ArtWorkTitle,
    Artist
)
VALUES
(   'Circle Limit III', 'MC Escher' ),
(   'Twon Tree', 'MC Escher' ),
(   'Mona Lisa', 'Leonardo Da Vinci' ),
(   'The Vitruvian Man', 'Leonardo Da Vinci' ),
(   'Ebru', 'Hatip Mehmed Efendi' ),
(   'Honey Is Sweeter Than Blood', 'Salvador Dali' );


/*Classification sample data*/
INSERT INTO dbo.Classification
(
    ArtWork,
    Genre
)
VALUES
( 'Circle Limit III', 'Tesselation' ),
( 'Twon Tree', 'Tesselation' ),
( 'Twon Tree', 'Surrealism' ),
( 'Mona Lisa', 'Portrait' ),
( 'Mona Lisa', 'Renaissance' ),
( 'The Vitruvian Man', 'Renaissance' ),
( 'Ebru', 'Tesselation' ),
( 'Honey Is Sweeter Than Blood', 'Surrealism' );
GO
The database down script
/*
 * Author: Alexander Molodyh
 * Date: 11/28/2017
 * Class: CS460
 * Assignment: HW8
 *
 */


/*Drop Classification Constraints*/
ALTER TABLE dbo.Classification DROP CONSTRAINT [PK_dbo.ArtWork_Genre], [FK_dbo.ArtWork], [FK_dbo.Genre];
GO

/*Drop Classification table*/
DROP TABLE dbo.Classification;
GO



/*Drop ArtWork table constraints*/
ALTER TABLE dbo.ArtWork DROP CONSTRAINT [PK_dbo.ArtWorkTitle], [FK_dbo.Artist];
GO

/*Drop ArtWork table*/
DROP TABLE dbo.ArtWork;
GO



/*Drop Artist constraints*/
ALTER TABLE dbo.Artist DROP CONSTRAINT [PK_dbo.ArtistName];
GO

/*Drop Artist table*/
DROP TABLE dbo.Artist;
GO



/*Drop Genre constraints*/
ALTER TABLE dbo.Genre DROP CONSTRAINT [PK_dbo.Genre];
GO

/*Drop Genre table*/
DROP TABLE dbo.Genre;
GO