Introduction
In the first two articles, we built the foundation of the HRM project:
Now, in this third and final article, we'll complete the HRM system by adding role‑based dashboards, reports & analytics, and deployment strategies. These features transform the HRM project from a functional prototype into a production‑ready enterprise solution.
Role-Based Dashboards
Dashboards provide tailored views depending on the user's role (Admin, HR, Manager, Employee).
Dashboard Controller
csharp
public class DashboardController : Controller
{
private readonly ApplicationDbContext _context;
private readonly UserManager<IdentityUser> _userManager;
public DashboardController(ApplicationDbContext context, UserManager<IdentityUser> userManager)
{
_context = context;
_userManager = userManager;
}
public async Task<IActionResult> Index()
{
var user = await _userManager.GetUserAsync(User);
if (await _userManager.IsInRoleAsync(user, "Admin"))
return View("AdminDashboard");
else if (await _userManager.IsInRoleAsync(user, "HR"))
return View("HRDashboard");
else if (await _userManager.IsInRoleAsync(user, "Manager"))
return View("ManagerDashboard");
else
return View("EmployeeDashboard");
}
}
Views
AdminDashboard.cshtml → Overview of companies, departments, payroll.
HRDashboard.cshtml → Employee management, attendance, leave requests.
ManagerDashboard.cshtml → Team performance, leave approvals.
EmployeeDashboard.cshtml → Profile, attendance, salary slips, offer letters.
📸 Screenshot Placeholder: Admin dashboard with quick stats.
Reports & Analytics
Reports provide insights into attendance, payroll, and performance.
Report Model
csharp
public class ReportViewModel
{
public string EmployeeName { get; set; }
public int TotalDays { get; set; }
public int PresentDays { get; set; }
public int AbsentDays { get; set; }
public decimal NetSalary { get; set; }
}
Reports Controller
csharp
public class ReportsController : Controller
{
private readonly ApplicationDbContext _context;
public ReportsController(ApplicationDbContext context) => _context = context;
public IActionResult AttendanceReport()
{
var report = _context.Employees.Select(e => new ReportViewModel
{
EmployeeName = e.FullName,
TotalDays = _context.Attendance.Count(a => a.EmployeeId == e.Id),
PresentDays = _context.Attendance.Count(a => a.EmployeeId == e.Id && a.IsPresent),
AbsentDays = _context.Attendance.Count(a => a.EmployeeId == e.Id && !a.IsPresent)
}).ToList();
return View(report);
}
public IActionResult PayrollReport()
{
var report = _context.Payrolls.Select(p => new ReportViewModel
{
EmployeeName = p.Employee.FullName,
NetSalary = p.NetSalary
}).ToList();
return View(report);
}
}
📸 Screenshot Placeholder: Attendance report table, Payroll report table.
Deployment
Step 1: Publish to IIS
Right‑click project → Publish.
Select Folder or IIS profile.
Configure connection strings for production.
Step 2: Deploy to Azure
Use Azure App Service for hosting.
Configure Azure SQL Database.
Secure secrets with Azure Key Vault.
Step 3: Monitoring
Enable logging with Serilog or built‑in ASP.NET logging.
Use Application Insights for performance monitoring.
📸 Screenshot Placeholder: Visual Studio publish dialog.
Summary of Part 3
Dashboards → Role‑based views for Admin, HR, Manager, Employee.
Reports → Attendance and payroll analytics.
Deployment → IIS/Azure with monitoring and security best practices.

Join the conversation! Your thoughts help the community grow.