300583 Web Systems Development

300583 Web Systems Development
PRACTICAL SET 3 DUE: 8PM 25 JAN 2019
In this Practical Set, you will implement a roughly full-fledged website for the "Gourmet Pizza" shop
with features such as authentication, full interactions with database, etc.
Steps for completing this practical set
1. Since we are going to include authentication in this project, you need to create a brand-new
ASP.NET Core MVC project called "GourmetPizzaPrac3" with Visual Studio. You should
follow the steps in Lecture 11 to have the Identity package in your project, and then change
the database provider to Sqlite, and then apply the initial migration.
2. Modify the Home page of your project to suit the "Gourmet Pizza" shop. To achieve this, you
should repeat the Steps 5, 7, and 13 from Prac1.
3. Create the following three Model classes: Pizza, Customer and Purchase, and establish the
one-to-many relationship between Pizza and Purchase, and the one-to-many relationship
between Customer and Purchase with navigation properties.
a. Pizza: the definition of this class should include that in Prac1 with the addition of
necessary navigation properties.
b. Customer: the definition of this class should be similar to that in Prac2 with the
following two exceptions:
i. There is no ‘ID‘ property in this class; instead, the ‘Email‘ property is used as
the primary key for this class.
ii. It should include necessary navigation properties.
c. Purchase: the definition of this class should include the following properties and their
associated requirements:
Property Data Type Requirement
ID int Primary key;
PizzaID int Foreign Key (NB: since the name follows convention, this
will be automatically figured out by EF Core)
CustomerEmail string Same as above;
PizzaCount int The number of pizzas purchased. Should range from 1 to 80.
TotalCost decimal The total cost of this purchase. Should range from 1.00 to
1000.00
ThePizza Pizza This is a navigation property
TheCustomer Customer Same as above
4. Use scaffolding to create the controllers and views for all the three Model classes above.
5. Use migration to create the database tables for all the three Model classes above.
6. Follow Lecture 11 slides to implement a ‘My Details‘ page to allow a logged-in customer to
enter and update his/her details.

Page 2 of 3
7. Follow Lecture 11 slides to redirect a newly-registered customer to the ‘My Details‘ link.
8. Modify the Create() method in the PurchasesController and its associated view to implement
a customized page for a logged-in customer to purchase pizzas. Specifically, you should
implement the following:
a. The web form for purchasing pizzas should include the following input devices:
i. A dropdown list for selecting pizzas. The options in this dropdown list should
be read from the database, and each option should use a pizza‘s ID as its
value and a pizza‘s Name as its text.
ii. An <input> field for entering PizzaCount. The PizzaCount should range from
1 to 80.
b. If the customer inputs in this web form are valid, insert this purchase into the
database. Note that you should do the following before the insertion:
i. Get the CustomerEmail for this purchase. (Hint: see the ‘My Details‘
implementation in the sample project for Lecture 11).
ii. Calculate the TotalCost for this purchase.
c. Display a confirmation message for this purchase if it is successful. The message
should include the following pieces of info: the name and the number of the pizza
ordered, and the total cost.
Hint: Lecture 8 slides and sample project have been updated to guide you in implementing
this step. Please download the latest versions of Lecture 8 slides and sample project, and refer to
the last section of the slides.
9. Modify the Index() method in the PurchasesController and its associated view to implement
the following:
a. Only display the purchases made by the logged-in customer. (Hint: this can be done
by calling the Where() method with a lambda expression on CustomerEmail).
b. Remove the ‘Edit‘, ‘Details‘ and ‘Delete‘ links in each row.
c. There should be a column displaying the name of the pizza purchased.
d. There should be a column displaying the full name of the customer making this
purchase.
e. The three column headings (‘Pizza name‘, ‘PizzaCount‘ and ‘TotalCost‘) should be
links that users can click to sort all records by that column.
f. Clicking a column heading toggles the display order between ascending and
descending.
10. Add a CalcPurchaseStats() action method into the PurchasesController to calculate and
display the following distribution: the number of purchases against each PizzaCount. In order
to achieve this, you also need to create relevant Views and ViewModels.
11. Make the links in the navigation bar dynamic:
a. When a customer is not logged-in, he/she should see the following links: Home,
Pizzas (pointing to /Pizzas/Index), Register, Login.
b. When a customer is logged-in, he/she should see the following links: Home, Pizzas
Index (pointing to /Pizzas/Index), My Details, Purchase Pizzas (pointing to
/Purchases/Create), My Purchases (pointing to /Purchases/Index), Statistics (pointing
to /Purchases/CalcPurchaseStats), Logout.
Hint: modifying _Layout.cshtml by following the idea of /Shared/_LoginPartial.cshtml.

Page 3 of 3
12. Use the [Authorize] attribute class to make the following links only accessible to logged-in
customers: My Details, Purchase Pizzas, My Purchases, Statistics.
Checkpoint (2 marks)
The Prac3 Checkpoint will occur in your registered practical class in week 11. At this checkpoint you
should complete steps 1-2.

Marking criteria:
Step 1: 1 mark.
Step 2: 1 mark.
Any mistake in a step will results in a zero mark for that step. No decimal mark is available.
Final Submission (16 marks)
Please follow the steps below to submit your completed Prac3 to vUWS:
Zip up the entire GourmetPizza folder and its sub-folders, which contain all your files for your
project.
Name the ZIP file Surname_studentid_Prac3.zip
Submit the zip file:
o In VUWS, go to ‘Practicals’
o Click on ‘Prac3 Submission’; this link will be made available closer to the deadline.
o Attach your zip file and submit
Marking Criteria: Please see the rubric for Prac3 in the My Grades page on vUWS.
Notes:
You can submit the zip file multiple times until the due time.
Work submitted after the due time will incur a 10% per day late penalty as per university
policy https://policies.westernsydney.edu.au/document/view.current.php?id=227
Based on the policy, the 10% above means the 10% of the worth of the assessment,
not your final score. So if the worth of the assessment is 10 marks and you scored 5
marks with a 5-day lateness, then you‘ll receive 0 mark.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codinghelp

原文地址:https://www.cnblogs.com/cccccchelper/p/10335485.html

时间: 2024-10-21 16:39:06

300583 Web Systems Development的相关文章

WEB Application Development Integrator : 应用设置

1.1.       系统安装 应用 Oracle EBS WEB Application Development Integrator WEB ADI在Oracle EBS 11.5.10.* 版本中,配置不同: WEB ADI在Oracle EBS R12.0.4版本中,默认安装: 职责 在Oracle EBS 11.5.10.2环境中,WEB ADI的职责名:Oracle Web ADI: 在Oracle EBS R12.0.4  环境中,WEB ADI的职责名:Desktop Integ

Using QEMU for Embedded Systems Development

http://www.opensourceforu.com/2011/06/qemu-for-embedded-systems-development-part-1/ http://www.opensourceforu.com/2011/07/qemu-for-embedded-systems-development-part-2/ http://www.opensourceforu.com/2011/08/qemu-for-embedded-systems-development-part-3

Axis2 Web Service Development &amp; Deployment Guide

Menu: Requirement Development - Client Generation Development - Server Generation References Requirement Apache Axis 2 1.5.6 (and above)  下载地址:http://archive.apache.org/dist/axis/axis2/java/core/1.6.1/axis2-1.6.1-bin.zip Apache Tomcat 6 (and above) A

HTML5 web application development by example读书笔记

SPA:单页应用.retrieve:恢复,重新得到  infrastructure 基础设施,下部构造 本书第6章和第7章会讲述2个实例:piano man 和piano hero,看起来貌似很有趣.第8章做一个基于geography API的天气应用. 貌似还要安装Apache服务器,因为有些HTML5应用必须与服务器交互. Chapter 1:the task at hand.

可扩展的Web系统和分布式系统(Scalable Web Architecture and Distributed Systems)

Open source software has become a fundamental building block for some of the biggest websites. And as those websites have grown, best practices and guiding principles around their architectures have emerged. This chapter seeks to cover some of the ke

A web crawler design for data mining

Abstract The content of the web has increasingly become a focus for academic research. Computer programs are needed in order to conduct any large-scale processing of web pages, requiring the use of a web crawler at some stage in order to fetch the pa

Slaesforce Paltform Development Basic

Metadata Salesforce的数据组织形式是基于其metadata-aware architecture(数据感知架构)上的一种抽象.Salesforce的数据组织分为objects,fields,records.可以 拿传统的关系型数据库与之进行比较: Salesforce database objects tables fields columns records rows Salesforce标准对象(standard objects)和定制对象(custom objects)都

Domain Driven Design and Development In Practice--转载

原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about mapping business domain concepts into software artifacts. Most of the writings and articles on this topic have been based on Eric Evans' book "Domain Dr

golang 微服务以及相关web框架

golang 中国gocn golang Applicable to all database connection pools xorm是一个简单而强大的Go语言ORM库,通过它可以使数据库操作非常简便--文档 Lightweight and fast SQL builder for Go and XORM Go 语言包管理 A web based database admin tool written by Golang support mysql/postgres/sqlite Go 语言