1 300583/300902 Web Development Project Due: 9pm, Fri 22 Oct 2021 This project is to build a website for the imaginary Goma Hotel that is going to serve the Blue Mountains area, after the Covid-19...

1 answer below »
6.2 &6.3


1 300583/300902 Web Development Project Due: 9pm, Fri 22 Oct 2021 This project is to build a website for the imaginary Goma Hotel that is going to serve the Blue Mountains area, after the Covid-19 pandemic is possibly under control by the end of 2021. This website should allow customers to search and book rooms, and allow administrators to manage bookings and view statistics, etc. You are suggested to read the entire specification first, and then start with the tasks that are already covered by our lectures. 1 Creating project in Visual Studio (VS) Name this project "HotelOneSID". Here the SID can belong to any of your group members. Say, if one of your group members has the SID "12345678", then this project can be named "Hotel12345678". Since the project needs to support authentication for customers and administrators, it needs the ASP.NET Identity package in the very beginning. To include this package in your project, you should carefully follow the slides in our Lecture 9, which is released on vUWS already. During the above process, you should name the SQLite database file "Goma.db". In this project, you are going to use it to store data not only for authentication, but also for the Goma Hotel. Moreover, you should follow the slides in Lecture 9 to scaffold the source code of the Identity package into your project. Finally, when you run this project, you should see the Register and Login links appear in the right of the navigation bar. 2 Two roles of administrators and customers Besides maintaining users’ credentials, the Identity package can also assign users with different roles. You are required to use this package to divide the users of this website into two roles: administrators and customers. You should create only one user with the 'administrators' role, and set up his/her username to be '[email protected]' and his/her password to be 'P@ssw0rd' when the web application starts. On the other hand, all users registering into the website by clicking the 'Register' link mentioned in the Section 3 below should be assigned the 'customers' role. Moreover, source code should be added to the Pages/Shared/_Layout.cshtml file such that, after logging in, administrators and customers only see links that they should have access to in the navigation bar. (see the details in the Section 3 below) NB: We will discuss the above in our Lecture 09. You can start to implement them after Lecture 9. 3 Navigation and layout All pages in your website should share a consistent layout, which has a navigation bar in the top. This should be achieved by using _Layout.cshtml and Bootstrap. The links contained in the navigation bar should be dynamic. The detailed requirements are as follows: • The links for non-logged-in users should include the following: Home, Register, and Login. Note that the Login link here is used by both customers and administrators. You should have source code to your project to determine the role of a logged-in user after he/she logs in. • The links for logged-in customers should include the following: Home, My Details, Search 2 Rooms, Book A Room, My Bookings and Logout. • The links for logged-in administrators should include the following: Home, Manage Bookings, Statistics and Logout. Note: How to make the links dynamic are discussed in Lecture 9. You can start with include all the links in the navigation bar, and make them dynamic after Lecture 9. 4 Home page The Home link in the navigation bar leads to this page, which should display: • A carousel below the navigation bar. This carousel should rotate four pictures about the Goma Hotel. The pictures can be about buildings, rooms, dining, etc. and can be downloaded from Internet and then modified. When searching images on the Internet, you should use royalty-free image websites such as Pixabay (www.pixabay.com) and Unsplash (www.unsplash.com) to avoid copyright issues. Each picture needs to have a caption when being displayed by the carousel. • Two columns below the carousel. The left column should display a welcome message and a brief introduction to the hotel. The right column should display a list of useful links for the mid north coast area (e.g., a link to Coffs Harbor weather, a link to Grafton City Council, etc.). The two columns should stack up when the viewport width is less than 768px (consider the proper column class to use in Bootstrap). 5 Models This website should use the following three Model classes. Each class has certain properties. The requirements on these properties are also described below. You should apply appropriate data types and data annotations to fulfil these requirements. You should fully create these Model classes first, and then scaffold them one by one, and then migrate them to database together. You are suggested to do these by following our Lecture 8. NB: During scaffolding, you should choose the ApplicationDbContext used by Identity as the DbContext (i.e., select the database used by Identity). During migration, in case you see the complaint that SQLite does not support certain operation, you should comment out the migration code in the Up() and Down() methods related to that operation. These two methods can be found in the .cs file under the 'Migrations' folder. 5.1 Room.cs The Room class models the rooms in Goma Hotel. It should have the following properties. Property Data Type Requirements ID int Primary key; Level string Meaning the level of this room; Exactly one character of ‘G’, ‘1’, ‘2’, or ‘3’. Required. BedCount int Meaning the number of beds in the room; can only be 1, 2, or 3. Price decimal Meaning the price per night; Between $50 and $300. TheBookings ICollection This is a navigation property (Note: will be discussed in lecture 8; see https://www.learnentityframeworkcore.com/relationships ) After scaffolding and migrating this class into database, you should use the http://www.pixabay.com/ http://www.unsplash.com/ https://www.learnentityframeworkcore.com/relationships 3 https://localhost:xxx/Rooms web interface to manually populate the Room table with the following data. (NB: For the convenience of marking, you must use the data below.) ID Level BedCount Price 1 1 1 56.30 2 1 2 66.30 3 1 3 76.80 4 1 2 60.80 5 2 1 56.30 6 2 2 66.30 7 2 3 76.80 8 2 2 60.80 9 3 1 56.30 10 3 2 66.30 11 3 3 76.80 12 3 2 60.80 13 G 1 56.30 14 G 2 66.30 15 G 3 76.80 16 G 2 60.80 5.2 Customer.cs The Customer class models all customers who have ever registered with Goma Hotel. It should have the following properties. Property Data Type Requirements Email string Primary key; Required; Valid email address; Since its name doesn't follow the convention to be the primary key, you should add the [Key] annotation to indicate that this property is the primary key, and also add the [DatabaseGenerated(DatabaseGeneratedOption.None)] annotation to prevent its value from being automatically generated by database. Surname string Required; Length ranges between 2 and 20 characters inclusive; Can only consist of English letters, hyphen and apostrophe. GivenName string Same as above. Postcode string Required; exactly 4 digits. TheBookings ICollection This is a navigation property (Note: will be discussed in lecture 8) Notes: • This class has no property for password. Customers' passwords will be automatically managed by the ASP.NET Identity package, and will not be stored here. https://localhost:xxx/Rooms 4 • You should use the 'Register' link in the website to register a customer into the website, and then use the 'My Details' link (described in Section 6) to enter the details for this customer. Do this for at least 10 customers with some common postcodes to allow the 'Statistics' link to show results. 5.3 Booking.cs The Booking class models all bookings ever made by customers with Goma Hotel. It should have the following properties. Property Data Type Requirements ID int Primary key; RoomID int Foreign Key (NB: since the name follows convention, this will be automatically figured out by EF Core) CustomerEmail string Same as above; CheckIn DateTime Meaning the checking-in date; Only Date part is needed. CheckOut DateTime Meaning the checking-out date; Only Date part is needed. Cost decimal The total cost of this booking. TheRoom Room This is a navigation property (Note: will be discussed in lecture 8) TheCustomer Customer Same as above Notes: • Each booking can only consist of one room. If multiple rooms are needed by a customer, the customer needs to make multiple bookings. • You should add booking records into the Booking table by using the 'Book A Room' link. However, before the website is fully functioning, you can also use the SQlite DB Browser to manually add records into this table. 6 The links for logged-in customers This section gives the requirements for the links in the navigation bar for logged-in customers. You should figure out the implementation of the corresponding Razor page for each link based on the requirements. Moreover, you should use the [Authorize] annotation to only allow the users with the role of 'Customers' to access these four links below. 6.1 The 'My Details' link
Answered Same DayOct 19, 2021

Answer To: 1 300583/300902 Web Development Project Due: 9pm, Fri 22 Oct 2021 This project is to build a website...

Raja answered on Oct 20 2021
128 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here