A comprehensive desktop application built with C# WPF and Material Design for managing all aspects of hostel operations. This system provides an intuitive, modern interface for managing students, rooms, staff, fees, visitors, complaints, and attendance records.
- Features
- Screenshots
- Technology Stack
- Prerequisites
- Installation
- Database Setup
- Configuration
- Usage
- Project Structure
- Key Modules
- Database Schema
- Development
- Contributing
- Future Enhancements
- License
- Contact
- Material Design principles with clean, professional aesthetics
- Responsive layouts that adapt to different screen sizes
- Card-based design with shadows and rounded corners
- Intuitive navigation with top navigation bar similar to modern web applications
- Smooth animations and hover effects for enhanced user experience
- Consistent typography and color scheme throughout the application
- Role-based access control (Admin, Warden, Staff)
- Secure login system with credential validation
- "Remember Me" functionality for convenience
- Password recovery option
- Session management
- Real-time statistics and metrics
- Quick access buttons to all modules
- Visual summary cards showing:
- Total students count
- Available/occupied rooms
- Staff members count
- Pending complaints
- Fee collection status
- Recent visitor logs
- Complete CRUD operations (Create, Read, Update, Delete)
- Student profile management with:
- Personal information (Name, DOB, Gender)
- Contact details
- Address information
- Admission date tracking
- Room assignment
- Advanced search and filter capabilities
- Bulk operations support
- Export student data functionality
- Room allocation and deallocation
- Capacity tracking and management
- Room status management:
- Available
- Occupied
- Under Maintenance
- Room type categorization (Single, Double, Triple, Quad)
- Visual occupancy indicators
- Room assignment workflow
- Multiple hostel support
- Hostel information management:
- Name and location
- Capacity tracking
- Warden assignment
- Contact information
- Hostel-wise reports and analytics
- Occupancy statistics per hostel
- Employee records management
- Role-based categorization:
- Warden
- Security Guard
- Cleaner
- Maintenance
- Cook
- Admin Staff
- Contact information tracking
- Staff directory with search
- Employment history
- Comprehensive fee tracking system
- Payment status monitoring:
- Paid
- Pending
- Overdue
- Fee collection recording
- Due date management
- Automated payment reminders
- Fee history per student
- Monthly/semester fee reports
- Payment receipt generation
- Visitor registration and logging
- Student visit tracking
- Relationship tracking (Parent, Friend, Relative, Guardian)
- Visit date and time recording
- Purpose of visit documentation
- Visitor history reports
- Security logs
- Complaint submission system
- Status tracking:
- Pending
- In Progress
- Resolved
- Priority levels (Low, Medium, High, Critical)
- Category-based organization:
- Maintenance
- Food
- Room Issues
- Security
- Other
- Resolution tracking and notes
- Complaint history
- Response time analytics
- Daily attendance marking system
- Individual student attendance recording
- Bulk attendance marking for efficiency
- Attendance reports:
- Daily attendance sheets
- Monthly attendance summaries
- Student-wise attendance history
- Attendance percentage calculation
- Defaulter identification
- Export attendance data
Professional login interface with gradient background and role selection.

Modern dashboard with statistics cards and quick action buttons.

Clean interface for managing student records with advanced search capabilities.

Visual room management with status indicators and allocation tools.

- Framework: .NET 8.0 (Windows Desktop)
- UI Framework: Windows Presentation Foundation (WPF)
- Language: C# 12.0
- UI Library: MaterialDesignThemes (v4.9.0)
- Design: MaterialDesignColors (v2.1.4)
- Database: Microsoft SQL Server 2019+
- Data Access: ADO.NET with System.Data.SqlClient (v4.8.6)
- Configuration: System.Configuration.ConfigurationManager (v8.0.0)
- MVVM-ready structure for future enhancements
- Repository pattern compatible design
- Stored procedures for database operations
- Modular page-based architecture
Before running this application, ensure you have the following installed:
- Operating System: Windows 10 (1809+) or Windows 11
- .NET SDK: .NET 8.0 SDK or later
- Database: SQL Server 2019 or later
- SQL Server Express (free) is sufficient
- SQL Server Management Studio (SSMS) recommended
- IDE (Optional but recommended):
- Visual Studio 2022 (Community/Professional/Enterprise)
- Or VS Code with C# extension
- Git: For cloning the repository
git clone https://github.com/1hadii/HostelManagementSystem.git
cd HostelManagementSystemdotnet restoreSee the Database Setup section below for detailed instructions.
- Open
App.configin the root directory - Update the connection string with your SQL Server details:
<add name="HostelManagementDB"
connectionString="Server=localhost\SQLEXPRESS;Database=HostelManagementSystemDB;Trusted_Connection=True;TrustServerCertificate=True;Encrypt=False;"
providerName="System.Data.SqlClient" />Replace YOUR_SERVER_NAME with your SQL Server instance name.
dotnet builddotnet runOr open the solution in Visual Studio and press F5 to run.
-
Open SQL Server Management Studio (SSMS)
-
Connect to your SQL Server instance
-
Execute the main SQL script:
- Open
HostelManagementQuery.sql - Execute the entire script (F5)
- This will:
- Create the database
HostelManagementSystemDB - Create all required tables
- Insert sample data
- Create stored procedures
- Create the database
- Open
-
Execute the triggers script:
- Open
TriggersSetup.sql - Execute the script to set up database triggers
- Open
-
Verify the setup:
- Check that all tables are created
- Verify sample data is inserted
- Test stored procedures
Detailed step-by-step instructions are available in DATABASE_SETUP.md.
The database comes with pre-loaded sample data including:
- 28 Students across different rooms
- 16 Rooms (14 occupied, 2 available)
- 5 Hostels with assigned wardens
- 11 Staff members across different roles
- Fee records for all students
- Visitor logs with various relationships
- Complaint records with different statuses
- 3 days of attendance records
The application uses App.config for database connection settings. Three configuration options are provided:
- Windows Authentication (Recommended):
Server=localhost\SQLEXPRESS;Database=HostelManagementSystemDB;Trusted_Connection=True;TrustServerCertificate=True;Encrypt=False;- SQL Server Authentication:
Server=YOUR_SERVER;Database=HostelManagementSystemDB;User Id=YOUR_USERNAME;Password=YOUR_PASSWORD;TrustServerCertificate=True;Encrypt=False;- Default Instance:
Server=localhost;Database=HostelManagementSystemDB;Trusted_Connection=True;TrustServerCertificate=True;Encrypt=False;Run this command in Command Prompt or PowerShell:
sqlcmd -LOr check SQL Server Configuration Manager.
- Launch the application
- Enter your credentials (see sample users in database)
- Select your role (Admin/Warden/Staff)
- Click "Login"
Default Test Credentials:
- Use any username and password (demo mode available)
- Or use credentials from
LoginUserstable in the database
- Top Navigation Bar: Click on any menu item to navigate between modules
- Dashboard: Central hub with quick access to all features
- Search: Use search boxes to quickly find records
- Actions: Use action buttons for Create, Edit, Delete operations
- Navigate to Student Management
- Click "Add Student" button
- Fill in the required information
- Select an available room
- Click "Save"
- Go to Room Management
- Find an available room
- Click "Assign" button
- Select a student from the list
- Confirm allocation
- Navigate to Attendance Management
- Select date
- Mark attendance for students (Present/Absent)
- Use bulk marking for efficiency
- Save attendance records
- Go to Complaints Management
- View pending complaints
- Update status as you work on them
- Add resolution notes
- Mark as resolved when complete
HostelManagementSystem/
β
βββ π App.xaml # Application-level resources and startup
βββ π App.xaml.cs # Application startup logic
βββ π App.config # Configuration (connection strings)
β
βββ πͺ Windows/
β βββ LoginWindow.xaml # Login interface
β βββ LoginWindow.xaml.cs # Login logic
β βββ DashboardWindow.xaml # Main application window
β βββ DashboardWindow.xaml.cs # Dashboard logic and navigation
β
βββ π Pages/
β βββ HomePage.xaml # Dashboard with statistics
β βββ HomePage.xaml.cs
β βββ StudentManagementPage.xaml # Student CRUD operations
β βββ StudentManagementPage.xaml.cs
β βββ RoomManagementPage.xaml # Room management
β βββ RoomManagementPage.xaml.cs
β βββ HostelManagementPage.xaml # Hostel management
β βββ HostelManagementPage.xaml.cs
β βββ StaffManagementPage.xaml # Staff management
β βββ StaffManagementPage.xaml.cs
β βββ FeeManagementPage.xaml # Fee tracking
β βββ FeeManagementPage.xaml.cs
β βββ VisitorLogPage.xaml # Visitor registration
β βββ VisitorLogPage.xaml.cs
β βββ ComplaintsPage.xaml # Complaints management
β βββ ComplaintsPage.xaml.cs
β βββ AttendancePage.xaml # Attendance marking
β βββ AttendancePage.xaml.cs
β
βββ π¦ Models/
β βββ Models.cs # Data models for all entities
β
βββ π§ Services/
β βββ DatabaseConnection.cs # Database connection management
β
βββ πΌοΈ Images/
β βββ hostel.png # Application icons
β βββ hotel.png
β
βββ πΎ Database/
β βββ HostelManagementQuery.sql # Main database script
β βββ TriggersSetup.sql # Database triggers
β βββ Database_README.md # Database documentation
β βββ HostelManagementQuery_StoredProcedures_Explanation.md
β
βββ π HostelManagementSystem.csproj # Project file
βββ π HostelManagementSystem.sln # Solution file
βββ π README.md # This file
βββ π .gitignore # Git ignore rules
- Location:
LoginWindow.xaml/.cs - Features: User validation, role selection, remember me
- Database: Uses
sp_ValidateLoginstored procedure
- Location:
Pages/StudentManagementPage.xaml/.cs - Features: CRUD operations, search, room assignment
- Database:
sp_GetAllStudentssp_AddStudentsp_UpdateStudentsp_DeleteStudent
- Location:
Pages/RoomManagementPage.xaml/.cs - Features: Room allocation, status tracking, capacity management
- Database:
sp_GetAllRoomssp_AddRoomsp_UpdateRoomsp_DeleteRoom
- Location:
Pages/FeeManagementPage.xaml/.cs - Features: Payment tracking, due date management, receipts
- Database:
sp_GetAllFeessp_AddFeesp_UpdateFeesp_DeleteFee
- Location:
Pages/AttendancePage.xaml/.cs - Features: Daily marking, bulk operations, reports
- Database:
sp_GetAllAttendancesp_AddAttendancesp_UpdateAttendancesp_DeleteAttendance
Id(PK),Name,DateOfBirth,Gender,Contact,Address,AdmissionDate,AssignedRoom(FK)
Id(PK),RoomNumber,Capacity,HostelId(FK),Status
Id(PK),Name,Location,WardenId(FK),Contact
Id(PK),Name,Role,Contact,Email,JoinDate
Id(PK),StudentId(FK),Amount,DueDate,PaidDate,Status
Id(PK),StudentId(FK),VisitorName,Relationship,VisitDate,Purpose
Id(PK),StudentId(FK),ComplaintText,Status,SubmittedDate,ResolvedDate
Id(PK),StudentId(FK),Date,Status(Present/Absent)
Id(PK),Username,Password,Role
The application uses 32+ stored procedures for all database operations:
- Student Operations: 4 procedures (CRUD)
- Room Operations: 4 procedures
- Hostel Operations: 4 procedures
- Staff Operations: 4 procedures
- Fee Operations: 4 procedures
- Visitor Operations: 4 procedures
- Complaint Operations: 4 procedures
- Attendance Operations: 4 procedures
- Authentication: 1 procedure
See HostelManagementQuery_StoredProcedures_Explanation.md for detailed documentation.
# Clone the repository
git clone https://github.com/1hadii/HostelManagementSystem.git
# Navigate to project directory
cd HostelManagementSystem
# Restore dependencies
dotnet restore
# Build the project
dotnet build --configuration Release
# Run the application
dotnet run- Open
HostelManagementSystem.slnin Visual Studio 2022 - Set
HostelManagementSystemas the startup project - Press F5 or click "Start Debugging"
- Follow C# naming conventions
- Use meaningful variable and method names
- Add XML documentation comments for public methods
- Keep methods focused and concise
- Use async/await for database operations
Currently, the application includes:
- Sample data for testing all features
- Manual testing procedures
- Database validation scripts
Future: Unit tests and integration tests planned.
Contributions are welcome! Here's how you can help:
- Check if the bug has already been reported
- Create a new issue with detailed description
- Include steps to reproduce
- Add screenshots if applicable
- Open an issue describing the feature
- Explain the use case and benefits
- Provide mockups or examples if possible
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style
- Write clear commit messages
- Update documentation as needed
- Test your changes thoroughly
- Ensure all builds pass
-
Advanced Reporting
- PDF report generation
- Excel export functionality
- Custom report builder
- Scheduled report emails
-
Enhanced Security
- Password hashing (BCrypt/SHA256)
- Multi-factor authentication
- Session timeout management
- Activity logging
-
File Management
- Student photo upload
- Document management
- ID card generation
- Document scanner integration
-
Notifications
- Email notifications for fee due dates
- SMS alerts for important events
- In-app notification center
- Push notifications
-
Analytics Dashboard
- Interactive charts (using LiveCharts/OxyPlot)
- Trend analysis
- Occupancy forecasting
- Financial analytics
-
Mobile App
- Cross-platform mobile app (Xamarin/MAUI)
- Student portal
- Parent access
- QR code scanning
-
Integration
- Biometric attendance system integration
- Payment gateway integration
- Email/SMS gateway integration
- Cloud backup integration
-
Advanced Features
- Multi-language support
- Dark mode theme
- Customizable dashboards
- Role-based permissions
- Audit trail
- Data export/import (CSV, JSON)
- Backup and restore utilities
- Advanced search with filters
- Bulk operations
This project is available under the MIT License. See LICENSE file for details.
MIT License
Copyright (c) 2026 [Abdul Hadi Sohail]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Project Maintainer: Abdul Hadi Sohail
- GitHub: 1hadii
- Email: abdulhadisohail786@gmail.com
- LinkedIn: (https://www.linkedin.com/in/abdul-hadi-sohail-4b738a289/)
Project Link: (https://github.com/1hadii/HostelManagementSystem)
- Material Design In XAML Toolkit for the beautiful UI components
- .NET Foundation for the excellent framework
- All contributors who helped improve this project
β Star this repository if you find it helpful!
Made with β€οΈ using C# and WPF
- Clean, responsive layout with Material Design principles
- Top navigation bar similar to web applications
- Card-based layouts with shadows and rounded corners
- Modern color scheme and typography
- Hero banner on the home page
- Professional login window with gradient background
- Role-based access (Admin, Warden, Staff)
- "Remember Me" functionality
- Forgot password option
- Real-time statistics cards
- Quick action buttons
- Visual summary of hostel metrics
- Easy navigation to all modules
- Add, edit, delete student records
- Track admission dates and room assignments
- Search and filter functionality
- Export student data
- Room allocation and capacity management
- Availability tracking
- Room status updates (Available/Occupied/Under Maintenance)
- Assignment functionality
- Multiple hostel support
- Warden assignments
- Location tracking
- Comprehensive hostel information
- Employee records management
- Role-based categorization
- Contact information tracking
- Staff directory
- Fee collection tracking
- Payment status monitoring
- Due date management
- Automated reports
- Visitor registration
- Student visit history
- Relationship tracking
- Daily visitor reports
- Complaint submission system
- Status tracking (Pending/In Progress/Resolved)
- Priority management
- Resolution tracking
- Daily attendance marking
- Individual and bulk attendance
- Attendance reports and analytics
- Historical data tracking
- Framework: .NET 8 with WPF
- Language: C#
- UI Library: Material Design In XAML Toolkit
- Architecture: MVVM-ready structure
- Database: Designed for easy database integration
HostelManagementSystem/
βββ Models/
β βββ Models.cs # Data models for all entities
βββ Pages/
β βββ HomePage.xaml/cs # Dashboard with statistics
β βββ StudentManagementPage.xaml/cs
β βββ RoomManagementPage.xaml/cs
β βββ HostelManagementPage.xaml/cs
β βββ StaffManagementPage.xaml/cs
β βββ FeeManagementPage.xaml/cs
β βββ VisitorLogPage.xaml/cs
β βββ ComplaintsPage.xaml/cs
β βββ AttendancePage.xaml/cs
βββ LoginWindow.xaml/cs # Authentication interface
βββ DashboardWindow.xaml/cs # Main application window
βββ App.xaml/cs # Application startup and styling
βββ HostelManagementSystem.csproj # Project configuration
- Modern Button Styles: Rounded corners, hover effects, shadows
- Professional Color Scheme: Material Design color palette
- Responsive Layout: Adapts to different screen sizes
- Card-based Design: Clean separation of content areas
- Consistent Typography: Professional font choices and sizing
- Intuitive Navigation: Top navigation bar with clear menu items
- Form Validation: Real-time input validation with user-friendly messages
- Data Grids: Sortable, searchable data tables with alternating row colors
- Modal Dialogs: Confirmation dialogs for critical actions
- Status Indicators: Visual feedback for operations and data states
The application comes pre-loaded with sample data for demonstration:
- 5+ students with complete profiles
- 8 rooms with different capacities and statuses
- 5 hostels with assigned wardens
- 11 staff members across different roles
- Fee records with payment tracking
- Visitor logs with relationship tracking
- Complaint records with status management
- Attendance records with analytics
-
Prerequisites:
- .NET 8 SDK or later
- Visual Studio 2022 or VS Code
-
Build and Run:
cd HostelManagementSystem dotnet build dotnet run -
Login Credentials:
- Use any role (Admin/Warden/Staff)
- Enter any username and password (demo mode)
The application is structured to easily integrate with databases:
- Entity Framework Core ready
- Repository pattern can be easily implemented
- Data models are already defined
- CRUD operations are abstracted and ready for backend integration
- Database Integration: SQL Server, PostgreSQL, or SQLite
- Reporting System: PDF/Excel report generation
- Email Notifications: Automated alerts and reminders
- File Upload: Student photos and document management
- Advanced Search: Global search across all modules
- Data Export: CSV/Excel export functionality
- Backup & Restore: Database backup and restore features
- Multi-language Support: Internationalization
- Audit Trail: Activity logging and history
- Advanced Analytics: Charts and graphs for insights
The application features:
- Login Window: Professional login interface with gradient background
- Dashboard: Modern dashboard with statistics cards and quick actions
- Management Pages: Clean, form-based interfaces for all modules
- Data Tables: Professional data grids with search and sort capabilities
This is a complete, production-ready hostel management system that can be extended and customized for specific needs. The modular design makes it easy to add new features or modify existing functionality.
This project is created for educational and professional use. Feel free to modify and adapt it for your specific requirements.
