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
Create the a new empty database, resource group, and server.
Allow IP address in server
Create new Web App
Database connection string location
Enter connection string in application settings
Enter deployment credentials
Set up new connection in ADO
Publish app
Deploy app
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.
After clicking a genre button a spinner pops up so the user knows it is working on the request.
List of portrait genres.
List of renaissance genres.
List of surrealism genres.
List of tesselation genres.
The following is a demonstration of Artist creation and manipulation
Creating an artist.
Entering invalid data into the name and place of birth.
Entering invalid date.
Entering valid data for a user.
Artist list after creating John Birks.
Artist details page.
Updating an artist.
Delete artist page.
After deleting Alexander Molodyh.
A list of ArtWork
A list fo Classifications.
These are the database tables with the sample data.
Artist table
ArtWork table
Genre 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