ASP.NET Core Hotel Room Booking System

Aug 24, 2024

ASP.NET Core Online Hotel Room Booking Project

Overview

  • Designing a hotel room booking system in ASP.NET Core.
  • Project follows a layered architecture.
  • Demonstration includes paginated room listings and functionalities for room booking.

Key Features

  • Room Types:

    • Available rooms with status (e.g., available, booked).
    • Facilities like AC, smoking/non-smoking rooms.
  • User Functionality:

    • Registration and login system for users.
    • Example login: Jacob with email jackcup@gmail.com.
  • Cart Functionality:

    • Users can add rooms to the cart (e.g., Room 103 for 3 days).
    • Displays room price and total cost.
  • Payment Process:

    • Users proceed to payment after reviewing cart details.
    • Example details provided for payment (name, phone number).

Admin Functionality

  • Adding new room facilities and types:
    • Example: Deluxe room with specific attributes.
    • Room creation with room number, price, availability, and images.

Project Setup

  1. Creating the Project:

    • Project type: ASP.NET Core Web App (MVC).
    • Framework version: 6.0, Default authentication: None.
  2. Project Structure:

    • Main projects:
      • HotelProject.Web (web app)
      • HotelProject.BLL (Business Logic Layer)
      • HotelProject.Models
      • HotelProject.ViewModels
      • HotelProject.Utility

Code Structure

  • Models:

    • Classes defined for application users, rooms, order details, etc.
    • Example: ApplicationUser inherits from IdentityUser.
  • Controllers:

    • Implement functionality for handling cart, orders, and facilities.
  • Database Context:

    • ApplicationDbContext class inherits IdentityDbContext.
    • Includes properties for user and room management.
  • Repository Pattern Implementation:

    • Generics implemented for data access layer.
    • Interface IGenericRepository defines methods for CRUD operations.
  • Service Layer:

    • Interfaces for room type services defined.
    • Methods for querying room types and managing them.

View Models

  • Models converted for UI use (e.g., RoomTypeViewModel).
  • Includes necessary properties for interaction with views.

Conclusion

  • Final notes on creating and managing the online hotel booking system.
  • Encouragement to like, subscribe, and share the video.