top of page

MIS 333K HW 4: Databases & Identity

Updated: Mar 23, 2021

You are continuing to help the toy store modernize its systems. Create a webpage to help manage the products we sell in our store. Your database will have a table for products and use the pre-defined tables Identity creates to manage users.

The products table should hold the following information:

  1. ProductID – a unique identifier for each product. This should be an auto-generated number.

  2. Name – the product’s name. This field is required.

  3. Description – a brief description of the product. This field is not required

  4. Price – the price of the product. This field is required and should be displayed with a $ and 2 decimal places.

The users table should hold the following information:

  1. UserID – use the built-in Identity field for the unique identifier for the user

  2. First name – the user’s first name. This field is required. Identity does not automatically create this field in the user table; you will need to add it to the AppUser class.

  3. Last name – the user’s last name. This field is required. Identity does not automatically create this field in the user table; you will need to add it to the AppUser class.

  4. Email – the user’s email. This field is required. Use the built-in Identity field for this. Email will also be the user’s username.

  5. Phone – the user’s phone number. This field is required. Use the built-in Identity field for this.


Your system should also support the following business rules:

  1. There are two classifications of users: customers and administrators (admins). Users can register themselves as customers, but admins cannot register themselves as admins. An existing admin can add a customer to the admin role using the Role Admin pages (see the Identity Template).

  2. Any user (anonymous, registered customer, or admin) can view a list of the products or individual details for a product.

  3. Only admins can create, edit or delete products. Anonymous users and registered customers should not see links for the pages to add/edit/delete products. If non-admins attempt to visit the page by typing in the URL, they should see either a request to log in or an error page.

  4. Only admins can see the page to change the role of a customer (RoleAdmin). Anonymous users and registered customers should not see the link to Manage Users. If non-admins attempt to visit the page by typing in the URL, they should see either a request to log in or an error page.

  5. Make sure that you have pre-loaded an admin user into your database so we can test the functionality. The user’s email should be admin@example.com and the password should be Abc123!


Follow the instructions on Canvas to set up your database, entity framework and Identity. Once you have created your database and updated your project, add a controller for products. Make sure everything is working.


Make sure that your website doesn’t show an error if I go to just http://{yourwebsite}.azurewebsites.net. You can either have a home page with a link that takes you to the product index page, use the index action on the home controller to redirect to the index action on the products controller, or modify the Startup.cs file to make Products/Index the default page. Any of these options is acceptable. Just make sure it works.


Publish your working website to Azure. Your website must be named fa19meknojiyanazimhw4.azurewebsites.net. Submit both a link to the page AND a zipped version of your website on Canvas.


GUI

Need help with Database homework on Azure
Need help with Database homework on Azure - Codersarts


Comentarios


bottom of page