├── .gitattributes ├── .gitignore ├── HR.LeaveManagement.Api ├── Controllers │ ├── AccountController.cs │ ├── LeaveAllocationsController.cs │ ├── LeaveRequestsController.cs │ └── LeaveTypesController.cs ├── HR.LeaveManagement.Api.csproj ├── Middleware │ └── ExceptionMiddleware.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json └── appsettings.json ├── HR.LeaveManagement.Application.UnitTests ├── HR.LeaveManagement.Application.UnitTests.csproj ├── LeaveTypes │ ├── Commands │ │ └── CreateLeaveTypeCommandHandlerTests.cs │ └── Queries │ │ └── GetLeaveTypeListRequestHandlerTests.cs └── Mocks │ ├── MockLeaveTypeRepository.cs │ └── MockUnitOfWork.cs ├── HR.LeaveManagement.Application ├── ApplicationServicesRegistration.cs ├── Constants │ └── CustomClaimTypes.cs ├── Contracts │ ├── Identity │ │ ├── IAuthService.cs │ │ └── IUserService.cs │ ├── Infrastructure │ │ └── IEmailSender.cs │ └── Persistence │ │ ├── IGenericRepository.cs │ │ ├── ILeaveAllocationRepository.cs │ │ ├── ILeaveRequestRepository.cs │ │ ├── ILeaveTypeRepository.cs │ │ └── IUnitOfWork.cs ├── DTOs │ ├── Common │ │ └── BaseDto.cs │ ├── LeaveAllocation │ │ ├── CreateLeaveAllocationDto.cs │ │ ├── ILeaveAllocationDto.cs │ │ ├── LeaveAllocationDto.cs │ │ ├── UpdateLeaveAllocationDto.cs │ │ └── Validators │ │ │ ├── CreateLeaveAllocationDtoValidator.cs │ │ │ ├── ILeaveAllocationDtoValidator.cs │ │ │ └── UpdateLeaveAllocationDtoValidator.cs │ ├── LeaveRequest │ │ ├── ChangeLeaveRequestApprovalDto.cs │ │ ├── CreateLeaveRequestDto.cs │ │ ├── ILeaveRequestDto.cs │ │ ├── LeaveRequestDto.cs │ │ ├── LeaveRequestListDto.cs │ │ ├── UpdateLeaveRequestDto.cs │ │ └── Validators │ │ │ ├── CreateLeaveRequestDtoValidator.cs │ │ │ ├── ILeaveRequestDtoValidator.cs │ │ │ └── UpdateLeaveRequestDtoValidator.cs │ └── LeaveType │ │ ├── CreateLeaveTypeDto.cs │ │ ├── ILeaveTypeDto.cs │ │ ├── LeaveTypeDto.cs │ │ └── Validators │ │ ├── CreateLeaveTypeDtoValidator.cs │ │ ├── ILeaveTypeDtoValidator.cs │ │ └── UpdateLeaveTypeDtoValidator.cs ├── Exceptions │ ├── BadRequestException.cs │ ├── NotFoundException.cs │ └── ValidationException.cs ├── Features │ ├── LeaveAllocations │ │ ├── Handlers │ │ │ ├── Commands │ │ │ │ ├── CreateLeaveAllocationCommandHandler.cs │ │ │ │ ├── DeleteLeaveAllocationCommandHandler.cs │ │ │ │ └── UpdateLeaveAllocationCommandHandler.cs │ │ │ └── Queries │ │ │ │ ├── GetLeaveAllocationDetailRequestHandler.cs │ │ │ │ └── GetLeaveAllocationListRequestHandler.cs │ │ └── Requests │ │ │ ├── Commands │ │ │ ├── CreateLeaveAllocationCommand.cs │ │ │ ├── DeleteLeaveAllocationCommand.cs │ │ │ └── UpdateLeaveAllocationCommand.cs │ │ │ └── Queries │ │ │ ├── GetLeaveAllocationDetailRequest.cs │ │ │ └── GetLeaveAllocationListRequest.cs │ ├── LeaveRequests │ │ ├── Handlers │ │ │ ├── Commands │ │ │ │ ├── CreateLeaveRequestCommandHandler.cs │ │ │ │ ├── DeleteLeaveRequestCommandHandler.cs │ │ │ │ └── UpdateLeaveRequestCommandHandler.cs │ │ │ └── Queries │ │ │ │ ├── GetLeaveRequestDetailRequestHandler.cs │ │ │ │ └── GetLeaveRequestListRequestHandler.cs │ │ └── Requests │ │ │ ├── Commands │ │ │ ├── CreateLeaveRequestCommand.cs │ │ │ ├── DeleteLeaveRequestCommand.cs │ │ │ └── UpdateLeaveRequestCommand.cs │ │ │ └── Queries │ │ │ ├── GetLeaveRequestDetailRequest.cs │ │ │ └── GetLeaveRequestListRequest.cs │ └── LeaveTypes │ │ ├── Handlers │ │ ├── Commands │ │ │ ├── CreateLeaveTypeCommandHandler.cs │ │ │ ├── DeleteLeaveTypeCommandHandler.cs │ │ │ └── UpdateLeaveTypeCommandHandler.cs │ │ └── Queries │ │ │ ├── GetLeaveTypeDetailRequestHandler.cs │ │ │ └── GetLeaveTypeListRequestHandler.cs │ │ └── Requests │ │ ├── Commands │ │ ├── CreateLeaveTypeCommand.cs │ │ ├── DeleteLeaveRequestCommand.cs │ │ └── UpdateLeaveTypeCommand.cs │ │ └── Queries │ │ ├── GetLeaveTypeDetailRequest.cs │ │ └── GetLeaveTypeListRequest.cs ├── HR.LeaveManagement.Application.csproj ├── Models │ ├── Email.cs │ ├── EmailSettings.cs │ └── Identity │ │ ├── AuthRequest.cs │ │ ├── AuthResponse.cs │ │ ├── Employee.cs │ │ ├── JwtSettings.cs │ │ ├── RegistrationRequest.cs │ │ └── RegistrationResponse.cs ├── Profiles │ └── MappingProfile.cs └── Responses │ └── BaseCommandResponse.cs ├── HR.LeaveManagement.Domain ├── Common │ └── BaseDomainEntity.cs ├── HR.LeaveManagement.Domain.csproj ├── LeaveAllocation.cs ├── LeaveRequest.cs └── LeaveType.cs ├── HR.LeaveManagement.Identity ├── Configurations │ ├── RoleConfiguration.cs │ ├── UserConfiguration.cs │ └── UserRoleConfiguration.cs ├── HR.LeaveManagement.Identity.csproj ├── IdentityServicesRegistration.cs ├── LeaveManagementIdentityDbContext.cs ├── Migrations │ ├── 20210804225145_AddUserTables.Designer.cs │ ├── 20210804225145_AddUserTables.cs │ └── LeaveManagementIdentityDbContextModelSnapshot.cs ├── Models │ └── ApplicationUser.cs └── Services │ ├── AuthService.cs │ └── UserService.cs ├── HR.LeaveManagement.Infrastructure ├── HR.LeaveManagement.Infrastructure.csproj ├── InfrastructureServicesRegistration.cs └── Mail │ └── EmailSender.cs ├── HR.LeaveManagement.MVC ├── Contracts │ ├── IAuthenticationService.cs │ ├── ILeaveAllocationService.cs │ ├── ILeaveRequestService.cs │ ├── ILeaveTypeService.cs │ └── ILocalStorageService.cs ├── Controllers │ ├── HomeController.cs │ ├── LeaveRequestsController.cs │ ├── LeaveTypesController.cs │ └── UsersController.cs ├── HR.LeaveManagement.MVC.csproj ├── MappingProfile.cs ├── Middleware │ └── RequestMiddleware.cs ├── Models │ ├── EmployeeVM.cs │ ├── ErrorViewModel.cs │ ├── LeaveAllocationVM.cs │ ├── LeaveRequestVM.cs │ ├── LeaveTypeVM.cs │ ├── LoginVM.cs │ └── RegisterVM.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Services │ ├── AuthenticationService.cs │ ├── Base │ │ ├── BaseHttpService.cs │ │ ├── Client.cs │ │ ├── IClient.cs │ │ ├── Response.cs │ │ ├── ServiceClient.cs │ │ └── api.nswag │ ├── LeaveAllocationService.cs │ ├── LeaveRequestService.cs │ ├── LeaveTypeService.cs │ └── LocalStorageService.cs ├── Startup.cs ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ ├── NotAuthorized.cshtml │ │ └── Privacy.cshtml │ ├── LeaveRequests │ │ ├── Create.cshtml │ │ ├── Details.cshtml │ │ └── Index.cshtml │ ├── LeaveTypes │ │ ├── Create.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── Users │ │ ├── Login.cshtml │ │ └── Register.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── HR.LeaveManagement.Persistence ├── AuditableDbContext.cs ├── Configurations │ └── Entities │ │ ├── LeaveAllocationConfiguration.cs │ │ ├── LeaveRequestConfiguration.cs │ │ └── LeaveTypeConfiguration.cs ├── HR.LeaveManagement.Persistence.csproj ├── LeaveManagementDbContext.cs ├── Migrations │ ├── 20210728005924_InitialCreation.Designer.cs │ ├── 20210728005924_InitialCreation.cs │ ├── 20210729042528_SeedingLeaveTypes.Designer.cs │ ├── 20210729042528_SeedingLeaveTypes.cs │ ├── 20210805172833_AddedEmployeeIdToLeaveAllocation.Designer.cs │ ├── 20210805172833_AddedEmployeeIdToLeaveAllocation.cs │ ├── 20210805190928_AddedEmployeeIdToLeaveRequest.Designer.cs │ ├── 20210805190928_AddedEmployeeIdToLeaveRequest.cs │ └── LeaveManagementDbContextModelSnapshot.cs ├── PersistenceServicesRegistration.cs └── Repositories │ ├── GenericRepository.cs │ ├── LeaveAllocationRepository.cs │ ├── LeaveRequestRepository.cs │ ├── LeaveTypeRepository.cs │ └── UnitOfWork.cs ├── HR.LeaveManagement.sln ├── README.md └── leave-management-dotnetcore-master ├── .gitattributes ├── .gitignore ├── README.md ├── azure-pipelines.yml ├── leave-management.sln └── leave-management ├── .config └── dotnet-tools.json ├── Areas └── Identity │ ├── IdentityHostingStartup.cs │ └── Pages │ ├── Account │ ├── AccessDenied.cshtml │ ├── AccessDenied.cshtml.cs │ ├── ConfirmEmail.cshtml │ ├── ConfirmEmail.cshtml.cs │ ├── ConfirmEmailChange.cshtml │ ├── ConfirmEmailChange.cshtml.cs │ ├── ExternalLogin.cshtml │ ├── ExternalLogin.cshtml.cs │ ├── ForgotPassword.cshtml │ ├── ForgotPassword.cshtml.cs │ ├── ForgotPasswordConfirmation.cshtml │ ├── ForgotPasswordConfirmation.cshtml.cs │ ├── Lockout.cshtml │ ├── Lockout.cshtml.cs │ ├── Login.cshtml │ ├── Login.cshtml.cs │ ├── LoginWith2fa.cshtml │ ├── LoginWith2fa.cshtml.cs │ ├── LoginWithRecoveryCode.cshtml │ ├── LoginWithRecoveryCode.cshtml.cs │ ├── Logout.cshtml │ ├── Logout.cshtml.cs │ ├── Manage │ │ ├── ChangePassword.cshtml │ │ ├── ChangePassword.cshtml.cs │ │ ├── DeletePersonalData.cshtml │ │ ├── DeletePersonalData.cshtml.cs │ │ ├── Disable2fa.cshtml │ │ ├── Disable2fa.cshtml.cs │ │ ├── DownloadPersonalData.cshtml │ │ ├── DownloadPersonalData.cshtml.cs │ │ ├── Email.cshtml │ │ ├── Email.cshtml.cs │ │ ├── EnableAuthenticator.cshtml │ │ ├── EnableAuthenticator.cshtml.cs │ │ ├── ExternalLogins.cshtml │ │ ├── ExternalLogins.cshtml.cs │ │ ├── GenerateRecoveryCodes.cshtml │ │ ├── GenerateRecoveryCodes.cshtml.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── ManageNavPages.cs │ │ ├── PersonalData.cshtml │ │ ├── PersonalData.cshtml.cs │ │ ├── ResetAuthenticator.cshtml │ │ ├── ResetAuthenticator.cshtml.cs │ │ ├── SetPassword.cshtml │ │ ├── SetPassword.cshtml.cs │ │ ├── ShowRecoveryCodes.cshtml │ │ ├── ShowRecoveryCodes.cshtml.cs │ │ ├── TwoFactorAuthentication.cshtml │ │ ├── TwoFactorAuthentication.cshtml.cs │ │ ├── _Layout.cshtml │ │ ├── _ManageNav.cshtml │ │ ├── _StatusMessage.cshtml │ │ └── _ViewImports.cshtml │ ├── Register.cshtml │ ├── Register.cshtml.cs │ ├── RegisterConfirmation.cshtml │ ├── RegisterConfirmation.cshtml.cs │ ├── ResetPassword.cshtml │ ├── ResetPassword.cshtml.cs │ ├── ResetPasswordConfirmation.cshtml │ ├── ResetPasswordConfirmation.cshtml.cs │ ├── _StatusMessage.cshtml │ └── _ViewImports.cshtml │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── Contracts ├── IGenericRepository.cs ├── ILeaveAllocationRepository.cs ├── ILeaveRequestRepository.cs ├── ILeaveTypeRepository.cs ├── IRepositoryBase.cs └── IUnitOfWork.cs ├── Controllers ├── HomeController.cs ├── LeaveAllocationController.cs ├── LeaveRequestController.cs └── LeaveTypesController.cs ├── Data ├── ApplicationDbContext.cs ├── Employee.cs ├── LeaveAllocation.cs ├── LeaveRequest.cs ├── LeaveType.cs └── Migrations │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ ├── 00000000000000_CreateIdentitySchema.cs │ ├── 20191231214944_AddedEmployeeDataPoints.Designer.cs │ ├── 20191231214944_AddedEmployeeDataPoints.cs │ ├── 20191231220817_AddedLeaveDetailsTables.Designer.cs │ ├── 20191231220817_AddedLeaveDetailsTables.cs │ ├── 20200110013558_AddedDefaultDaysAndPeriod.Designer.cs │ ├── 20200110013558_AddedDefaultDaysAndPeriod.cs │ ├── 20200111133903_ChangedLeaveHistoriesToLeaveRequests.Designer.cs │ ├── 20200111133903_ChangedLeaveHistoriesToLeaveRequests.cs │ ├── 20200113051704_AddCommentsandCancelledFlag.Designer.cs │ ├── 20200113051704_AddCommentsandCancelledFlag.cs │ ├── 20200430165026_RemovedVMTables.Designer.cs │ ├── 20200430165026_RemovedVMTables.cs │ └── ApplicationDbContextModelSnapshot.cs ├── Mappings └── Maps.cs ├── Models ├── EmployeeVM.cs ├── ErrorViewModel.cs ├── LeaveAllocationVM.cs ├── LeaveRequestVM.cs └── LeaveTypeVM.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Repository ├── GenericRepository.cs ├── LeaveAllocationRepository.cs ├── LeaveRequestRepository.cs ├── LeaveTypeRepository.cs └── UnitOfWork.cs ├── SeedData.cs ├── Services ├── EmailSettings.cs └── IEmailSender.cs ├── Startup.cs ├── Views ├── Home │ ├── Index.cshtml │ └── Privacy.cshtml ├── LeaveAllocation │ ├── Details.cshtml │ ├── Edit.cshtml │ ├── Index.cshtml │ └── ListEmployees.cshtml ├── LeaveRequest │ ├── Create.cshtml │ ├── Details.cshtml │ ├── Index.cshtml │ └── MyLeave.cshtml ├── LeaveTypes │ ├── Create.cshtml │ ├── Delete.cshtml │ ├── Details.cshtml │ ├── Edit.cshtml │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── _AdminLTE.cshtml │ ├── _Layout.cshtml │ ├── _LoginPartial.cshtml │ └── _ValidationScriptsPartial.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json ├── leave-management.csproj └── wwwroot ├── css ├── adminlte.min.css ├── adminlte.min.css.map ├── all.min.css ├── dataTables.bootstrap4.min.css └── site.css ├── favicon.ico ├── js ├── adminlte.min.js ├── adminlte.min.js.map ├── bootstrap.bundle.min.js ├── bootstrap.bundle.min.js.map ├── dataTables.bootstrap4.min.js ├── jquery.dataTables.min.js └── site.js ├── lib ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map └── webfonts ├── fa-brands-400.eot ├── fa-brands-400.svg ├── fa-brands-400.ttf ├── fa-brands-400.woff ├── fa-brands-400.woff2 ├── fa-regular-400.eot ├── fa-regular-400.svg ├── fa-regular-400.ttf ├── fa-regular-400.woff ├── fa-regular-400.woff2 ├── fa-solid-900.eot ├── fa-solid-900.svg ├── fa-solid-900.ttf ├── fa-solid-900.woff └── fa-solid-900.woff2 /HR.LeaveManagement.Api/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Identity; 2 | using HR.LeaveManagement.Application.Models.Identity; 3 | using Microsoft.AspNetCore.Mvc; 4 | using System.Threading.Tasks; 5 | 6 | namespace HR.LeaveManagement.Api.Controllers 7 | { 8 | [Route("api/[controller]")] 9 | [ApiController] 10 | public class AccountController : ControllerBase 11 | { 12 | private readonly IAuthService _authenticationService; 13 | public AccountController(IAuthService authenticationService) 14 | { 15 | _authenticationService = authenticationService; 16 | } 17 | 18 | [HttpPost("login")] 19 | public async Task> Login(AuthRequest request) 20 | { 21 | return Ok(await _authenticationService.Login(request)); 22 | } 23 | 24 | [HttpPost("register")] 25 | public async Task> Register(RegistrationRequest request) 26 | { 27 | return Ok(await _authenticationService.Register(request)); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Api/HR.LeaveManagement.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | full 9 | true 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:18845", 8 | "sslPort": 44327 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "HR.LeaveManagement.Api": { 21 | "commandName": "Project", 22 | "dotnetRunMessages": "true", 23 | "launchBrowser": true, 24 | "launchUrl": "swagger", 25 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "LeaveManagementConnectionString": "Server=(localdb)\\mssqllocaldb;Database=hr_leavemanagement_db;Trusted_Connection=True;MultipleActiveResultSets=true", 4 | "LeaveManagementIdentityConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=hr_leavemanagement_identity_db;Trusted_Connection=True;" 5 | }, 6 | "EmailSettings": { 7 | "ApiKey": "SENDGRID_KEY_HERE", 8 | "FromName": "Leave Management System", 9 | "FromAddress": "noreply@leavemanagement.com" 10 | }, 11 | "Logging": { 12 | "LogLevel": { 13 | "Default": "Information", 14 | "Microsoft": "Warning", 15 | "Microsoft.Hosting.Lifetime": "Information" 16 | } 17 | }, 18 | "AllowedHosts": "*", 19 | "JwtSettings": { 20 | "Key": "84322CFB66934ECC86D547C5CF4F2EFC", 21 | "Issuer": "HRLeavemanagement", 22 | "Audience": "HRLeavemanagementUser", 23 | "DurationInMinutes": 60 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application.UnitTests/HR.LeaveManagement.Application.UnitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | all 17 | 18 | 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | all 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application.UnitTests/Mocks/MockLeaveTypeRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Persistence; 2 | using HR.LeaveManagement.Domain; 3 | using Moq; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.Application.UnitTests.Mocks 11 | { 12 | public static class MockLeaveTypeRepository 13 | { 14 | public static Mock GetLeaveTypeRepository() 15 | { 16 | var leaveTypes = new List 17 | { 18 | new LeaveType 19 | { 20 | Id = 1, 21 | DefaultDays = 10, 22 | Name = "Test Vacation" 23 | }, 24 | new LeaveType 25 | { 26 | Id = 2, 27 | DefaultDays = 15, 28 | Name = "Test Sick" 29 | }, 30 | new LeaveType 31 | { 32 | Id = 3, 33 | DefaultDays = 15, 34 | Name = "Test Maternity" 35 | } 36 | }; 37 | 38 | var mockRepo = new Mock(); 39 | 40 | mockRepo.Setup(r => r.GetAll()).ReturnsAsync(leaveTypes); 41 | 42 | mockRepo.Setup(r => r.Add(It.IsAny())).ReturnsAsync((LeaveType leaveType) => 43 | { 44 | leaveTypes.Add(leaveType); 45 | return leaveType; 46 | }); 47 | 48 | return mockRepo; 49 | 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application.UnitTests/Mocks/MockUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Persistence; 2 | using Moq; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.UnitTests.Mocks 10 | { 11 | public static class MockUnitOfWork 12 | { 13 | public static Mock GetUnitOfWork() 14 | { 15 | var mockUow = new Mock(); 16 | var mockLeaveTypeRepo = MockLeaveTypeRepository.GetLeaveTypeRepository(); 17 | 18 | mockUow.Setup(r => r.LeaveTypeRepository).Returns(mockLeaveTypeRepo.Object); 19 | 20 | return mockUow; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/ApplicationServicesRegistration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Profiles; 2 | using MediatR; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Reflection; 7 | using System.Text; 8 | 9 | namespace HR.LeaveManagement.Application 10 | { 11 | public static class ApplicationServicesRegistration 12 | { 13 | public static IServiceCollection ConfigureApplicationServices(this IServiceCollection services) 14 | { 15 | services.AddAutoMapper(Assembly.GetExecutingAssembly()); 16 | services.AddMediatR(Assembly.GetExecutingAssembly()); 17 | 18 | return services; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Constants/CustomClaimTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Constants 6 | { 7 | public static class CustomClaimTypes 8 | { 9 | public const string Uid = "uid"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Identity/IAuthService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Models.Identity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.Application.Contracts.Identity 8 | { 9 | public interface IAuthService 10 | { 11 | Task Login(AuthRequest request); 12 | Task Register(RegistrationRequest request); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Identity/IUserService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Models.Identity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Security.Claims; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.Application.Contracts.Identity 9 | { 10 | public interface IUserService 11 | { 12 | Task> GetEmployees(); 13 | Task GetEmployee(string userId); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Infrastructure/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.Application.Contracts.Infrastructure 8 | { 9 | public interface IEmailSender 10 | { 11 | Task SendEmail(Email email); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Persistence/IGenericRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | 6 | namespace HR.LeaveManagement.Application.Contracts.Persistence 7 | { 8 | public interface IGenericRepository where T : class 9 | { 10 | Task Get(int id); 11 | Task> GetAll(); 12 | Task Add(T entity); 13 | Task Exists(int id); 14 | Task Update(T entity); 15 | Task Delete(T entity); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Persistence/ILeaveAllocationRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.Application.Contracts.Persistence 8 | { 9 | public interface ILeaveAllocationRepository : IGenericRepository 10 | { 11 | Task GetLeaveAllocationWithDetails(int id); 12 | Task> GetLeaveAllocationsWithDetails(); 13 | Task> GetLeaveAllocationsWithDetails(string userId); 14 | Task AllocationExists(string userId, int leaveTypeId, int period); 15 | Task AddAllocations(List allocations); 16 | Task GetUserAllocations(string userId, int leaveTypeId); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Persistence/ILeaveRequestRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.Application.Contracts.Persistence 8 | { 9 | public interface ILeaveRequestRepository : IGenericRepository 10 | { 11 | Task GetLeaveRequestWithDetails(int id); 12 | Task> GetLeaveRequestsWithDetails(); 13 | Task> GetLeaveRequestsWithDetails(string userId); 14 | Task ChangeApprovalStatus(LeaveRequest leaveRequest, bool? ApprovalStatus); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Persistence/ILeaveTypeRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.Contracts.Persistence 7 | { 8 | public interface ILeaveTypeRepository : IGenericRepository 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Contracts/Persistence/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace HR.LeaveManagement.Application.Contracts.Persistence 5 | { 6 | public interface IUnitOfWork : IDisposable 7 | { 8 | ILeaveAllocationRepository LeaveAllocationRepository { get; } 9 | ILeaveRequestRepository LeaveRequestRepository { get; } 10 | ILeaveTypeRepository LeaveTypeRepository { get; } 11 | Task Save(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/Common/BaseDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.DTOs.Common 6 | { 7 | public abstract class BaseDto 8 | { 9 | public int Id { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/CreateLeaveAllocationDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation 8 | { 9 | public class CreateLeaveAllocationDto 10 | { 11 | public int LeaveTypeId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/ILeaveAllocationDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation 6 | { 7 | public interface ILeaveAllocationDto 8 | { 9 | public int NumberOfDays { get; set; } 10 | public int LeaveTypeId { get; set; } 11 | public int Period { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/LeaveAllocationDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using HR.LeaveManagement.Application.Models.Identity; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation 9 | { 10 | public class LeaveAllocationDto : BaseDto 11 | { 12 | public int NumberOfDays { get; set; } 13 | public LeaveTypeDto LeaveType { get; set; } 14 | public Employee Employee { get; set; } 15 | public string EmployeeId { get; set; } 16 | public int LeaveTypeId { get; set; } 17 | public int Period { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/UpdateLeaveAllocationDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation 8 | { 9 | public class UpdateLeaveAllocationDto : BaseDto, ILeaveAllocationDto 10 | { 11 | public int NumberOfDays { get; set; } 12 | public int LeaveTypeId { get; set; } 13 | public int Period { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/Validators/CreateLeaveAllocationDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation.Validators 10 | { 11 | public class CreateLeaveAllocationDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public CreateLeaveAllocationDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | 19 | RuleFor(p => p.LeaveTypeId) 20 | .GreaterThan(0) 21 | .MustAsync(async (id, token) => 22 | { 23 | var leaveTypeExists = await _leaveTypeRepository.Exists(id); 24 | return leaveTypeExists; 25 | }) 26 | .WithMessage("{PropertyName} does not exist."); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/Validators/ILeaveAllocationDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation.Validators 10 | { 11 | public class ILeaveAllocationDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public ILeaveAllocationDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | RuleFor(p => p.NumberOfDays) 19 | .GreaterThan(0).WithMessage("{PropertyName} must greater than {ComparisonValue}"); 20 | 21 | RuleFor(p => p.Period) 22 | .GreaterThanOrEqualTo(DateTime.Now.Year).WithMessage("{PropertyName} must be after {ComparisonValue}"); 23 | 24 | RuleFor(p => p.LeaveTypeId) 25 | .GreaterThan(0) 26 | .MustAsync(async (id, token) => 27 | { 28 | var leaveTypeExists = await _leaveTypeRepository.Exists(id); 29 | return leaveTypeExists; 30 | }) 31 | .WithMessage("{PropertyName} does not exist."); 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveAllocation/Validators/UpdateLeaveAllocationDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveAllocation.Validators 10 | { 11 | public class UpdateLeaveAllocationDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public UpdateLeaveAllocationDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | Include(new ILeaveAllocationDtoValidator(_leaveTypeRepository)); 19 | 20 | RuleFor(p => p.Id).NotNull().WithMessage("{PropertyName} must be present"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/ChangeLeaveRequestApprovalDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 7 | { 8 | public class ChangeLeaveRequestApprovalDto : BaseDto 9 | { 10 | public bool Approved { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/CreateLeaveRequestDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 7 | { 8 | public class CreateLeaveRequestDto : ILeaveRequestDto 9 | { 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public int LeaveTypeId { get; set; } 13 | public string RequestComments { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/ILeaveRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 6 | { 7 | public interface ILeaveRequestDto 8 | { 9 | public DateTime StartDate { get; set; } 10 | public DateTime EndDate { get; set; } 11 | public int LeaveTypeId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/LeaveRequestDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using HR.LeaveManagement.Application.Models.Identity; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 9 | { 10 | public class LeaveRequestDto : BaseDto 11 | { 12 | public DateTime StartDate { get; set; } 13 | public DateTime EndDate { get; set; } 14 | public Employee Employee { get; set; } 15 | public string RequestingEmployeeId { get; set; } 16 | public LeaveTypeDto LeaveType { get; set; } 17 | public int LeaveTypeId { get; set; } 18 | public DateTime DateRequested { get; set; } 19 | public string RequestComments { get; set; } 20 | public DateTime? DateActioned { get; set; } 21 | public bool? Approved { get; set; } 22 | public bool Cancelled { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/LeaveRequestListDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using HR.LeaveManagement.Application.Models.Identity; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 9 | { 10 | public class LeaveRequestListDto : BaseDto 11 | { 12 | public Employee Employee { get; set; } 13 | public string RequestingEmployeeId { get; set; } 14 | public LeaveTypeDto LeaveType { get; set; } 15 | public DateTime DateRequested { get; set; } 16 | public DateTime StartDate { get; set; } 17 | public DateTime EndDate { get; set; } 18 | public bool? Approved { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/UpdateLeaveRequestDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest 7 | { 8 | public class UpdateLeaveRequestDto : BaseDto, ILeaveRequestDto 9 | { 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public int LeaveTypeId { get; set; } 13 | public string RequestComments { get; set; } 14 | public bool Cancelled { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/Validators/CreateLeaveRequestDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest.Validators 10 | { 11 | public class CreateLeaveRequestDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public CreateLeaveRequestDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | Include(new ILeaveRequestDtoValidator(_leaveTypeRepository)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/Validators/ILeaveRequestDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest.Validators 10 | { 11 | public class ILeaveRequestDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public ILeaveRequestDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | RuleFor(p => p.StartDate) 19 | .LessThan(p => p.EndDate).WithMessage("{PropertyName} must be before {ComparisonValue}"); 20 | 21 | RuleFor(p => p.EndDate) 22 | .GreaterThan(p => p.StartDate).WithMessage("{PropertyName} must be after {ComparisonValue}"); 23 | 24 | RuleFor(p => p.LeaveTypeId) 25 | .GreaterThan(0) 26 | .MustAsync(async (id, token) => { 27 | var leaveTypeExists = await _leaveTypeRepository.Exists(id); 28 | return leaveTypeExists; 29 | }) 30 | .WithMessage("{PropertyName} does not exist."); 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveRequest/Validators/UpdateLeaveRequestDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HR.LeaveManagement.Application.Contracts.Persistence; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Application.DTOs.LeaveRequest.Validators 10 | { 11 | public class UpdateLeaveRequestDtoValidator : AbstractValidator 12 | { 13 | private readonly ILeaveTypeRepository _leaveTypeRepository; 14 | 15 | public UpdateLeaveRequestDtoValidator(ILeaveTypeRepository leaveTypeRepository) 16 | { 17 | _leaveTypeRepository = leaveTypeRepository; 18 | Include(new ILeaveRequestDtoValidator(_leaveTypeRepository)); 19 | 20 | RuleFor(p => p.Id).NotNull().WithMessage("{PropertyName} must be present"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/CreateLeaveTypeDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveType 7 | { 8 | public class CreateLeaveTypeDto : ILeaveTypeDto 9 | { 10 | public string Name { get; set; } 11 | public int DefaultDays { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/ILeaveTypeDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.DTOs.LeaveType 6 | { 7 | public interface ILeaveTypeDto 8 | { 9 | public string Name { get; set; } 10 | public int DefaultDays { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/LeaveTypeDto.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveType 7 | { 8 | public class LeaveTypeDto : BaseDto, ILeaveTypeDto 9 | { 10 | public string Name { get; set; } 11 | public int DefaultDays { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/Validators/CreateLeaveTypeDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveType.Validators 7 | { 8 | public class CreateLeaveTypeDtoValidator : AbstractValidator 9 | { 10 | public CreateLeaveTypeDtoValidator() 11 | { 12 | Include(new ILeaveTypeDtoValidator()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/Validators/ILeaveTypeDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveType.Validators 7 | { 8 | public class ILeaveTypeDtoValidator : AbstractValidator 9 | { 10 | public ILeaveTypeDtoValidator() 11 | { 12 | RuleFor(p => p.Name) 13 | .NotEmpty().WithMessage("{PropertyName} is required.") 14 | .NotNull() 15 | .MaximumLength(50).WithMessage("{PropertyName} must not exceed {ComparisonValue} characters."); 16 | 17 | RuleFor(p => p.DefaultDays) 18 | .NotEmpty().WithMessage("{PropertyName} is required.") 19 | .GreaterThan(0).WithMessage("{PropertyName} must be at least 1.") 20 | .LessThan(100).WithMessage("{PropertyName} must be less than {ComparisonValue}."); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/DTOs/LeaveType/Validators/UpdateLeaveTypeDtoValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.DTOs.LeaveType.Validators 7 | { 8 | public class UpdateLeaveTypeDtoValidator : AbstractValidator 9 | { 10 | public UpdateLeaveTypeDtoValidator() 11 | { 12 | Include(new ILeaveTypeDtoValidator()); 13 | 14 | RuleFor(p => p.Id).NotNull().WithMessage("{PropertyName} must be present"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Exceptions 6 | { 7 | public class BadRequestException : ApplicationException 8 | { 9 | public BadRequestException(string message) : base(message) 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Exceptions/NotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Exceptions 6 | { 7 | public class NotFoundException : ApplicationException 8 | { 9 | public NotFoundException(string name, object key) : base($"{name} ({key}) was not found") 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Exceptions/ValidationException.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation.Results; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.Exceptions 7 | { 8 | public class ValidationException : ApplicationException 9 | { 10 | public List Errors { get; set; } = new List(); 11 | 12 | public ValidationException(ValidationResult validationResult) 13 | { 14 | foreach (var error in validationResult.Errors) 15 | { 16 | Errors.Add(error.ErrorMessage); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Handlers/Commands/DeleteLeaveAllocationCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.Exceptions; 3 | using HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Commands; 4 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands; 5 | using HR.LeaveManagement.Application.Contracts.Persistence; 6 | using HR.LeaveManagement.Domain; 7 | using MediatR; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | 14 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Handlers.Commands 15 | { 16 | public class DeleteLeaveAllocationCommandHandler : IRequestHandler 17 | { 18 | private readonly IUnitOfWork _unitOfWork; 19 | private readonly IMapper _mapper; 20 | 21 | public DeleteLeaveAllocationCommandHandler(IUnitOfWork unitOfWork, IMapper mapper) 22 | { 23 | _unitOfWork = unitOfWork; 24 | _mapper = mapper; 25 | } 26 | 27 | public async Task Handle(DeleteLeaveAllocationCommand request, CancellationToken cancellationToken) 28 | { 29 | var leaveAllocation = await _unitOfWork.LeaveAllocationRepository.Get(request.Id); 30 | 31 | if (leaveAllocation == null) 32 | throw new NotFoundException(nameof(LeaveAllocation), request.Id); 33 | 34 | await _unitOfWork.LeaveAllocationRepository.Delete(leaveAllocation); 35 | await _unitOfWork.Save(); 36 | return Unit.Value; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Handlers/Queries/GetLeaveAllocationDetailRequestHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.DTOs; 3 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 4 | using HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Queries; 5 | using HR.LeaveManagement.Application.Contracts.Persistence; 6 | using MediatR; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Handlers.Queries 11 | { 12 | public class GetLeaveAllocationDetailRequestHandler : IRequestHandler 13 | { 14 | private readonly ILeaveAllocationRepository _leaveAllocationRepository; 15 | private readonly IMapper _mapper; 16 | 17 | public GetLeaveAllocationDetailRequestHandler(ILeaveAllocationRepository leaveAllocationRepository, IMapper mapper) 18 | { 19 | _leaveAllocationRepository = leaveAllocationRepository; 20 | _mapper = mapper; 21 | } 22 | public async Task Handle(GetLeaveAllocationDetailRequest request, CancellationToken cancellationToken) 23 | { 24 | var leaveAllocation = await _leaveAllocationRepository.GetLeaveAllocationWithDetails(request.Id); 25 | return _mapper.Map(leaveAllocation); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Requests/Commands/CreateLeaveAllocationCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using HR.LeaveManagement.Application.Responses; 4 | using MediatR; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Commands 10 | { 11 | public class CreateLeaveAllocationCommand : IRequest 12 | { 13 | public CreateLeaveAllocationDto LeaveAllocationDto { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Requests/Commands/DeleteLeaveAllocationCommand.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Commands 7 | { 8 | public class DeleteLeaveAllocationCommand : IRequest 9 | { 10 | public int Id { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Requests/Commands/UpdateLeaveAllocationCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Commands 9 | { 10 | public class UpdateLeaveAllocationCommand : IRequest 11 | { 12 | public UpdateLeaveAllocationDto LeaveAllocationDto { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Requests/Queries/GetLeaveAllocationDetailRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 3 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 4 | using MediatR; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Queries 10 | { 11 | public class GetLeaveAllocationDetailRequest : IRequest 12 | { 13 | public int Id { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveAllocations/Requests/Queries/GetLeaveAllocationListRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 3 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 4 | using MediatR; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace HR.LeaveManagement.Application.Features.LeaveAllocations.Requests.Queries 10 | { 11 | public class GetLeaveAllocationListRequest : IRequest> 12 | { 13 | public bool IsLoggedInUser { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Handlers/Commands/DeleteLeaveRequestCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.Exceptions; 3 | using HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Commands; 4 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands; 5 | using HR.LeaveManagement.Application.Contracts.Persistence; 6 | using HR.LeaveManagement.Domain; 7 | using MediatR; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | 14 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Handlers.Commands 15 | { 16 | public class DeleteLeaveRequestCommandHandler : IRequestHandler 17 | { 18 | private readonly IUnitOfWork _unitOfWork; 19 | private readonly IMapper _mapper; 20 | 21 | public DeleteLeaveRequestCommandHandler(IUnitOfWork unitOfWork, IMapper mapper) 22 | { 23 | _unitOfWork = unitOfWork; 24 | _mapper = mapper; 25 | } 26 | 27 | public async Task Handle(DeleteLeaveRequestCommand request, CancellationToken cancellationToken) 28 | { 29 | var leaveRequest = await _unitOfWork.LeaveRequestRepository.Get(request.Id); 30 | 31 | if (leaveRequest == null) 32 | throw new NotFoundException(nameof(LeaveRequest), request.Id); 33 | 34 | await _unitOfWork.LeaveRequestRepository.Delete(leaveRequest); 35 | await _unitOfWork.Save(); 36 | return Unit.Value; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Requests/Commands/CreateLeaveRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using HR.LeaveManagement.Application.Responses; 4 | using MediatR; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Commands 10 | { 11 | public class CreateLeaveRequestCommand : IRequest 12 | { 13 | public CreateLeaveRequestDto LeaveRequestDto { get; set; } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Requests/Commands/DeleteLeaveRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Commands 7 | { 8 | public class DeleteLeaveRequestCommand : IRequest 9 | { 10 | public int Id { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Requests/Commands/UpdateLeaveRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Commands 9 | { 10 | public class UpdateLeaveRequestCommand : IRequest 11 | { 12 | public int Id { get; set; } 13 | 14 | public UpdateLeaveRequestDto LeaveRequestDto { get; set; } 15 | 16 | public ChangeLeaveRequestApprovalDto ChangeLeaveRequestApprovalDto { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Requests/Queries/GetLeaveRequestDetailRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Queries 9 | { 10 | public class GetLeaveRequestDetailRequest : IRequest 11 | { 12 | public int Id { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveRequests/Requests/Queries/GetLeaveRequestListRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Queries 9 | { 10 | public class GetLeaveRequestListRequest : IRequest> 11 | { 12 | public bool IsLoggedInUser { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Handlers/Commands/DeleteLeaveTypeCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.Exceptions; 3 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands; 4 | using HR.LeaveManagement.Application.Contracts.Persistence; 5 | using HR.LeaveManagement.Domain; 6 | using MediatR; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | 13 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Handlers.Commands 14 | { 15 | public class DeleteLeaveTypeCommandHandler : IRequestHandler 16 | { 17 | private readonly IUnitOfWork _unitOfWork; 18 | private readonly IMapper _mapper; 19 | 20 | public DeleteLeaveTypeCommandHandler(IUnitOfWork unitOfWork, IMapper mapper) 21 | { 22 | _unitOfWork = unitOfWork; 23 | _mapper = mapper; 24 | } 25 | 26 | public async Task Handle(DeleteLeaveTypeCommand request, CancellationToken cancellationToken) 27 | { 28 | var leaveType = await _unitOfWork.LeaveTypeRepository.Get(request.Id); 29 | 30 | if (leaveType == null) 31 | throw new NotFoundException(nameof(LeaveType), request.Id); 32 | 33 | await _unitOfWork.LeaveTypeRepository.Delete(leaveType); 34 | await _unitOfWork.Save(); 35 | 36 | return Unit.Value; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Handlers/Queries/GetLeaveTypeDetailRequestHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.DTOs; 3 | using HR.LeaveManagement.Application.DTOs.LeaveType; 4 | using HR.LeaveManagement.Application.Features.LeaveRequests.Requests.Queries; 5 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests; 6 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Queries; 7 | using HR.LeaveManagement.Application.Contracts.Persistence; 8 | using MediatR; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | using System.Threading; 13 | using System.Threading.Tasks; 14 | 15 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Handlers.Queries 16 | { 17 | public class GetLeaveTypeDetailRequestHandler : IRequestHandler 18 | { 19 | private readonly ILeaveTypeRepository _leaveTypeRepository; 20 | private readonly IMapper _mapper; 21 | 22 | public GetLeaveTypeDetailRequestHandler(ILeaveTypeRepository leaveTypeRepository, IMapper mapper) 23 | { 24 | _leaveTypeRepository = leaveTypeRepository; 25 | _mapper = mapper; 26 | } 27 | public async Task Handle(GetLeaveTypeDetailRequest request, CancellationToken cancellationToken) 28 | { 29 | var leaveType = await _leaveTypeRepository.Get(request.Id); 30 | return _mapper.Map(leaveType); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Handlers/Queries/GetLeaveTypeListRequestHandler.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.DTOs; 3 | using HR.LeaveManagement.Application.DTOs.LeaveType; 4 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests; 5 | using HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Queries; 6 | using HR.LeaveManagement.Application.Contracts.Persistence; 7 | using MediatR; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | 14 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Handlers.Queries 15 | { 16 | public class GetLeaveTypeListRequestHandler : IRequestHandler> 17 | { 18 | private readonly ILeaveTypeRepository _leaveTypeRepository; 19 | private readonly IMapper _mapper; 20 | 21 | public GetLeaveTypeListRequestHandler(ILeaveTypeRepository leaveTypeRepository, IMapper mapper) 22 | { 23 | _leaveTypeRepository = leaveTypeRepository; 24 | _mapper = mapper; 25 | } 26 | 27 | public async Task> Handle(GetLeaveTypeListRequest request, CancellationToken cancellationToken) 28 | { 29 | var leaveTypes = await _leaveTypeRepository.GetAll(); 30 | return _mapper.Map>(leaveTypes); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Requests/Commands/CreateLeaveTypeCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveType; 2 | using HR.LeaveManagement.Application.Responses; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands 9 | { 10 | public class CreateLeaveTypeCommand : IRequest 11 | { 12 | public CreateLeaveTypeDto LeaveTypeDto { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Requests/Commands/DeleteLeaveRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands 7 | { 8 | public class DeleteLeaveTypeCommand : IRequest 9 | { 10 | public int Id { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Requests/Commands/UpdateLeaveTypeCommand.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs.LeaveType; 2 | using MediatR; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Commands 8 | { 9 | public class UpdateLeaveTypeCommand : IRequest 10 | { 11 | public LeaveTypeDto LeaveTypeDto { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Requests/Queries/GetLeaveTypeDetailRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Queries 9 | { 10 | public class GetLeaveTypeDetailRequest : IRequest 11 | { 12 | public int Id { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Features/LeaveTypes/Requests/Queries/GetLeaveTypeListRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.DTOs; 2 | using HR.LeaveManagement.Application.DTOs.LeaveType; 3 | using MediatR; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Application.Features.LeaveTypes.Requests.Queries 9 | { 10 | public class GetLeaveTypeListRequest : IRequest> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/HR.LeaveManagement.Application.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Email.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Models 6 | { 7 | public class Email 8 | { 9 | public string To { get; set; } 10 | public string Subject { get; set; } 11 | public string Body { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/EmailSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Models 6 | { 7 | public class EmailSettings 8 | { 9 | public string ApiKey { get; set; } 10 | public string FromAddress { get; set; } 11 | public string FromName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/AuthRequest.cs: -------------------------------------------------------------------------------- 1 | namespace HR.LeaveManagement.Application.Models.Identity 2 | { 3 | public class AuthRequest 4 | { 5 | public string Email { get; set; } 6 | public string Password { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/AuthResponse.cs: -------------------------------------------------------------------------------- 1 | namespace HR.LeaveManagement.Application.Models.Identity 2 | { 3 | public class AuthResponse 4 | { 5 | public string Id { get; set; } 6 | public string UserName { get; set; } 7 | public string Email { get; set; } 8 | public string Token { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/Employee.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Models.Identity 6 | { 7 | public class Employee 8 | { 9 | public string Id { get; set; } 10 | public string Email { get; set; } 11 | public string Firstname { get; set; } 12 | public string Lastname { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/JwtSettings.cs: -------------------------------------------------------------------------------- 1 | namespace HR.LeaveManagement.Application.Models.Identity 2 | { 3 | public class JwtSettings 4 | { 5 | public string Key { get; set; } 6 | public string Issuer { get; set; } 7 | public string Audience { get; set; } 8 | public double DurationInMinutes { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/RegistrationRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace HR.LeaveManagement.Application.Models.Identity 4 | { 5 | public class RegistrationRequest 6 | { 7 | [Required] 8 | public string FirstName { get; set; } 9 | 10 | [Required] 11 | public string LastName { get; set; } 12 | 13 | [Required] 14 | [EmailAddress] 15 | public string Email { get; set; } 16 | 17 | [Required] 18 | [MinLength(6)] 19 | public string UserName { get; set; } 20 | 21 | [Required] 22 | [MinLength(6)] 23 | public string Password { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Models/Identity/RegistrationResponse.cs: -------------------------------------------------------------------------------- 1 | namespace HR.LeaveManagement.Application.Models.Identity 2 | { 3 | public class RegistrationResponse 4 | { 5 | public string UserId { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Profiles/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.DTOs; 3 | using HR.LeaveManagement.Application.DTOs.LeaveAllocation; 4 | using HR.LeaveManagement.Application.DTOs.LeaveRequest; 5 | using HR.LeaveManagement.Application.DTOs.LeaveType; 6 | using HR.LeaveManagement.Domain; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | 11 | namespace HR.LeaveManagement.Application.Profiles 12 | { 13 | public class MappingProfile : Profile 14 | { 15 | public MappingProfile() 16 | { 17 | #region LeaveRequest Mappings 18 | CreateMap().ReverseMap(); 19 | CreateMap() 20 | .ForMember(dest => dest.DateRequested, opt => opt.MapFrom(src => src.DateCreated)) 21 | .ReverseMap(); 22 | CreateMap().ReverseMap(); 23 | CreateMap().ReverseMap(); 24 | #endregion LeaveRequest 25 | 26 | CreateMap().ReverseMap(); 27 | CreateMap().ReverseMap(); 28 | CreateMap().ReverseMap(); 29 | 30 | CreateMap().ReverseMap(); 31 | CreateMap().ReverseMap(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Application/Responses/BaseCommandResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Application.Responses 6 | { 7 | public class BaseCommandResponse 8 | { 9 | public int Id { get; set; } 10 | public bool Success { get; set; } = true; 11 | public string Message { get; set; } 12 | public List Errors { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Domain/Common/BaseDomainEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HR.LeaveManagement.Domain.Common 6 | { 7 | public abstract class BaseDomainEntity 8 | { 9 | public int Id { get; set; } 10 | public DateTime DateCreated { get; set; } 11 | public string CreatedBy { get; set; } 12 | public DateTime LastModifiedDate { get; set; } 13 | public string LastModifiedBy { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Domain/HR.LeaveManagement.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Domain/LeaveAllocation.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Domain 7 | { 8 | public class LeaveAllocation : BaseDomainEntity 9 | { 10 | public int NumberOfDays { get; set; } 11 | public LeaveType LeaveType { get; set; } 12 | public int LeaveTypeId { get; set; } 13 | public int Period { get; set; } 14 | public string EmployeeId { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Domain/LeaveRequest.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Domain 7 | { 8 | public class LeaveRequest : BaseDomainEntity 9 | { 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public LeaveType LeaveType { get; set; } 13 | public int LeaveTypeId { get; set; } 14 | public DateTime DateRequested { get; set; } 15 | public string RequestComments { get; set; } 16 | public DateTime? DateActioned { get; set; } 17 | public bool? Approved { get; set; } 18 | public bool Cancelled { get; set; } 19 | public string RequestingEmployeeId { get; set; } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Domain/LeaveType.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain.Common; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Domain 7 | { 8 | public class LeaveType : BaseDomainEntity 9 | { 10 | public string Name { get; set; } 11 | public int DefaultDays { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/Configurations/RoleConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Identity.Configurations 10 | { 11 | public class RoleConfiguration : IEntityTypeConfiguration 12 | { 13 | public void Configure(EntityTypeBuilder builder) 14 | { 15 | builder.HasData( 16 | new IdentityRole 17 | { 18 | Id = "cac43a6e-f7bb-4448-baaf-1add431ccbbf", 19 | Name = "Employee", 20 | NormalizedName = "EMPLOYEE" 21 | }, 22 | new IdentityRole 23 | { 24 | Id = "cbc43a8e-f7bb-4445-baaf-1add431ffbbf", 25 | Name = "Administrator", 26 | NormalizedName = "ADMINISTRATOR" 27 | } 28 | ); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/Configurations/UserRoleConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | 6 | namespace HR.LeaveManagement.Identity.Configurations 7 | { 8 | public class UserRoleConfiguration : IEntityTypeConfiguration> 9 | { 10 | public void Configure(EntityTypeBuilder> builder) 11 | { 12 | builder.HasData( 13 | new IdentityUserRole 14 | { 15 | RoleId = "cbc43a8e-f7bb-4445-baaf-1add431ffbbf", 16 | UserId = "8e445865-a24d-4543-a6c6-9443d048cdb9" 17 | }, 18 | new IdentityUserRole 19 | { 20 | RoleId = "cac43a6e-f7bb-4448-baaf-1add431ccbbf", 21 | UserId = "9e224968-33e4-4652-b7b7-8574d048cdb9" 22 | } 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/HR.LeaveManagement.Identity.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/LeaveManagementIdentityDbContext.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Identity.Models; 2 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore; 4 | using HR.LeaveManagement.Identity.Configurations; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Identity 9 | { 10 | public class LeaveManagementIdentityDbContext : IdentityDbContext 11 | { 12 | public LeaveManagementIdentityDbContext(DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | protected override void OnModelCreating(ModelBuilder modelBuilder) 18 | { 19 | base.OnModelCreating(modelBuilder); 20 | 21 | modelBuilder.ApplyConfiguration(new RoleConfiguration()); 22 | modelBuilder.ApplyConfiguration(new UserConfiguration()); 23 | modelBuilder.ApplyConfiguration(new UserRoleConfiguration()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace HR.LeaveManagement.Identity.Models 7 | { 8 | public class ApplicationUser : IdentityUser 9 | { 10 | public string FirstName { get; set; } 11 | public string LastName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Identity/Services/UserService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.Application.Contracts.Identity; 3 | using HR.LeaveManagement.Application.Models.Identity; 4 | using HR.LeaveManagement.Identity.Models; 5 | using Microsoft.AspNetCore.Identity; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Security.Claims; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | namespace HR.LeaveManagement.Identity.Services 14 | { 15 | public class UserService : IUserService 16 | { 17 | private readonly UserManager _userManager; 18 | 19 | public UserService(UserManager userManager) 20 | { 21 | _userManager = userManager; 22 | } 23 | 24 | public async Task GetEmployee(string userId) 25 | { 26 | var employee = await _userManager.FindByIdAsync(userId); 27 | return new Employee 28 | { 29 | Email = employee.Email, 30 | Id = employee.Id, 31 | Firstname = employee.FirstName, 32 | Lastname = employee.LastName 33 | }; 34 | } 35 | 36 | public async Task> GetEmployees() 37 | { 38 | var employees = await _userManager.GetUsersInRoleAsync("Employee"); 39 | return employees.Select(q => new Employee { 40 | Id = q.Id, 41 | Email = q.Email, 42 | Firstname = q.FirstName, 43 | Lastname = q.LastName 44 | }).ToList(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Infrastructure/HR.LeaveManagement.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Infrastructure/InfrastructureServicesRegistration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Infrastructure; 2 | using HR.LeaveManagement.Application.Models; 3 | using HR.LeaveManagement.Application.Profiles; 4 | using HR.LeaveManagement.Infrastructure.Mail; 5 | using MediatR; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Reflection; 11 | using System.Text; 12 | 13 | namespace HR.LeaveManagement.Application 14 | { 15 | public static class InfrastructureServicesRegistration 16 | { 17 | public static IServiceCollection ConfigureInfrastructureServices(this IServiceCollection services, IConfiguration configuration) 18 | { 19 | services.Configure(configuration.GetSection("EmailSettings")); 20 | services.AddTransient(); 21 | 22 | return services; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Infrastructure/Mail/EmailSender.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Infrastructure; 2 | using HR.LeaveManagement.Application.Models; 3 | using Microsoft.Extensions.Options; 4 | using SendGrid; 5 | using SendGrid.Helpers.Mail; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace HR.LeaveManagement.Infrastructure.Mail 12 | { 13 | public class EmailSender : IEmailSender 14 | { 15 | private EmailSettings _emailSettings { get; } 16 | public EmailSender(IOptions emailSettings) 17 | { 18 | _emailSettings = emailSettings.Value; 19 | } 20 | 21 | public async Task SendEmail(Email email) 22 | { 23 | var client = new SendGridClient(_emailSettings.ApiKey); 24 | var to = new EmailAddress(email.To); 25 | var from = new EmailAddress 26 | { 27 | Email = _emailSettings.FromAddress, 28 | Name = _emailSettings.FromName 29 | }; 30 | 31 | var message = MailHelper.CreateSingleEmail(from, to, email.Subject, email.Body, email.Body); 32 | var response = await client.SendEmailAsync(message); 33 | 34 | return response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.Accepted; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Contracts/IAuthenticationService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Models; 2 | using System.Threading.Tasks; 3 | 4 | namespace HR.LeaveManagement.MVC.Contracts 5 | { 6 | public interface IAuthenticationService 7 | { 8 | Task Authenticate(string email, string password); 9 | Task Register(RegisterVM registration); 10 | Task Logout(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Contracts/ILeaveAllocationService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Models; 2 | using HR.LeaveManagement.MVC.Services.Base; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.MVC.Contracts 9 | { 10 | public interface ILeaveAllocationService 11 | { 12 | Task> CreateLeaveAllocations(int leaveTypeId); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Contracts/ILeaveRequestService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Models; 2 | using HR.LeaveManagement.MVC.Services.Base; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.MVC.Contracts 9 | { 10 | public interface ILeaveRequestService 11 | { 12 | Task GetAdminLeaveRequestList(); 13 | Task GetUserLeaveRequests(); 14 | Task> CreateLeaveRequest(CreateLeaveRequestVM leaveRequest); 15 | Task GetLeaveRequest(int id); 16 | Task DeleteLeaveRequest(int id); 17 | Task ApproveLeaveRequest(int id, bool approved); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Contracts/ILeaveTypeService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Models; 2 | using HR.LeaveManagement.MVC.Services.Base; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.MVC.Contracts 9 | { 10 | public interface ILeaveTypeService 11 | { 12 | Task> GetLeaveTypes(); 13 | Task GetLeaveTypeDetails(int id); 14 | Task> CreateLeaveType(CreateLeaveTypeVM leaveType); 15 | Task> UpdateLeaveType(int id, LeaveTypeVM leaveType); 16 | Task> DeleteLeaveType(int id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Contracts/ILocalStorageService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HR.LeaveManagement.MVC.Contracts 4 | { 5 | public interface ILocalStorageService 6 | { 7 | void ClearStorage(List keys); 8 | bool Exists(string key); 9 | T GetStorageValue(string key); 10 | void SetStorageValue(string key, T value); 11 | } 12 | } -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Logging; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.MVC.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | private readonly ILogger _logger; 15 | 16 | public HomeController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | public IActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | public IActionResult Privacy() 27 | { 28 | return View(); 29 | } 30 | 31 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | 37 | public IActionResult NotAuthorized() 38 | { 39 | return View(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/HR.LeaveManagement.MVC.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using HR.LeaveManagement.MVC.Models; 3 | using HR.LeaveManagement.MVC.Services.Base; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.MVC 10 | { 11 | public class MappingProfile : Profile 12 | { 13 | public MappingProfile() 14 | { 15 | CreateMap().ReverseMap(); 16 | CreateMap().ReverseMap(); 17 | CreateMap() 18 | .ForMember(q => q.DateRequested, opt => opt.MapFrom(x => x.DateRequested.DateTime)) 19 | .ForMember(q => q.StartDate, opt => opt.MapFrom(x => x.StartDate.DateTime)) 20 | .ForMember(q => q.EndDate, opt => opt.MapFrom(x => x.EndDate.DateTime)) 21 | .ReverseMap(); 22 | CreateMap() 23 | .ForMember(q => q.DateRequested, opt => opt.MapFrom(x => x.DateRequested.DateTime)) 24 | .ForMember(q => q.StartDate, opt => opt.MapFrom(x => x.StartDate.DateTime)) 25 | .ForMember(q => q.EndDate, opt => opt.MapFrom(x => x.EndDate.DateTime)) 26 | .ReverseMap(); 27 | CreateMap().ReverseMap(); 28 | CreateMap().ReverseMap(); 29 | CreateMap().ReverseMap(); 30 | CreateMap().ReverseMap(); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/EmployeeVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace HR.LeaveManagement.MVC.Models 7 | { 8 | public class EmployeeVM 9 | { 10 | public string Id { get; set; } 11 | public string Email { get; set; } 12 | public string Firstname { get; set; } 13 | public string Lastname { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HR.LeaveManagement.MVC.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/LeaveAllocationVM.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Rendering; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.MVC.Models 9 | { 10 | public class LeaveAllocationVM 11 | { 12 | public int Id { get; set; } 13 | [Display(Name = "Number Of Days")] 14 | 15 | public int NumberOfDays { get; set; } 16 | public DateTime DateCreated { get; set; } 17 | public int Period { get; set; } 18 | 19 | public LeaveTypeVM LeaveType { get; set; } 20 | public int LeaveTypeId { get; set; } 21 | } 22 | 23 | public class CreateLeaveAllocationVM 24 | { 25 | public int LeaveTypeId { get; set; } 26 | } 27 | 28 | public class UpdateLeaveAllocationVM 29 | { 30 | public int Id { get; set; } 31 | 32 | [Display(Name="Number Of Days")] 33 | [Range(1,50, ErrorMessage = "Enter Valid Number")] 34 | public int NumberOfDays { get; set; } 35 | public LeaveTypeVM LeaveType { get; set; } 36 | 37 | } 38 | 39 | public class ViewLeaveAllocationsVM 40 | { 41 | public string EmployeeId { get; set; } 42 | public List LeaveAllocations { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/LeaveTypeVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.MVC.Models 8 | { 9 | public class LeaveTypeVM : CreateLeaveTypeVM 10 | { 11 | public int Id { get; set; } 12 | } 13 | 14 | public class CreateLeaveTypeVM 15 | { 16 | [Required] 17 | public string Name { get; set; } 18 | 19 | [Required] 20 | [Display(Name = "Default Number Of Days")] 21 | public int DefaultDays { get; set; } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/LoginVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.MVC.Models 8 | { 9 | public class LoginVM 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | 19 | public string ReturnUrl { get; set; } 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Models/RegisterVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.MVC.Models 8 | { 9 | public class RegisterVM 10 | { 11 | [Required] 12 | public string FirstName { get; set; } 13 | 14 | [Required] 15 | public string LastName { get; set; } 16 | 17 | [Required] 18 | [EmailAddress] 19 | public string Email { get; set; } 20 | 21 | [Required] 22 | public string UserName { get; set; } 23 | 24 | [Required] 25 | [DataType(DataType.Password)] 26 | public string Password { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.MVC 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:45624", 7 | "sslPort": 44368 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "HR.LeaveManagement.MVC": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Services/Base/BaseHttpService.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.MVC.Contracts; 2 | using System.Net.Http.Headers; 3 | using System.Threading.Tasks; 4 | 5 | namespace HR.LeaveManagement.MVC.Services.Base 6 | { 7 | public class BaseHttpService 8 | { 9 | protected readonly ILocalStorageService _localStorage; 10 | 11 | protected IClient _client; 12 | 13 | public BaseHttpService(IClient client, ILocalStorageService localStorage) 14 | { 15 | _client = client; 16 | _localStorage = localStorage; 17 | 18 | } 19 | 20 | protected Response ConvertApiExceptions(ApiException ex) 21 | { 22 | if (ex.StatusCode == 400) 23 | { 24 | return new Response() { Message = "Validation errors have occured.", ValidationErrors = ex.Response, Success = false }; 25 | } 26 | else if (ex.StatusCode == 404) 27 | { 28 | return new Response() { Message = "The requested item could not be found.", Success = false }; 29 | } 30 | else 31 | { 32 | return new Response() { Message = "Something went wrong, please try again.", Success = false }; 33 | } 34 | } 35 | 36 | protected void AddBearerToken() 37 | { 38 | if (_localStorage.Exists("token")) 39 | _client.HttpClient.DefaultRequestHeaders.Authorization = 40 | new AuthenticationHeaderValue("Bearer", _localStorage.GetStorageValue("token")); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Services/Base/Client.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | 3 | namespace HR.LeaveManagement.MVC.Services.Base 4 | { 5 | public partial class Client : IClient 6 | { 7 | public HttpClient HttpClient 8 | { 9 | get 10 | { 11 | return _httpClient; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Services/Base/IClient.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | 3 | namespace HR.LeaveManagement.MVC.Services.Base 4 | { 5 | public partial interface IClient 6 | { 7 | public HttpClient HttpClient { get; } 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Services/Base/Response.cs: -------------------------------------------------------------------------------- 1 | namespace HR.LeaveManagement.MVC.Services.Base 2 | { 3 | public class Response 4 | { 5 | public string Message { get; set; } 6 | public string ValidationErrors { get; set; } 7 | public bool Success { get; set; } 8 | public T Data { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Services/LocalStorageService.cs: -------------------------------------------------------------------------------- 1 | using Hanssens.Net; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace HR.LeaveManagement.MVC.Contracts 8 | { 9 | public class LocalStorageService : ILocalStorageService 10 | { 11 | private LocalStorage _storage; 12 | 13 | public LocalStorageService() 14 | { 15 | var config = new LocalStorageConfiguration() 16 | { 17 | AutoLoad = true, 18 | AutoSave = true, 19 | Filename = "HR.LEAVEMGMT" 20 | }; 21 | _storage = new LocalStorage(config); 22 | } 23 | 24 | public void ClearStorage(List keys) 25 | { 26 | foreach (var key in keys) 27 | { 28 | _storage.Remove(key); 29 | } 30 | } 31 | 32 | public void SetStorageValue(string key, T value) 33 | { 34 | _storage.Store(key, value); 35 | _storage.Persist(); 36 | } 37 | 38 | public T GetStorageValue(string key) 39 | { 40 | return _storage.Get(key); 41 | } 42 | 43 | public bool Exists(string key) 44 | { 45 | return _storage.Exists(key); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Home/NotAuthorized.cshtml: -------------------------------------------------------------------------------- 1 | @* 2 | For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 3 | *@ 4 | @{ 5 | } 6 | 7 | 8 |

NOT AUTHORIZED

-------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/LeaveTypes/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model HR.LeaveManagement.MVC.Models.CreateLeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |

CreateLeaveTypeVM

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 | Back to List 34 |
35 | 36 | @section Scripts { 37 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 38 | } 39 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/LeaveTypes/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model HR.LeaveManagement.MVC.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

LeaveTypeVM

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Id) 15 |
16 |
17 | @Html.DisplayFor(model => model.Id) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.Name) 21 |
22 |
23 | @Html.DisplayFor(model => model.Name) 24 |
25 |
26 | @Html.DisplayNameFor(model => model.DefaultDays) 27 |
28 |
29 | @Html.DisplayFor(model => model.DefaultDays) 30 |
31 |
32 |
33 |
34 | @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | 35 | Back to List 36 |
37 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/LeaveTypes/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model HR.LeaveManagement.MVC.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |

LeaveTypeVM

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 | Back to List 39 |
40 | 41 | @section Scripts { 42 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 43 | } 44 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 34 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/Users/Login.cshtml: -------------------------------------------------------------------------------- 1 | @model HR.LeaveManagement.MVC.Models.LoginVM 2 | 3 | @{ 4 | ViewData["Title"] = "Login"; 5 | } 6 | 7 |

Login

8 | 9 |
10 |
11 |
12 |
13 | 14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 |
27 |
28 |
29 |
30 | 31 |
32 | Back to List 33 |
34 | 35 | @section Scripts { 36 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 37 | } 38 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using HR.LeaveManagement.MVC 2 | @using HR.LeaveManagement.MVC.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/HR.LeaveManagement.MVC/wwwroot/favicon.ico -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /HR.LeaveManagement.MVC/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/AuditableDbContext.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain.Common; 2 | using Microsoft.EntityFrameworkCore; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace HR.LeaveManagement.Persistence 10 | { 11 | public abstract class AuditableDbContext : DbContext 12 | { 13 | public AuditableDbContext(DbContextOptions options) : base(options) 14 | { 15 | } 16 | 17 | public virtual async Task SaveChangesAsync(string username = "SYSTEM") 18 | { 19 | foreach (var entry in base.ChangeTracker.Entries() 20 | .Where(q => q.State == EntityState.Added || q.State == EntityState.Modified)) 21 | { 22 | entry.Entity.LastModifiedDate = DateTime.Now; 23 | entry.Entity.LastModifiedBy = username; 24 | 25 | if (entry.State == EntityState.Added) 26 | { 27 | entry.Entity.DateCreated = DateTime.Now; 28 | entry.Entity.CreatedBy = username; 29 | } 30 | } 31 | 32 | var result = await base.SaveChangesAsync(); 33 | 34 | return result; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Configurations/Entities/LeaveAllocationConfiguration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Persistence.Configurations.Entities 9 | { 10 | public class LeaveAllocationConfiguration : IEntityTypeConfiguration 11 | { 12 | public void Configure(EntityTypeBuilder builder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Configurations/Entities/LeaveRequestConfiguration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Persistence.Configurations.Entities 9 | { 10 | public class LeaveRequestConfiguration : IEntityTypeConfiguration 11 | { 12 | public void Configure(EntityTypeBuilder builder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Configurations/Entities/LeaveTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace HR.LeaveManagement.Persistence.Configurations.Entities 9 | { 10 | public class LeaveTypeConfiguration : IEntityTypeConfiguration 11 | { 12 | public void Configure(EntityTypeBuilder builder) 13 | { 14 | builder.HasData( 15 | new LeaveType 16 | { 17 | Id = 1, 18 | DefaultDays = 10, 19 | Name = "Vacation" 20 | }, 21 | new LeaveType 22 | { 23 | Id = 2, 24 | DefaultDays = 12, 25 | Name = "Sick" 26 | } 27 | ); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/HR.LeaveManagement.Persistence.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/LeaveManagementDbContext.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Domain; 2 | using HR.LeaveManagement.Domain.Common; 3 | using Microsoft.EntityFrameworkCore; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace HR.LeaveManagement.Persistence 11 | { 12 | public class LeaveManagementDbContext : AuditableDbContext 13 | { 14 | public LeaveManagementDbContext(DbContextOptions options) 15 | : base(options) 16 | { 17 | } 18 | 19 | protected override void OnModelCreating(ModelBuilder modelBuilder) 20 | { 21 | modelBuilder.ApplyConfigurationsFromAssembly(typeof(LeaveManagementDbContext).Assembly); 22 | } 23 | 24 | public DbSet LeaveRequests { get; set; } 25 | public DbSet LeaveTypes { get; set; } 26 | public DbSet LeaveAllocations { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Migrations/20210729042528_SeedingLeaveTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace HR.LeaveManagement.Persistence.Migrations 5 | { 6 | public partial class SeedingLeaveTypes : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.InsertData( 11 | table: "LeaveTypes", 12 | columns: new[] { "Id", "CreatedBy", "DateCreated", "DefaultDays", "LastModifiedBy", "LastModifiedDate", "Name" }, 13 | values: new object[] { 1, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 10, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Vacation" }); 14 | 15 | migrationBuilder.InsertData( 16 | table: "LeaveTypes", 17 | columns: new[] { "Id", "CreatedBy", "DateCreated", "DefaultDays", "LastModifiedBy", "LastModifiedDate", "Name" }, 18 | values: new object[] { 2, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 12, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Sick" }); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DeleteData( 24 | table: "LeaveTypes", 25 | keyColumn: "Id", 26 | keyValue: 1); 27 | 28 | migrationBuilder.DeleteData( 29 | table: "LeaveTypes", 30 | keyColumn: "Id", 31 | keyValue: 2); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Migrations/20210805172833_AddedEmployeeIdToLeaveAllocation.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace HR.LeaveManagement.Persistence.Migrations 4 | { 5 | public partial class AddedEmployeeIdToLeaveAllocation : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "EmployeeId", 11 | table: "LeaveAllocations", 12 | type: "nvarchar(max)", 13 | nullable: true); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "EmployeeId", 20 | table: "LeaveAllocations"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Migrations/20210805190928_AddedEmployeeIdToLeaveRequest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace HR.LeaveManagement.Persistence.Migrations 4 | { 5 | public partial class AddedEmployeeIdToLeaveRequest : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "RequestingEmployeeId", 11 | table: "LeaveRequests", 12 | type: "nvarchar(max)", 13 | nullable: true); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "RequestingEmployeeId", 20 | table: "LeaveRequests"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/PersistenceServicesRegistration.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Persistence; 2 | using HR.LeaveManagement.Persistence.Repositories; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | 10 | namespace HR.LeaveManagement.Persistence 11 | { 12 | public static class PersistenceServicesRegistration 13 | { 14 | public static IServiceCollection ConfigurePersistenceServices(this IServiceCollection services, IConfiguration configuration) 15 | { 16 | services.AddDbContext(options => 17 | options.UseSqlServer( 18 | configuration.GetConnectionString("LeaveManagementConnectionString"))); 19 | 20 | 21 | services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>)); 22 | services.AddScoped(); 23 | 24 | services.AddScoped(); 25 | services.AddScoped(); 26 | services.AddScoped(); 27 | 28 | return services; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Repositories/GenericRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Persistence; 2 | using Microsoft.EntityFrameworkCore; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace HR.LeaveManagement.Persistence.Repositories 9 | { 10 | public class GenericRepository : IGenericRepository where T : class 11 | { 12 | private readonly LeaveManagementDbContext _dbContext; 13 | 14 | public GenericRepository(LeaveManagementDbContext dbContext) 15 | { 16 | _dbContext = dbContext; 17 | } 18 | 19 | public async Task Add(T entity) 20 | { 21 | await _dbContext.AddAsync(entity); 22 | return entity; 23 | } 24 | 25 | public async Task Delete(T entity) 26 | { 27 | _dbContext.Set().Remove(entity); 28 | } 29 | 30 | public async Task Exists(int id) 31 | { 32 | var entity = await Get(id); 33 | return entity != null; 34 | } 35 | 36 | public async Task Get(int id) 37 | { 38 | return await _dbContext.Set().FindAsync(id); 39 | } 40 | 41 | public async Task> GetAll() 42 | { 43 | return await _dbContext.Set().ToListAsync(); 44 | } 45 | 46 | public async Task Update(T entity) 47 | { 48 | _dbContext.Entry(entity).State = EntityState.Modified; 49 | } 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /HR.LeaveManagement.Persistence/Repositories/LeaveTypeRepository.cs: -------------------------------------------------------------------------------- 1 | using HR.LeaveManagement.Application.Contracts.Persistence; 2 | using HR.LeaveManagement.Domain; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace HR.LeaveManagement.Persistence.Repositories 8 | { 9 | public class LeaveTypeRepository : GenericRepository, ILeaveTypeRepository 10 | { 11 | private readonly LeaveManagementDbContext _dbContext; 12 | 13 | public LeaveTypeRepository(LeaveManagementDbContext dbContext) : base(dbContext) 14 | { 15 | _dbContext = dbContext; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/README.md: -------------------------------------------------------------------------------- 1 | # Core Leave Management 2 | .NET Core Leave Management Application for educational purposes: "Complete Core 3.1 and Entity Framework Development" 3 | Learn to how: 4 | - Build a fully data driven web application using cutting edge technology 5 | - Connect to a Database using Entity Framework Core 6 | - Repository and Unit Of Work Patterns and Dependency Injection 7 | - Understand how the MVC (Models, Views and Controllers) Pattern works 8 | - Understand C# and .Net Core Web Syntax 9 | - Understand user Authentication using ASP.NET Core Identity 10 | - Understand how to use Models, ViewModels and AutoMapper 11 | - Use Bootstrap to style and manipulate the overall layout 12 | - Manage Packages with NuGet Manager 13 | - Implement Website Layout using AdminLTE Theme 14 | - Setup GitHub for Source Control 15 | 16 | Website: [Trevoir Williams | Blog](http://bit.ly/2ux9hcn) 17 | 18 | # To Configure For Local Use 19 | - Clone Repository To Local Computer 20 | - Open Project in Visual Studio 21 | - Edit "DefaultConnection" to point to preferred database 22 | - Open Package Console Manager and run the command "Update-Database" 23 | - When completed, Run Website in Visual Studio to seed default Admin User 24 | - Login as admin user using: Username: admin@localhost.com | Password: P@ssword1 25 | 26 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - master 8 | 9 | pool: 10 | vmImage: 'windows-latest' 11 | 12 | variables: 13 | solution: '**/*.sln' 14 | buildPlatform: 'Any CPU' 15 | buildConfiguration: 'Release' 16 | 17 | steps: 18 | - task: NuGetToolInstaller@1 19 | 20 | - task: NuGetCommand@2 21 | inputs: 22 | restoreSolution: '$(solution)' 23 | 24 | - task: VSBuild@1 25 | inputs: 26 | solution: '$(solution)' 27 | msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"' 28 | platform: '$(buildPlatform)' 29 | configuration: '$(buildConfiguration)' 30 | 31 | - task: VSTest@2 32 | inputs: 33 | platform: '$(buildPlatform)' 34 | configuration: '$(buildConfiguration)' 35 | 36 | - task: PublishBuildArtifacts@1 -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29503.13 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leave-management", "leave-management\leave-management.csproj", "{DDE1EF93-E2A9-4331-8057-66D611330866}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DDE1EF93-E2A9-4331-8057-66D611330866}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DDE1EF93-E2A9-4331-8057-66D611330866}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DDE1EF93-E2A9-4331-8057-66D611330866}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DDE1EF93-E2A9-4331-8057-66D611330866}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {BECECF12-F412-4593-BCDD-1457905150BD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.3", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/IdentityHostingStartup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using leave_management.Data; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.AspNetCore.Identity; 5 | using Microsoft.AspNetCore.Identity.UI; 6 | using Microsoft.EntityFrameworkCore; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | 10 | [assembly: HostingStartup(typeof(leave_management.Areas.Identity.IdentityHostingStartup))] 11 | namespace leave_management.Areas.Identity 12 | { 13 | public class IdentityHostingStartup : IHostingStartup 14 | { 15 | public void Configure(IWebHostBuilder builder) 16 | { 17 | builder.ConfigureServices((context, services) => { 18 | }); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model AccessDeniedModel 3 | @{ 4 | ViewData["Title"] = "Access denied"; 5 | } 6 | 7 |
8 |

@ViewData["Title"]

9 |

You do not have access to this resource.

10 |
11 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/AccessDenied.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace leave_management.Areas.Identity.Pages.Account 8 | { 9 | public class AccessDeniedModel : PageModel 10 | { 11 | public void OnGet() 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ConfirmEmailModel 3 | @{ 4 | ViewData["Title"] = "Confirm email"; 5 | } 6 | 7 |

@ViewData["Title"]

8 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.AspNetCore.Mvc.RazorPages; 10 | using Microsoft.AspNetCore.WebUtilities; 11 | using leave_management.Data; 12 | 13 | namespace leave_management.Areas.Identity.Pages.Account 14 | { 15 | [AllowAnonymous] 16 | public class ConfirmEmailModel : PageModel 17 | { 18 | private readonly UserManager _userManager; 19 | 20 | public ConfirmEmailModel(UserManager userManager) 21 | { 22 | _userManager = userManager; 23 | } 24 | 25 | [TempData] 26 | public string StatusMessage { get; set; } 27 | 28 | public async Task OnGetAsync(string userId, string code) 29 | { 30 | if (userId == null || code == null) 31 | { 32 | return RedirectToPage("/Index"); 33 | } 34 | 35 | var user = await _userManager.FindByIdAsync(userId); 36 | if (user == null) 37 | { 38 | return NotFound($"Unable to load user with ID '{userId}'."); 39 | } 40 | 41 | code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); 42 | var result = await _userManager.ConfirmEmailAsync(user, code); 43 | StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email."; 44 | return Page(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ConfirmEmailChangeModel 3 | @{ 4 | ViewData["Title"] = "Confirm email change"; 5 | } 6 | 7 |

@ViewData["Title"]

8 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ExternalLogin.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ExternalLoginModel 3 | @{ 4 | ViewData["Title"] = "Register"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |

Associate your @Model.LoginProvider account.

9 |
10 | 11 |

12 | You've successfully authenticated with @Model.LoginProvider. 13 | Please enter an email address for this site below and click the Register button to finish 14 | logging in. 15 |

16 | 17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 |
26 | 27 |
28 |
29 |
30 | 31 | @section Scripts { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ForgotPasswordModel 3 | @{ 4 | ViewData["Title"] = "Forgot your password?"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |

Enter your email.

9 |
10 |
11 |
12 |
13 |
14 |
15 | 16 | 17 | 18 |
19 | 20 |
21 |
22 |
23 | 24 | @section Scripts { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ForgotPasswordConfirmation 3 | @{ 4 | ViewData["Title"] = "Forgot password confirmation"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |

9 | Please check your email to reset your password. 10 |

11 | 12 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Authorization; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace leave_management.Areas.Identity.Pages.Account 8 | { 9 | [AllowAnonymous] 10 | public class ForgotPasswordConfirmation : PageModel 11 | { 12 | public void OnGet() 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model LockoutModel 3 | @{ 4 | ViewData["Title"] = "Locked out"; 5 | } 6 | 7 |
8 |

@ViewData["Title"]

9 |

This account has been locked out, please try again later.

10 |
11 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Lockout.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace leave_management.Areas.Identity.Pages.Account 9 | { 10 | [AllowAnonymous] 11 | public class LockoutModel : PageModel 12 | { 13 | public void OnGet() 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model LoginWithRecoveryCodeModel 3 | @{ 4 | ViewData["Title"] = "Recovery code verification"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |
9 |

10 | You have requested to log in with a recovery code. This login will not be remembered until you provide 11 | an authenticator app code at log in or disable 2FA and log in again. 12 |

13 |
14 |
15 |
16 |
17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 |
25 |
26 | 27 | @section Scripts { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model LogoutModel 3 | @{ 4 | ViewData["Title"] = "Log out"; 5 | } 6 | 7 |
8 |

@ViewData["Title"]

9 |

You have successfully logged out of the application.

10 |
-------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Logout.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Identity; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.AspNetCore.Mvc.RazorPages; 9 | using Microsoft.Extensions.Logging; 10 | using leave_management.Data; 11 | 12 | namespace leave_management.Areas.Identity.Pages.Account 13 | { 14 | [AllowAnonymous] 15 | public class LogoutModel : PageModel 16 | { 17 | private readonly SignInManager _signInManager; 18 | private readonly ILogger _logger; 19 | 20 | public LogoutModel(SignInManager signInManager, ILogger logger) 21 | { 22 | _signInManager = signInManager; 23 | _logger = logger; 24 | } 25 | 26 | public void OnGet() 27 | { 28 | } 29 | 30 | public async Task OnPost(string returnUrl = null) 31 | { 32 | await _signInManager.SignOutAsync(); 33 | _logger.LogInformation("User logged out."); 34 | if (returnUrl != null) 35 | { 36 | return LocalRedirect(returnUrl); 37 | } 38 | else 39 | { 40 | return RedirectToPage(); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ChangePasswordModel 3 | @{ 4 | ViewData["Title"] = "Change password"; 5 | ViewData["ActivePage"] = ManageNavPages.ChangePassword; 6 | } 7 | 8 |

@ViewData["Title"]

9 | 10 |
11 |
12 |
13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 |
32 |
33 | 34 | @section Scripts { 35 | 36 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DeletePersonalDataModel 3 | @{ 4 | ViewData["Title"] = "Delete Personal Data"; 5 | ViewData["ActivePage"] = ManageNavPages.PersonalData; 6 | } 7 | 8 |

@ViewData["Title"]

9 | 10 | 15 | 16 |
17 |
18 |
19 | @if (Model.RequirePassword) 20 | { 21 |
22 | 23 | 24 | 25 |
26 | } 27 | 28 |
29 |
30 | 31 | @section Scripts { 32 | 33 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/Disable2fa.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Disable2faModel 3 | @{ 4 | ViewData["Title"] = "Disable two-factor authentication (2FA)"; 5 | ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication; 6 | } 7 | 8 | 9 |

@ViewData["Title"]

10 | 11 | 20 | 21 |
22 |
23 | 24 |
25 |
26 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/DownloadPersonalData.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DownloadPersonalDataModel 3 | @{ 4 | ViewData["Title"] = "Download Your Data"; 5 | ViewData["ActivePage"] = ManageNavPages.PersonalData; 6 | } 7 | 8 |

@ViewData["Title"]

9 | 10 | @section Scripts { 11 | 12 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/GenerateRecoveryCodes.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model GenerateRecoveryCodesModel 3 | @{ 4 | ViewData["Title"] = "Generate two-factor authentication (2FA) recovery codes"; 5 | ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication; 6 | } 7 | 8 | 9 |

@ViewData["Title"]

10 | 23 |
24 |
25 | 26 |
27 |
-------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Profile"; 5 | ViewData["ActivePage"] = ManageNavPages.Index; 6 | } 7 | 8 |

@ViewData["Title"]

9 | 10 |
11 |
12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 | 20 | 21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 | @section Scripts { 29 | 30 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/PersonalData.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PersonalDataModel 3 | @{ 4 | ViewData["Title"] = "Personal Data"; 5 | ViewData["ActivePage"] = ManageNavPages.PersonalData; 6 | } 7 | 8 |

@ViewData["Title"]

9 | 10 |
11 |
12 |

Your account contains personal data that you have given us. This page allows you to download or delete that data.

13 |

14 | Deleting this data will permanently remove your account, and this cannot be recovered. 15 |

16 |
17 | 18 |
19 |

20 | Delete 21 |

22 |
23 |
24 | 25 | @section Scripts { 26 | 27 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/PersonalData.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Identity; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | using Microsoft.Extensions.Logging; 6 | using leave_management.Data; 7 | 8 | namespace leave_management.Areas.Identity.Pages.Account.Manage 9 | { 10 | public class PersonalDataModel : PageModel 11 | { 12 | private readonly UserManager _userManager; 13 | private readonly ILogger _logger; 14 | 15 | public PersonalDataModel( 16 | UserManager userManager, 17 | ILogger logger) 18 | { 19 | _userManager = userManager; 20 | _logger = logger; 21 | } 22 | 23 | public async Task OnGet() 24 | { 25 | var user = await _userManager.GetUserAsync(User); 26 | if (user == null) 27 | { 28 | return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); 29 | } 30 | 31 | return Page(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/ResetAuthenticator.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ResetAuthenticatorModel 3 | @{ 4 | ViewData["Title"] = "Reset authenticator key"; 5 | ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication; 6 | } 7 | 8 | 9 |

@ViewData["Title"]

10 | 20 |
21 |
22 | 23 |
24 |
-------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SetPasswordModel 3 | @{ 4 | ViewData["Title"] = "Set password"; 5 | ViewData["ActivePage"] = ManageNavPages.ChangePassword; 6 | } 7 | 8 |

Set your password

9 | 10 |

11 | You do not have a local username/password for this site. Add a local 12 | account so you can log in without an external login. 13 |

14 |
15 |
16 |
17 |
18 |
19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 |
31 |
32 | 33 | @section Scripts { 34 | 35 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/ShowRecoveryCodes.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ShowRecoveryCodesModel 3 | @{ 4 | ViewData["Title"] = "Recovery codes"; 5 | ViewData["ActivePage"] = "TwoFactorAuthentication"; 6 | } 7 | 8 | 9 |

@ViewData["Title"]

10 | 18 |
19 |
20 | @for (var row = 0; row < Model.RecoveryCodes.Length; row += 2) 21 | { 22 | @Model.RecoveryCodes[row] @Model.RecoveryCodes[row + 1]
23 | } 24 |
25 |
-------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/ShowRecoveryCodes.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace leave_management.Areas.Identity.Pages.Account.Manage 11 | { 12 | public class ShowRecoveryCodesModel : PageModel 13 | { 14 | [TempData] 15 | public string[] RecoveryCodes { get; set; } 16 | 17 | [TempData] 18 | public string StatusMessage { get; set; } 19 | 20 | public IActionResult OnGet() 21 | { 22 | if (RecoveryCodes == null || RecoveryCodes.Length == 0) 23 | { 24 | return RedirectToPage("./TwoFactorAuthentication"); 25 | } 26 | 27 | return Page(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Areas/Identity/Pages/_Layout.cshtml"; 3 | } 4 | 5 |

Manage your account

6 | 7 |
8 |

Change your account settings

9 |
10 |
11 |
12 | 13 |
14 |
15 | @RenderBody() 16 |
17 |
18 |
19 | 20 | @section Scripts { 21 | @RenderSection("Scripts", required: false) 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml: -------------------------------------------------------------------------------- 1 | @using leave_management.Data 2 | @inject SignInManager SignInManager 3 | @{ 4 | var hasExternalLogins = (await SignInManager.GetExternalAuthenticationSchemesAsync()).Any(); 5 | } 6 | 17 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/_StatusMessage.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | @if (!String.IsNullOrEmpty(Model)) 4 | { 5 | var statusMessageClass = Model.StartsWith("Error") ? "danger" : "success"; 6 | 10 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using leave_management.Areas.Identity.Pages.Account.Manage 2 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/RegisterConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model RegisterConfirmationModel 3 | @{ 4 | ViewData["Title"] = "Register confirmation"; 5 | } 6 | 7 |

@ViewData["Title"]

8 | @{ 9 | if (@Model.DisplayConfirmAccountLink) 10 | { 11 |

12 | This app does not currently have a real email sender registered, see these docs for how to configure a real email sender. 13 | Normally this would be emailed: Click here to confirm your account 14 |

15 | } 16 | else 17 | { 18 |

19 | Please check your email to confirm your account. 20 |

21 | } 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ResetPasswordModel 3 | @{ 4 | ViewData["Title"] = "Reset password"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |

Reset your password.

9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 |
33 |
34 | 35 | @section Scripts { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ResetPasswordConfirmationModel 3 | @{ 4 | ViewData["Title"] = "Reset password confirmation"; 5 | } 6 | 7 |

@ViewData["Title"]

8 |

9 | Your password has been reset. Please click here to log in. 10 |

11 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/ResetPasswordConfirmation.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace leave_management.Areas.Identity.Pages.Account 9 | { 10 | [AllowAnonymous] 11 | public class ResetPasswordConfirmationModel : PageModel 12 | { 13 | public void OnGet() 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/_StatusMessage.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | @if (!String.IsNullOrEmpty(Model)) 4 | { 5 | var statusMessageClass = Model.StartsWith("Error") ? "danger" : "success"; 6 | 10 | } 11 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Account/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using leave_management.Areas.Identity.Pages.Account -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to Development environment will display more detailed information about the error that occurred. 20 |

21 |

22 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 23 |

24 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Microsoft.AspNetCore.Authorization; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | 6 | namespace leave_management.Areas.Identity.Pages 7 | { 8 | [AllowAnonymous] 9 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 10 | public class ErrorModel : PageModel 11 | { 12 | public string RequestId { get; set; } 13 | 14 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 15 | 16 | public void OnGet() 17 | { 18 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using leave_management.Areas.Identity 3 | @using leave_management.Areas.Identity.Pages 4 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 5 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Areas/Identity/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Views/Shared/_AdminLTE.cshtml"; 3 | //Layout = "/Views/Shared/_Layout.cshtml"; 4 | } 5 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/IGenericRepository.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Query; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Contracts 9 | { 10 | public interface IGenericRepository where T : class 11 | { 12 | Task> FindAll( 13 | Expression> expression = null, 14 | Func, IOrderedQueryable> orderBy = null, 15 | Func, IIncludableQueryable> includes = null 16 | ); 17 | Task Find(Expression> expression, Func, IIncludableQueryable> includes = null); 18 | Task isExists(Expression> expression = null); 19 | Task Create(T entity); 20 | void Update(T entity); 21 | void Delete(T entity); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/ILeaveAllocationRepository.cs: -------------------------------------------------------------------------------- 1 | using leave_management.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Contracts 8 | { 9 | public interface ILeaveAllocationRepository : IRepositoryBase 10 | { 11 | Task CheckAllocation(int leavetypeid, string employeeid); 12 | Task> GetLeaveAllocationsByEmployee(string employeeid); 13 | Task GetLeaveAllocationsByEmployeeAndType(string employeeid, int leavetypeid); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/ILeaveRequestRepository.cs: -------------------------------------------------------------------------------- 1 | using leave_management.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Contracts 8 | { 9 | public interface ILeaveRequestRepository : IRepositoryBase 10 | { 11 | Task> GetLeaveRequestsByEmployee(string employeeid); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/ILeaveTypeRepository.cs: -------------------------------------------------------------------------------- 1 | using leave_management.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Contracts 8 | { 9 | public interface ILeaveTypeRepository : IRepositoryBase 10 | { 11 | Task> GetEmployeesByLeaveType(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/IRepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Query; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Contracts 9 | { 10 | public interface IRepositoryBase where T : class 11 | { 12 | Task> FindAll(); 13 | Task FindById(int id); 14 | Task isExists(int id); 15 | Task Create(T entity); 16 | Task Update(T entity); 17 | Task Delete(T entity); 18 | Task Save(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Contracts/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using leave_management.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Contracts 8 | { 9 | public interface IUnitOfWork : IDisposable 10 | { 11 | IGenericRepository LeaveTypes { get; } 12 | IGenericRepository LeaveRequests { get; } 13 | IGenericRepository LeaveAllocations { get; } 14 | Task Save(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Logging; 8 | using leave_management.Models; 9 | using Microsoft.AspNetCore.Authorization; 10 | 11 | namespace leave_management.Controllers 12 | { 13 | [Authorize] 14 | public class HomeController : Controller 15 | { 16 | private readonly ILogger _logger; 17 | 18 | public HomeController(ILogger logger) 19 | { 20 | _logger = logger; 21 | } 22 | 23 | public IActionResult Index() 24 | { 25 | return View(); 26 | } 27 | 28 | public IActionResult Privacy() 29 | { 30 | return View(); 31 | } 32 | 33 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 34 | public IActionResult Error() 35 | { 36 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore; 6 | using leave_management.Models; 7 | 8 | namespace leave_management.Data 9 | { 10 | public class ApplicationDbContext : IdentityDbContext 11 | { 12 | public ApplicationDbContext(DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | public DbSet Employees { get; set; } 18 | public DbSet LeaveRequests { get; set; } 19 | public DbSet LeaveTypes { get; set; } 20 | public DbSet LeaveAllocations { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Data/Employee.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Data 8 | { 9 | public class Employee : IdentityUser 10 | { 11 | public string Firstname { get; set; } 12 | public string Lastname { get; set; } 13 | public string TaxId { get; set; } 14 | public DateTime DateOfBirth { get; set; } 15 | public DateTime DateJoined { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Data/LeaveAllocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Data 9 | { 10 | public class LeaveAllocation 11 | { 12 | [Key] 13 | public int Id { get; set; } 14 | public int NumberOfDays { get; set; } 15 | public DateTime DateCreated { get; set; } 16 | [ForeignKey("EmployeeId")] 17 | public Employee Employee { get; set; } 18 | public string EmployeeId { get; set; } 19 | [ForeignKey("LeaveTypeId")] 20 | public LeaveType LeaveType { get; set; } 21 | public int LeaveTypeId { get; set; } 22 | public int Period { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Data/LeaveRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Data 9 | { 10 | public class LeaveRequest 11 | { 12 | [Key] 13 | public int Id { get; set; } 14 | [ForeignKey("RequestingEmployeeId")] 15 | public Employee RequestingEmployee { get; set; } 16 | public string RequestingEmployeeId { get; set; } 17 | public DateTime StartDate { get; set; } 18 | public DateTime EndDate { get; set; } 19 | [ForeignKey("LeaveTypeId")] 20 | public LeaveType LeaveType { get; set; } 21 | public int LeaveTypeId { get; set; } 22 | public DateTime DateRequested { get; set; } 23 | public string RequestComments { get; set; } 24 | public DateTime DateActioned { get; set; } 25 | public bool? Approved { get; set; } 26 | public bool Cancelled { get; set; } 27 | [ForeignKey("ApprovedById")] 28 | public Employee ApprovedBy { get; set; } 29 | public string ApprovedById { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Data/LeaveType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Data 8 | { 9 | public class LeaveType 10 | { 11 | [Key] 12 | public int Id { get; set; } 13 | public string Name { get; set; } 14 | public int DefaultDays { get; set; } 15 | public DateTime DateCreated { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Mappings/Maps.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using leave_management.Data; 3 | using leave_management.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace leave_management.Mappings 10 | { 11 | public class Maps : Profile 12 | { 13 | public Maps() 14 | { 15 | CreateMap().ReverseMap(); 16 | CreateMap().ReverseMap(); 17 | CreateMap().ReverseMap(); 18 | CreateMap().ReverseMap(); 19 | CreateMap().ReverseMap(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Models/EmployeeVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Models 8 | { 9 | public class EmployeeVM 10 | { 11 | public string Id { get; set; } 12 | [Display(Name="Username")] 13 | public string UserName { get; set; } 14 | [Display(Name = "Email Address")] 15 | public string Email { get; set; } 16 | [Display(Name = "Phone Number")] 17 | public string PhoneNumber { get; set; } 18 | [Display(Name = "First Name")] 19 | public string Firstname { get; set; } 20 | [Display(Name = "Last Name")] 21 | public string Lastname { get; set; } 22 | [Display(Name = "Tax ID Number")] 23 | public string TaxId { get; set; } 24 | [Display(Name = "Date Of Birth")] 25 | public DateTime DateOfBirth { get; set; } 26 | [Display(Name = "Join Date")] 27 | public DateTime DateJoined { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace leave_management.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Models/LeaveAllocationVM.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Rendering; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Models 9 | { 10 | public class LeaveAllocationVM 11 | { 12 | public int Id { get; set; } 13 | [Display(Name = "Number Of Days")] 14 | 15 | public int NumberOfDays { get; set; } 16 | public DateTime DateCreated { get; set; } 17 | public int Period { get; set; } 18 | 19 | public EmployeeVM Employee { get; set; } 20 | public string EmployeeId { get; set; } 21 | 22 | public LeaveTypeVM LeaveType { get; set; } 23 | public int LeaveTypeId { get; set; } 24 | } 25 | 26 | public class CreateLeaveAllocationVM 27 | { 28 | public int NumberUpdated { get; set; } 29 | public List LeaveTypes { get; set; } 30 | } 31 | 32 | public class EditLeaveAllocationVM 33 | { 34 | public int Id { get; set; } 35 | 36 | public EmployeeVM Employee { get; set; } 37 | public string EmployeeId { get; set; } 38 | [Display(Name="Number Of Days")] 39 | [Range(1,50, ErrorMessage = "Enter Valid Number")] 40 | public int NumberOfDays { get; set; } 41 | public LeaveTypeVM LeaveType { get; set; } 42 | 43 | } 44 | 45 | public class ViewAllocationsVM 46 | { 47 | public EmployeeVM Employee { get; set; } 48 | public string EmployeeId { get; set; } 49 | public List LeaveAllocations { get; set; } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Models/LeaveTypeVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace leave_management.Models 8 | { 9 | public class LeaveTypeVM 10 | { 11 | public int Id { get; set; } 12 | [Required] 13 | public string Name { get; set; } 14 | [Required] 15 | [Display(Name = "Default Number Of Days")] 16 | [Range(1,25, ErrorMessage = "Please Enter A Valid Number")] 17 | public int DefaultDays { get; set; } 18 | [Display(Name="Date Created")] 19 | public DateTime? DateCreated { get; set; } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace leave_management 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:55442", 7 | "sslPort": 44337 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "leave_management": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Repository/UnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using leave_management.Contracts; 2 | using leave_management.Data; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace leave_management.Repository 9 | { 10 | public class UnitOfWork : IUnitOfWork 11 | { 12 | private readonly ApplicationDbContext _context; 13 | private IGenericRepository _leaveTypes; 14 | private IGenericRepository _leaveRequests; 15 | private IGenericRepository _leaveAllocations; 16 | 17 | public UnitOfWork(ApplicationDbContext context) 18 | { 19 | _context = context; 20 | } 21 | 22 | public IGenericRepository LeaveTypes 23 | => _leaveTypes ??= new GenericRepository(_context); 24 | 25 | public IGenericRepository LeaveRequests 26 | => _leaveRequests ??= new GenericRepository(_context); 27 | public IGenericRepository LeaveAllocations 28 | => _leaveAllocations ??= new GenericRepository(_context); 29 | 30 | public void Dispose() 31 | { 32 | Dispose(true); 33 | GC.SuppressFinalize(this); 34 | } 35 | 36 | private void Dispose(bool dispose) 37 | { 38 | if(dispose) 39 | { 40 | _context.Dispose(); 41 | } 42 | } 43 | 44 | public async Task Save() 45 | { 46 | await _context.SaveChangesAsync(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Services/EmailSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace leave_management.Services 7 | { 8 | public class EmailSettings 9 | { 10 | public bool UseSsl { get; set; } 11 | public string MailServer { get; set; } 12 | public int MailPort { get; set; } 13 | public string SenderEmail { get; set; } 14 | public string SenderName { get; set; } 15 | public string Password { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Leave Management System with ASP.NET Core 3.1

7 |
8 |
9 |
Learn about:
10 |
    11 |
  • 12 |

    .NET Core 3.1

    13 |
  • 14 |
  • 15 |

    ViewModels and AutoMapper

    16 |
  • 17 |
  • 18 |

    Entity Framework, Code First

    19 |
  • 20 |
  • 21 |

    Dependency Injection

    22 |
  • 23 |
  • 24 |

    Repository Pattern

    25 |
  • 26 |
  • 27 |

    Identity and Authentication

    28 |
  • 29 |
  • 30 |

    Bootstrap 4 and AdminLTE

    31 |
  • 32 |
  • 33 |

    Client and Server Side Validation

    34 |
  • 35 |
  • 36 |

    Linq Queries and Lambda Expressions

    37 |
  • 38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveAllocation/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.EditLeaveAllocationVM 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Editing @Model.LeaveType.Name Allocation for @Model.Employee.Lastname, @Model.Employee.Firstname

8 | 9 | 10 |
11 |
12 |
13 |
14 |
15 | 16 | 17 |
18 | 19 | 20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 | Back to Details 31 |
32 | 33 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveAllocation/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.CreateLeaveAllocationVM 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | @foreach (var item in Model.LeaveTypes) { 23 | 24 | 25 | 28 | 29 | 35 | 36 | } 37 | 38 |
15 | Leave Types 16 | Action
26 | @Html.DisplayFor(modelItem => item.Name) 27 | 30 | @*@Html.ActionLink("Allocate To Employees", "SetLeave", new { id=item.Id }, new { @class = "btn btn-success" })*@ 31 | 32 | Allocate To Employees 33 | 34 |
39 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveAllocation/ListEmployees.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "List Employees"; 5 | } 6 | 7 |

List Employees

8 | 9 | 10 | 11 | 12 | 13 | 16 | 19 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model) { 27 | 28 | 31 | 34 | 37 | 44 | 45 | } 46 | 47 |
14 | @Html.DisplayNameFor(model => model.Firstname) 15 | 17 | @Html.DisplayNameFor(model => model.Lastname) 18 | 20 | @Html.DisplayNameFor(model => model.Email) 21 |
29 | @Html.DisplayFor(modelItem => item.Firstname) 30 | 32 | @Html.DisplayFor(modelItem => item.Lastname) 33 | 35 | @Html.DisplayFor(modelItem => item.Email) 36 | 38 | 39 | Details 40 | 41 | @*@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ })*@ 42 | 43 |
48 | 49 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveTypes/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 | 10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | Back to List 27 |
28 |
29 |
30 |
31 | 32 | @section Scripts { 33 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 34 | } 35 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveTypes/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Delete

9 | 10 |

Are you sure you want to delete this?

11 |
12 | 13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.Name) 17 |
18 |
19 | @Html.DisplayFor(model => model.Name) 20 |
21 |
22 | @Html.DisplayNameFor(model => model.DateCreated) 23 |
24 |
25 | @Html.DisplayFor(model => model.DateCreated) 26 |
27 |
28 | 29 |
30 | 31 | | 32 | Back to List 33 |
34 |
35 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveTypes/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 | 11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 |
17 | @Html.DisplayFor(model => model.Name) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.DefaultDays) 21 |
22 |
23 | @Html.DisplayFor(model => model.DefaultDays) 24 |
25 |
26 | @Html.DisplayNameFor(model => model.DateCreated) 27 |
28 |
29 | @Html.DisplayFor(model => model.DateCreated) 30 |
31 |
32 |
33 |
34 | Edit Back to List 35 |
36 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/LeaveTypes/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model leave_management.Models.LeaveTypeVM 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Edit

9 | 10 | 11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 | Back to List 30 |
31 |
32 |
33 |
34 | 35 | 36 | @section Scripts { 37 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 38 | } 39 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using leave_management.Data 3 | @inject SignInManager SignInManager 4 | @inject UserManager UserManager 5 | 6 | 42 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using leave_management 2 | @using leave_management.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_AdminLTE"; 3 | //Layout = "_Layout"; 4 | } 5 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=leave_management;Trusted_Connection=True;MultipleActiveResultSets=true", 4 | "AzureConnection": "Server=tcp:sqlserver-trev.database.windows.net,1433;Initial Catalog=leave_management;Persist Security Info=False;User ID=trevoir;Password=P@ssword1;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" 5 | }, 6 | "Logging": { 7 | "LogLevel": { 8 | "Default": "Information", 9 | "Microsoft": "Warning", 10 | "Microsoft.Hosting.Lifetime": "Information" 11 | } 12 | }, 13 | "EmailSettings": { 14 | "UseSsl": true, 15 | "MailServer": "smtp.gmail.com", 16 | "MailPort": 465, 17 | "SenderName": "Leave Management System", 18 | "SenderEmail": "noreply@leavemanagement.com", 19 | "Password": "etiurvxqsqgwvaij" 20 | }, 21 | "AllowedHosts": "*" 22 | } 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/leave-management.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | aspnet-leave_management-A0B9C012-D643-48A8-944B-40E4BE0E03D4 6 | leave_management 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | all 22 | runtime; build; native; contentfiles; analyzers; buildtransitive 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/favicon.ico -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | $(document).ready(function () { 6 | $('#tblData').DataTable(); 7 | }); -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/ASP.NET-Core---SOLID-and-Clean-Architecture-.NET-5-and-up-/2fa5d5fb5ae65de6f520356604adeda43d7c342b/leave-management-dotnetcore-master/leave-management/wwwroot/webfonts/fa-solid-900.woff2 --------------------------------------------------------------------------------