├── wwwroot ├── css │ ├── custom.css │ └── site.css ├── favicon.ico ├── img │ ├── avatar.png │ ├── meeting.jpg │ ├── company-1.png │ ├── featured1.jpg │ └── logo-small.png ├── vendor │ ├── owl.carousel │ │ └── assets │ │ │ ├── owl.video.play.png │ │ │ ├── owl.theme.default.css │ │ │ └── owl.carousel.css │ ├── jquery.cookie │ │ └── jquery.cookie.js │ └── bootstrap-select │ │ └── css │ │ └── bootstrap-select.min.css ├── js │ ├── site.js │ └── front.js └── lib │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ └── LICENSE.md │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ └── css │ │ ├── bootstrap-reboot.min.css │ │ └── bootstrap-reboot.css │ └── jquery │ └── LICENSE.txt ├── Views ├── _ViewStart.cshtml ├── _ViewImports.cshtml ├── Home │ ├── Privacy.cshtml │ ├── Search.cshtml │ ├── JobDetails.cshtml │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── _CookieConsentPartial.cshtml │ ├── _ValidationScriptsPartial.cshtml │ └── _Layout.cshtml ├── Account │ ├── Login.cshtml │ ├── EmployeeRegister.cshtml │ ├── EmployerRegister.cshtml │ └── EditProfile.cshtml ├── Dashboard │ ├── ApplicantsByJob.cshtml │ ├── Applicants.cshtml │ └── Index.cshtml └── Job │ ├── Index.cshtml │ └── Create.cshtml ├── screenshots ├── one.png ├── three.png └── two.png ├── appsettings.Development.json ├── Models ├── ErrorViewModel.cs ├── Applicant.cs ├── ApplicationDbContext.cs ├── User.cs └── Job.cs ├── appsettings.json ├── ViewModels ├── JobApplicantsViewModel.cs ├── Home │ ├── JobDetailsViewModel.cs │ └── TrendingJobViewModel.cs ├── RegisterViewModel.cs ├── LoginViewModel.cs ├── EmployerRegisterViewModel.cs └── EmployeeRegisterViewModel.cs ├── Migrations ├── 20190913055118_Update Job.cs ├── 20190916190755_UpdateUser.cs ├── 20190912083400_InitialCreate.cs ├── 20190912185036_JobModel.cs ├── 20190914054745_Applicant Model.cs ├── 20190912083400_InitialCreate.Designer.cs ├── 20190912185036_JobModel.Designer.cs └── 20190913055118_Update Job.Designer.cs ├── README.md ├── Properties └── launchSettings.json ├── Program.cs ├── LICENSE ├── JobPortal.csproj ├── JobPortal.sln ├── .vscode ├── tasks.json └── launch.json ├── Helpers └── HtmlHelperExtensions.cs ├── Controllers ├── DashboardController.cs ├── HomeController.cs ├── JobController.cs └── AccountController.cs ├── .gitattributes ├── Startup.cs └── .gitignore /wwwroot/css/custom.css: -------------------------------------------------------------------------------- 1 | /* your styles go here */ -------------------------------------------------------------------------------- /Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /screenshots/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/screenshots/one.png -------------------------------------------------------------------------------- /screenshots/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/screenshots/three.png -------------------------------------------------------------------------------- /screenshots/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/screenshots/two.png -------------------------------------------------------------------------------- /wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/favicon.ico -------------------------------------------------------------------------------- /wwwroot/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/img/avatar.png -------------------------------------------------------------------------------- /wwwroot/img/meeting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/img/meeting.jpg -------------------------------------------------------------------------------- /wwwroot/img/company-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/img/company-1.png -------------------------------------------------------------------------------- /wwwroot/img/featured1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/img/featured1.jpg -------------------------------------------------------------------------------- /wwwroot/img/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/img/logo-small.png -------------------------------------------------------------------------------- /Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using JobPortal 2 | @using JobPortal.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /wwwroot/vendor/owl.carousel/assets/owl.video.play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manjurulhoque/asp-core-simple-job-portal/HEAD/wwwroot/vendor/owl.carousel/assets/owl.video.play.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace JobPortal.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=asp_job_portal;Uid=root;Pwd=" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ViewModels/JobApplicantsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JobPortal.Models; 3 | 4 | namespace JobPortal.ViewModels 5 | { 6 | public class JobApplicantsViewModel 7 | { 8 | public Job Job { get; set; } 9 | 10 | public List Applicants { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /ViewModels/Home/JobDetailsViewModel.cs: -------------------------------------------------------------------------------- 1 | using JobPortal.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace JobPortal.ViewModels.Home 8 | { 9 | public class JobDetailsViewModel 10 | { 11 | public Job Job { get; set; } 12 | public bool IsApplied { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ViewModels/Home/TrendingJobViewModel.cs: -------------------------------------------------------------------------------- 1 | using JobPortal.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace JobPortal.ViewModels.Home 8 | { 9 | public class TrendingJobViewModel 10 | { 11 | public List Jobs { get; set; } 12 | public List Trendings { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Models/Applicant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace JobPortal.Models 7 | { 8 | public class Applicant 9 | { 10 | public int Id { get; set; } 11 | public User User { get; set; } 12 | public Job Job { get; set; } 13 | public DateTime CreatedAt { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Migrations/20190913055118_Update Job.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace JobPortal.Migrations 4 | { 5 | public partial class UpdateJob : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | 10 | } 11 | 12 | protected override void Down(MigrationBuilder migrationBuilder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Asp .NET Core Job Portal 2 | 3 | #### An open source online job portal. 4 | 5 | Used Tech Stack 6 | 7 | 1. Asp .NET Core 8 | 2. MySql 9 | 10 | ### Screenshots 11 | 12 | ## Home page 13 | 14 | 15 | ## Add new position as employer 16 | 17 | 18 | ## Job details 19 | 20 | 21 | Show your support by 🌟 the project!! -------------------------------------------------------------------------------- /Models/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace JobPortal.Models 5 | { 6 | public class ApplicationDbContext : IdentityDbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) : base(options) 9 | { 10 | Database.EnsureCreated(); 11 | } 12 | 13 | public DbSet Jobs { get; set; } 14 | public DbSet Applicants { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Models/User.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 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 JobPortal.Models 9 | { 10 | public class User : IdentityUser 11 | { 12 | [MaxLength(20)] 13 | public string FirstName { get; set; } 14 | [MaxLength(60)] 15 | public string LastName { get; set; } 16 | [MaxLength(10)] 17 | public string Gender { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ViewModels/RegisterViewModel.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 JobPortal.ViewModels 8 | { 9 | public class RegisterViewModel 10 | { 11 | [Required, MaxLength(256)] 12 | public string Username { get; set; } 13 | 14 | [Required, DataType(DataType.Password)] 15 | public string Password { get; set; } 16 | 17 | [DataType(DataType.Password), Compare(nameof(Password))] 18 | public string ConfirmPassword { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ViewModels/LoginViewModel.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 JobPortal.ViewModels 8 | { 9 | public class LoginViewModel 10 | { 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [DataType(DataType.Password)] 16 | public string Password { get; set; } 17 | 18 | [Display(Name = "Remember Me?")] 19 | public bool RememberMe { get; set; } 20 | public string ReturnUrl { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:25626", 7 | "sslPort": 44389 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "JobPortal": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ViewModels/EmployerRegisterViewModel.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 JobPortal.ViewModels 8 | { 9 | public class EmployerRegisterViewModel 10 | { 11 | [MaxLength(60)] 12 | public string UserName { get; set; } 13 | 14 | [Required, MaxLength(20)] 15 | public string FirstName { get; set; } 16 | 17 | [Required, MaxLength(60)] 18 | public string LastName { get; set; } 19 | 20 | [Required, MaxLength(60)] 21 | [EmailAddress] 22 | public string Email { get; set; } 23 | 24 | [Required, DataType(DataType.Password)] 25 | public string Password { get; set; } 26 | 27 | [DataType(DataType.Password), Compare(nameof(Password))] 28 | public string ConfirmPassword { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Migrations/20190916190755_UpdateUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace JobPortal.Migrations 4 | { 5 | public partial class UpdateUser : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "Gender", 11 | table: "AspNetUsers", 12 | maxLength: 10, 13 | nullable: true, 14 | oldClrType: typeof(string), 15 | oldMaxLength: 10); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.AlterColumn( 21 | name: "Gender", 22 | table: "AspNetUsers", 23 | maxLength: 10, 24 | nullable: false, 25 | oldClrType: typeof(string), 26 | oldMaxLength: 10, 27 | oldNullable: true); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace JobPortal 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | //.ConfigureLogging(logging => 24 | //{ 25 | // // clear default logging providers 26 | // logging.ClearProviders(); 27 | 28 | // // add built-in providers manually, as needed 29 | // logging.AddConsole(); 30 | // logging.AddDebug(); 31 | //}); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Manjurul Hoque Rumi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /JobPortal.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /JobPortal.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29306.81 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JobPortal", "JobPortal.csproj", "{D6CC26CD-E6C1-47E1-8ADA-87EB11AEB991}" 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 | {D6CC26CD-E6C1-47E1-8ADA-87EB11AEB991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D6CC26CD-E6C1-47E1-8ADA-87EB11AEB991}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D6CC26CD-E6C1-47E1-8ADA-87EB11AEB991}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D6CC26CD-E6C1-47E1-8ADA-87EB11AEB991}.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 = {73F3E32B-6EC4-4979-974F-4BF048249A76} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ViewModels/EmployeeRegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace JobPortal.ViewModels 9 | { 10 | public class EmployeeRegisterViewModel 11 | { 12 | [MaxLength(60), Display(Name = "User Name", Prompt = "User Name")] 13 | public string UserName { get; set; } 14 | 15 | [Required, MaxLength(20), Display(Name = "First Name", Prompt = "First Name")] 16 | public string FirstName { get; set; } 17 | 18 | [Required, MaxLength(60), Display(Name = "Last Name", Prompt = "Last Name")] 19 | public string LastName { get; set; } 20 | 21 | [Required, MaxLength(60), Display(Name = "Email", Prompt = "Email")] 22 | [EmailAddress] 23 | public string Email { get; set; } 24 | 25 | [Required, DataType(DataType.Password), Display(Name = "Password", Prompt = "Password")] 26 | public string Password { get; set; } 27 | 28 | [DataType(DataType.Password), Compare(nameof(Password)), Display(Name = "Confirm Password", Prompt = "Confirm Password")] 29 | public string ConfirmPassword { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/JobPortal.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/JobPortal.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/JobPortal.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.ViewModels.LoginViewModel 2 | @{ 3 | ViewData["Title"] = "Login"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |
8 |
9 |

New account

10 |

Not our registered yet?

11 |

12 | If you have any questions, please feel free to contact us, 13 | our customer service center is working for you 24/7. 14 |

15 |
16 | @Html.ValidationSummary() 17 | 18 |
19 | @Html.LabelFor(c => c.Email, "Email") 20 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "email@example.com" }) 21 |
22 | 23 |
24 | @Html.LabelFor(c => c.Password, "Password") 25 | @Html.TextBoxFor(m => m.Password, new { @class = "form-control", placeholder = "Password", @type = "password" }) 26 |
27 | 28 | @Html.AntiForgeryToken() 29 |
30 | 33 |
34 |
35 |
36 |
-------------------------------------------------------------------------------- /Models/Job.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace JobPortal.Models 6 | { 7 | public class Job 8 | { 9 | public int Id { get; set; } 10 | [Required, MaxLength(255), Display(Name = "Job Title",Prompt = "Job Title" )] 11 | public string Title { get; set; } 12 | [Required, Display(Name = "Job Description", Prompt = "Job Description")] 13 | public string Description { get; set; } 14 | [Required, Display(Name = "Location", Prompt = "Location")] 15 | public string Location { get; set; } 16 | [Required(ErrorMessage = "Type is required"), Display(Name = "Type", Prompt = "Type")] 17 | public string Type { get; set; } 18 | [Required, Display(Name = "Last Date", Prompt = "Last Date")] 19 | public DateTime LastDate { get; set; } 20 | [Required, Display(Name = "Company Name", Prompt = "Company Name")] 21 | public string CompanyName { get; set; } 22 | [Required, Display(Name = "Company Description", Prompt = "Company Description")] 23 | public string CompanyDescription { get; set; } 24 | [Display(Name = "Website", Prompt = "Website")] 25 | [Url] 26 | public string Website { get; set; } 27 | public DateTime CreatedAt { get; set; } = DateTime.Now; 28 | public bool Filled { get; set; } = false; 29 | public User User { get; set; } 30 | public List Applicants { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/JobPortal.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | "stopAtEntry": false, 17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser 18 | "serverReadyAction": { 19 | "action": "openExternally", 20 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 21 | }, 22 | "env": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "sourceFileMap": { 26 | "/Views": "${workspaceFolder}/Views" 27 | } 28 | }, 29 | { 30 | "name": ".NET Core Attach", 31 | "type": "coreclr", 32 | "request": "attach", 33 | "processId": "${command:pickProcess}" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /Migrations/20190912083400_InitialCreate.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace JobPortal.Migrations 4 | { 5 | public partial class InitialCreate : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "LastName", 11 | table: "AspNetUsers", 12 | maxLength: 60, 13 | nullable: true, 14 | oldClrType: typeof(string), 15 | oldNullable: true); 16 | 17 | migrationBuilder.AlterColumn( 18 | name: "FirstName", 19 | table: "AspNetUsers", 20 | maxLength: 20, 21 | nullable: true, 22 | oldClrType: typeof(string), 23 | oldNullable: true); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.AlterColumn( 29 | name: "LastName", 30 | table: "AspNetUsers", 31 | nullable: true, 32 | oldClrType: typeof(string), 33 | oldMaxLength: 60, 34 | oldNullable: true); 35 | 36 | migrationBuilder.AlterColumn( 37 | name: "FirstName", 38 | table: "AspNetUsers", 39 | nullable: true, 40 | oldClrType: typeof(string), 41 | oldMaxLength: 20, 42 | oldNullable: true); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /wwwroot/vendor/owl.carousel/assets/owl.theme.default.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | /* 7 | * Default theme - Owl Carousel CSS File 8 | */ 9 | .owl-theme .owl-nav { 10 | margin-top: 10px; 11 | text-align: center; 12 | -webkit-tap-highlight-color: transparent; } 13 | .owl-theme .owl-nav [class*='owl-'] { 14 | color: #FFF; 15 | font-size: 14px; 16 | margin: 5px; 17 | padding: 4px 7px; 18 | background: #D6D6D6; 19 | display: inline-block; 20 | cursor: pointer; 21 | border-radius: 3px; } 22 | .owl-theme .owl-nav [class*='owl-']:hover { 23 | background: #869791; 24 | color: #FFF; 25 | text-decoration: none; } 26 | .owl-theme .owl-nav .disabled { 27 | opacity: 0.5; 28 | cursor: default; } 29 | 30 | .owl-theme .owl-nav.disabled + .owl-dots { 31 | margin-top: 10px; } 32 | 33 | .owl-theme .owl-dots { 34 | text-align: center; 35 | -webkit-tap-highlight-color: transparent; } 36 | .owl-theme .owl-dots .owl-dot { 37 | display: inline-block; 38 | zoom: 1; 39 | *display: inline; } 40 | .owl-theme .owl-dots .owl-dot span { 41 | width: 10px; 42 | height: 10px; 43 | margin: 5px 7px; 44 | background: #D6D6D6; 45 | display: block; 46 | -webkit-backface-visibility: visible; 47 | transition: opacity 200ms ease; 48 | border-radius: 30px; } 49 | .owl-theme .owl-dots .owl-dot.active span, .owl-theme .owl-dots .owl-dot:hover span { 50 | background: #869791; } 51 | -------------------------------------------------------------------------------- /Helpers/HtmlHelperExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Html; 2 | using Microsoft.AspNetCore.Mvc.Rendering; 3 | using Microsoft.AspNetCore.Mvc.ViewFeatures; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Linq.Expressions; 8 | using System.Threading.Tasks; 9 | 10 | namespace JobPortal.Helpers 11 | { 12 | public static class HtmlHelperExtensions 13 | { 14 | public static IHtmlContent HelloWorldHTMLString(this IHtmlHelper htmlHelper) 15 | => new HtmlString("Hello World"); 16 | 17 | public static IHtmlContent AddClassIfPropertyInError( 18 | this IHtmlHelper htmlHelper, 19 | Expression> expression, 20 | string errorClassName) 21 | { 22 | var expressionProvider = htmlHelper.ViewContext.HttpContext.RequestServices 23 | .GetService(typeof(ModelExpressionProvider)) as ModelExpressionProvider; 24 | 25 | var expressionText = expressionProvider.GetExpressionText(expression); 26 | var fullHtmlFieldName = htmlHelper.ViewContext.ViewData 27 | .TemplateInfo.GetFullHtmlFieldName(expressionText); 28 | var state = htmlHelper.ViewData.ModelState[fullHtmlFieldName]; 29 | if (state == null) 30 | { 31 | return HtmlString.Empty; 32 | } 33 | 34 | if (state.Errors.Count == 0) 35 | { 36 | return HtmlString.Empty; 37 | } 38 | 39 | return new HtmlString(errorClassName); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Views/Account/EmployeeRegister.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.ViewModels.EmployeeRegisterViewModel 2 | 3 | @{ 4 | ViewData["Title"] = "Employee Register"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |
9 |
10 |

New account

11 |

Not our registered yet?

12 |

13 | If you have any questions, please feel free to contact us, 14 | our customer service center is working for you 24/7. 15 |

16 |
17 |
18 | @Html.ValidationSummary() 19 | 20 |
21 | @Html.LabelFor(c => c.FirstName) 22 | @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control"}) 23 |
24 | 25 |
26 | @Html.LabelFor(c => c.LastName) 27 | @Html.TextBoxFor(m => m.LastName, new { @class = "form-control"}) 28 |
29 | 30 |
31 | @Html.LabelFor(c => c.Email) 32 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control"}) 33 |
34 | 35 |
36 | @Html.LabelFor(c => c.Password) 37 | @Html.TextBoxFor(m => m.Password, new { @class = "form-control", @type = "password" }) 38 |
39 | 40 |
41 | @Html.LabelFor(c => c.ConfirmPassword) 42 | @Html.TextBoxFor(m => m.ConfirmPassword, new { @class = "form-control", @type = "password" }) 43 |
44 | 45 | @Html.AntiForgeryToken() 46 |
47 | 50 |
51 |
52 |
53 |
-------------------------------------------------------------------------------- /Migrations/20190912185036_JobModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Metadata; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | 5 | namespace JobPortal.Migrations 6 | { 7 | public partial class JobModel : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "Jobs", 13 | columns: table => new 14 | { 15 | Id = table.Column(nullable: false) 16 | .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), 17 | Title = table.Column(maxLength: 255, nullable: true), 18 | Description = table.Column(nullable: true), 19 | Location = table.Column(nullable: true), 20 | Type = table.Column(nullable: true), 21 | LastDate = table.Column(nullable: false), 22 | CompanyName = table.Column(nullable: true), 23 | CompanyDescription = table.Column(nullable: true), 24 | Website = table.Column(nullable: true), 25 | CreatedAt = table.Column(nullable: false), 26 | Filled = table.Column(nullable: false), 27 | UserId = table.Column(nullable: true) 28 | }, 29 | constraints: table => 30 | { 31 | table.PrimaryKey("PK_Jobs", x => x.Id); 32 | table.ForeignKey( 33 | name: "FK_Jobs_AspNetUsers_UserId", 34 | column: x => x.UserId, 35 | principalTable: "AspNetUsers", 36 | principalColumn: "Id", 37 | onDelete: ReferentialAction.Restrict); 38 | }); 39 | 40 | migrationBuilder.CreateIndex( 41 | name: "IX_Jobs_UserId", 42 | table: "Jobs", 43 | column: "UserId"); 44 | } 45 | 46 | protected override void Down(MigrationBuilder migrationBuilder) 47 | { 48 | migrationBuilder.DropTable( 49 | name: "Jobs"); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Views/Account/EmployerRegister.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.ViewModels.EmployerRegisterViewModel 2 | 3 | @{ 4 | ViewData["Title"] = "Employee Register"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |
9 |
10 |

New account

11 |

Not our registered yet?

12 |

13 | If you have any questions, please feel free to contact us, 14 | our customer service center is working for you 24/7. 15 |

16 |
17 |
18 | @Html.ValidationSummary() 19 | 20 |
21 | @Html.LabelFor(c => c.FirstName, "Company Name") 22 | @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control", placeholder = "Company Name" }) 23 |
24 | 25 |
26 | @Html.LabelFor(c => c.LastName, "Company Address") 27 | @Html.TextBoxFor(m => m.LastName, new { @class = "form-control", placeholder = "Company Address" }) 28 |
29 | 30 |
31 | @Html.LabelFor(c => c.Email, "Email") 32 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "email@example.com" }) 33 |
34 | 35 |
36 | @Html.LabelFor(c => c.Password, "Password") 37 | @Html.TextBoxFor(m => m.Password, new { @class = "form-control", placeholder = "Password", @type = "password" }) 38 |
39 | 40 |
41 | @Html.LabelFor(c => c.ConfirmPassword, "Confirm Password") 42 | @Html.TextBoxFor(m => m.ConfirmPassword, new { @class = "form-control", placeholder = "Confirm Password", @type = "password" }) 43 |
44 | 45 | @Html.AntiForgeryToken() 46 |
47 | 50 |
51 |
52 |
53 |
-------------------------------------------------------------------------------- /Views/Account/EditProfile.cshtml: -------------------------------------------------------------------------------- 1 | @model User 2 | 3 | @{ 4 | ViewBag.Title = "User Profile"; 5 | Layout = "_Layout"; 6 | } 7 | 8 |
9 |
10 |

Edit Profile

11 | 12 |
13 | 14 | @Html.ValidationSummary() 15 | @Html.AntiForgeryToken() 16 |
17 | @Html.LabelFor(c => c.FirstName, "First Name") 18 | @Html.TextBoxFor(x => x.FirstName, new { @class = "form-control"}) 19 |
20 | 21 | 22 |
23 | @Html.LabelFor(c => c.LastName, "Last Name") 24 | @Html.TextBoxFor(x => x.LastName, new { @class = "form-control"}) 25 |
26 | 27 | 28 |
29 | 30 |
31 |
32 | @Html.RadioButtonFor(x => x.Gender, "Male", new { @class = "form-check-input", id = "male", @checked="checked" }) 33 | @* *@ 36 | @* *@ 37 | @Html.LabelFor(x => x.Gender, "Male", new { @class = "form-check-label"}) 38 |
39 |
40 | @Html.RadioButtonFor(x => x.Gender, "Female", new { @class = "form-check-input", id = "female" }) 41 | @* *@ 44 | @* *@ 45 | @Html.LabelFor(x => x.Gender, "Female", new { @class = "form-check-label"}) 46 |
47 |
48 | 49 | 50 |
51 | 54 |
55 |
56 |
57 |
-------------------------------------------------------------------------------- /Controllers/DashboardController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using JobPortal.Models; 4 | using JobPortal.ViewModels; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Identity; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.EntityFrameworkCore; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace JobPortal.Controllers 12 | { 13 | public class DashboardController : Controller 14 | { 15 | private readonly ApplicationDbContext _context; 16 | private readonly UserManager _userManager; 17 | private readonly ILogger _logger; 18 | 19 | public DashboardController(ApplicationDbContext context, UserManager userManager, 20 | ILogger logger) 21 | { 22 | _context = context; 23 | _userManager = userManager; 24 | _logger = logger; 25 | } 26 | 27 | [Route("employer/dashboard")] 28 | [Authorize(Roles = "Employer")] 29 | public async Task Index(int page = 1) 30 | { 31 | var user = await _userManager.GetUserAsync(HttpContext.User); 32 | var jobs = _context.Jobs.Where(x => x.User == user).Include(x => x.Applicants).ToList(); 33 | //var model = await PagingList.CreateAsync(jobs, 2, page); 34 | 35 | return View(jobs); 36 | } 37 | 38 | [Route("employer/applicants")] 39 | public async Task Applicants() 40 | { 41 | var user = await _userManager.GetUserAsync(HttpContext.User); 42 | var applicants = _context.Applicants.Where(x => x.Job.User == user).Include(x => x.User).Include(x => x.Job) 43 | .ToList(); 44 | 45 | return View(applicants); 46 | } 47 | 48 | [Route("employer/jobs/{id}/applicants")] 49 | public async Task ApplicantsByJob(int id) 50 | { 51 | var user = await _userManager.GetUserAsync(HttpContext.User); 52 | var job = _context.Jobs 53 | .Include(x => x.Applicants) 54 | .ThenInclude(x => x.User) 55 | .SingleOrDefault(x => x.Id == id); 56 | // _logger.LogInformation(job.Title); 57 | var model = new JobApplicantsViewModel 58 | { 59 | Job = job, 60 | Applicants = job.Applicants 61 | }; 62 | 63 | return View(model); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /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 JobPortal.Models; 8 | using JobPortal.ViewModels.Home; 9 | using Microsoft.AspNetCore.Identity; 10 | 11 | namespace JobPortal.Controllers 12 | { 13 | public class HomeController : Controller 14 | { 15 | private readonly ApplicationDbContext _context; 16 | private readonly UserManager _userManager; 17 | 18 | public HomeController(ApplicationDbContext context, UserManager userManager) 19 | { 20 | _context = context; 21 | _userManager = userManager; 22 | } 23 | 24 | public IActionResult Index() 25 | { 26 | var jobs = _context.Jobs 27 | .Where(x => x.Filled == false) 28 | .ToList(); 29 | var trendings = _context.Jobs 30 | .Where(b => b.CreatedAt.Month == DateTime.Now.Month) 31 | .Where(x => x.Filled == false) 32 | .ToList(); 33 | var model = new TrendingJobViewModel 34 | { 35 | Trendings = trendings, 36 | Jobs = jobs 37 | }; 38 | 39 | return View(model); 40 | } 41 | 42 | [Route("jobs/{id}/details")] 43 | public async Task JobDetails(int id) 44 | { 45 | //ViewBag.message = "You can't do this action"; 46 | var job = _context.Jobs.SingleOrDefault(x => x.Id == id); 47 | var user = await _userManager.GetUserAsync(HttpContext.User); 48 | var applied = false; 49 | if (user != null) 50 | applied = _context.Applicants.Where(x => x.Job == job).Any(x => x.User == user); 51 | 52 | var model = new JobDetailsViewModel 53 | { 54 | Job = job, 55 | IsApplied = applied 56 | }; 57 | return View(model); 58 | } 59 | 60 | [Route("search")] 61 | public IActionResult Search() 62 | { 63 | List jobs; 64 | 65 | string position = HttpContext.Request.Query["position"].ToString(); 66 | string location = HttpContext.Request.Query["location"].ToString(); 67 | if (position.Length > 0 && location.Length > 0) 68 | { 69 | jobs = _context.Jobs.Where(x => x.Title.Contains(position)) 70 | .ToList(); 71 | } 72 | else if (location.Length == 0) 73 | { 74 | jobs = _context.Jobs.Where(x => x.Title.Contains(position)) 75 | .ToList(); 76 | } 77 | else 78 | { 79 | jobs = _context.Jobs.Where(x => x.Location.Contains(location)) 80 | .ToList(); 81 | } 82 | 83 | 84 | return View(jobs); 85 | } 86 | 87 | public IActionResult Privacy() 88 | { 89 | return View(); 90 | } 91 | 92 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 93 | public IActionResult Error() 94 | { 95 | return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier}); 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /wwwroot/vendor/jquery.cookie/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /Startup.cs: -------------------------------------------------------------------------------- 1 | using JobPortal.Models; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Identity; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.EntityFrameworkCore; 8 | using Microsoft.EntityFrameworkCore.Diagnostics; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Logging; 12 | using System; 13 | 14 | namespace JobPortal 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddDbContext(x => x. 29 | UseMySql(Configuration.GetConnectionString("DefaultConnection"), new MySqlServerVersion(new Version(8, 0, 11))) 30 | .ConfigureWarnings(warnings => warnings.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning))); 31 | 32 | services.AddIdentity(options => 33 | options.Password = new PasswordOptions 34 | { 35 | RequireDigit = true, 36 | RequiredLength = 6, 37 | RequireLowercase = false, 38 | RequireUppercase = false, 39 | RequireNonAlphanumeric = false, 40 | } 41 | ) 42 | .AddEntityFrameworkStores(); 43 | 44 | services.Configure(options => 45 | { 46 | // This lambda determines whether user consent for non-essential cookies is needed for a given request. 47 | options.CheckConsentNeeded = context => true; 48 | options.MinimumSameSitePolicy = SameSiteMode.None; 49 | }); 50 | 51 | //services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 52 | // .AddCookie(options => 53 | // { 54 | // options.AccessDeniedPath = "/Account/Login"; 55 | // options.LoginPath = "/Account/Login"; 56 | // } 57 | // ); 58 | services.ConfigureApplicationCookie(options => 59 | { 60 | options.AccessDeniedPath = new PathString("/Account/Login"); 61 | options.LoginPath = new PathString("/Account/Login"); 62 | options.SlidingExpiration = true; 63 | }); 64 | services.AddMvc(options => options.EnableEndpointRouting = false).SetCompatibilityVersion(CompatibilityVersion.Version_3_0); 65 | } 66 | 67 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 68 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 69 | { 70 | // loggerFactory.AddFile("Logs/mylog-{Date}.txt"); 71 | 72 | if (env.IsDevelopment()) 73 | { 74 | app.UseDeveloperExceptionPage(); 75 | } 76 | else 77 | { 78 | app.UseExceptionHandler("/Home/Error"); 79 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 80 | app.UseHsts(); 81 | } 82 | 83 | app.UseHttpsRedirection(); 84 | app.UseStaticFiles(); 85 | app.UseCookiePolicy(); 86 | app.UseAuthentication(); 87 | 88 | app.UseMvc(routes => 89 | { 90 | routes.MapRoute( 91 | name: "default", 92 | template: "{controller=Home}/{action=Index}/{id?}"); 93 | }); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Controllers/JobController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using JobPortal.Models; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Identity; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace JobPortal.Controllers 12 | { 13 | public class JobController : Controller 14 | { 15 | private readonly ILogger _logger; 16 | private readonly ApplicationDbContext _context; 17 | private UserManager _userManager; 18 | 19 | public JobController(ApplicationDbContext context, UserManager userManager, ILogger logger) 20 | { 21 | _logger = logger; 22 | _context = context; 23 | _userManager = userManager; 24 | } 25 | 26 | [Route("jobs")] 27 | public IActionResult Index() 28 | { 29 | var jobs = _context.Jobs.ToList(); 30 | 31 | return View(jobs); 32 | } 33 | 34 | [Route("jobs/create")] 35 | [Authorize(Roles = "Employer")] 36 | public IActionResult Create() 37 | { 38 | return View(); 39 | } 40 | 41 | [Route("jobs/save")] 42 | [Authorize(Roles = "Employer")] 43 | [HttpPost] 44 | public async Task Save(Job model) 45 | { 46 | if(ModelState.IsValid) 47 | { 48 | TempData["type"] = "success"; 49 | TempData["message"] = "Job posted successfully"; 50 | //_logger.LogInformation(model.ToString()); 51 | var user = await _userManager.GetUserAsync(HttpContext.User); 52 | model.User = user; 53 | _context.Jobs.Add(model); 54 | 55 | await _context.SaveChangesAsync(); 56 | 57 | return RedirectToActionPermanent("Index", "Home"); 58 | } 59 | 60 | return View("Create", model); 61 | } 62 | 63 | [HttpPost] 64 | //[Authorize(Roles = "Employee")] 65 | public async Task Apply(int id) 66 | { 67 | var job = _context.Jobs.SingleOrDefault(x => x.Id == id); 68 | var user = await _userManager.GetUserAsync(HttpContext.User); 69 | if(user == null) 70 | { 71 | return RedirectToActionPermanent("Login", "Account"); 72 | } 73 | else 74 | { 75 | if(!User.IsInRole("Employee")) 76 | { 77 | TempData["message"] = "You can't do this action"; 78 | return RedirectToActionPermanent("JobDetails", "Home", new { id }); 79 | } 80 | } 81 | var apply = new Applicant 82 | { 83 | User = user, 84 | Job = job, 85 | CreatedAt = DateTime.Now 86 | }; 87 | 88 | _context.Applicants.Add(apply); 89 | 90 | await _context.SaveChangesAsync(); 91 | 92 | return RedirectToActionPermanent("JobDetails", "Home", new { id }); 93 | } 94 | 95 | [Route("mark-as-filled/{id}")] 96 | [Authorize(Roles = "Employer")] 97 | public async Task MarkAsFilled(int id) 98 | { 99 | var job = _context.Jobs.SingleOrDefault(x => x.Id == id); 100 | job.Filled = true; 101 | _context.Jobs.Update(job); 102 | await _context.SaveChangesAsync(); 103 | 104 | return RedirectToActionPermanent("Index", "Dashboard"); 105 | } 106 | 107 | [HttpPost] 108 | [Authorize(Roles = "Employer")] 109 | [Route("employer/jobs/{id}/destroy")] 110 | [ValidateAntiForgeryToken] 111 | public async Task Destroy(int id) 112 | { 113 | var job = _context.Jobs.SingleOrDefault(x => x.Id == id); 114 | if(job == null) 115 | { 116 | return NotFound(); 117 | } 118 | 119 | _context.Jobs.Remove(job); 120 | await _context.SaveChangesAsync(); 121 | 122 | TempData["type"] = "success"; 123 | TempData["message"] = "Job deleted successfully"; 124 | 125 | return RedirectToActionPermanent("Index", "Dashboard"); 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /Views/Dashboard/ApplicantsByJob.cshtml: -------------------------------------------------------------------------------- 1 | @using Humanizer 2 | @model JobPortal.ViewModels.JobApplicantsViewModel 3 | 4 | @{ 5 | ViewBag.Title = "title"; 6 | Layout = "_Layout"; 7 | } 8 | 9 |
10 |
11 |
12 |
13 |

Applicants for the @Model.Job.Title position

14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | @if (Model.Applicants.Any()) 22 | { 23 | foreach (var applicant in Model.Applicants) 24 | { 25 |
26 |
27 |

@applicant.User.FirstName @applicant.User.LastName

28 | 30 | Contact 31 | 32 |

33 | Applied @applicant.CreatedAt.Humanize() 34 |

35 |
36 |

37 |
38 | 40 |
41 |
42 |
43 |
44 | } 45 | } 46 | 47 | @* {% if is_paginated %} *@ 48 | @*
*@ 49 | @*
*@ 50 | @* *@ 89 | @*
*@ 90 | @*
*@ 91 | @* {% else %} *@ 92 | @*

You are end

*@ 93 | @* {% endif %} *@ 94 |
95 |
96 |
-------------------------------------------------------------------------------- /Migrations/20190914054745_Applicant Model.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Metadata; 3 | using Microsoft.EntityFrameworkCore.Migrations; 4 | 5 | namespace JobPortal.Migrations 6 | { 7 | public partial class ApplicantModel : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AlterColumn( 12 | name: "Type", 13 | table: "Jobs", 14 | nullable: false, 15 | oldClrType: typeof(string), 16 | oldNullable: true); 17 | 18 | migrationBuilder.AlterColumn( 19 | name: "Title", 20 | table: "Jobs", 21 | maxLength: 255, 22 | nullable: false, 23 | oldClrType: typeof(string), 24 | oldMaxLength: 255, 25 | oldNullable: true); 26 | 27 | migrationBuilder.AlterColumn( 28 | name: "Location", 29 | table: "Jobs", 30 | nullable: false, 31 | oldClrType: typeof(string), 32 | oldNullable: true); 33 | 34 | migrationBuilder.AlterColumn( 35 | name: "Description", 36 | table: "Jobs", 37 | nullable: false, 38 | oldClrType: typeof(string), 39 | oldNullable: true); 40 | 41 | migrationBuilder.AlterColumn( 42 | name: "CompanyName", 43 | table: "Jobs", 44 | nullable: false, 45 | oldClrType: typeof(string), 46 | oldNullable: true); 47 | 48 | migrationBuilder.AlterColumn( 49 | name: "CompanyDescription", 50 | table: "Jobs", 51 | nullable: false, 52 | oldClrType: typeof(string), 53 | oldNullable: true); 54 | 55 | migrationBuilder.CreateTable( 56 | name: "Applicants", 57 | columns: table => new 58 | { 59 | Id = table.Column(nullable: false) 60 | .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), 61 | UserId = table.Column(nullable: true), 62 | JobId = table.Column(nullable: true), 63 | CreatedAt = table.Column(nullable: false) 64 | }, 65 | constraints: table => 66 | { 67 | table.PrimaryKey("PK_Applicants", x => x.Id); 68 | table.ForeignKey( 69 | name: "FK_Applicants_Jobs_JobId", 70 | column: x => x.JobId, 71 | principalTable: "Jobs", 72 | principalColumn: "Id", 73 | onDelete: ReferentialAction.Restrict); 74 | table.ForeignKey( 75 | name: "FK_Applicants_AspNetUsers_UserId", 76 | column: x => x.UserId, 77 | principalTable: "AspNetUsers", 78 | principalColumn: "Id", 79 | onDelete: ReferentialAction.Restrict); 80 | }); 81 | 82 | migrationBuilder.CreateIndex( 83 | name: "IX_Applicants_JobId", 84 | table: "Applicants", 85 | column: "JobId"); 86 | 87 | migrationBuilder.CreateIndex( 88 | name: "IX_Applicants_UserId", 89 | table: "Applicants", 90 | column: "UserId"); 91 | } 92 | 93 | protected override void Down(MigrationBuilder migrationBuilder) 94 | { 95 | migrationBuilder.DropTable( 96 | name: "Applicants"); 97 | 98 | migrationBuilder.AlterColumn( 99 | name: "Type", 100 | table: "Jobs", 101 | nullable: true, 102 | oldClrType: typeof(string)); 103 | 104 | migrationBuilder.AlterColumn( 105 | name: "Title", 106 | table: "Jobs", 107 | maxLength: 255, 108 | nullable: true, 109 | oldClrType: typeof(string), 110 | oldMaxLength: 255); 111 | 112 | migrationBuilder.AlterColumn( 113 | name: "Location", 114 | table: "Jobs", 115 | nullable: true, 116 | oldClrType: typeof(string)); 117 | 118 | migrationBuilder.AlterColumn( 119 | name: "Description", 120 | table: "Jobs", 121 | nullable: true, 122 | oldClrType: typeof(string)); 123 | 124 | migrationBuilder.AlterColumn( 125 | name: "CompanyName", 126 | table: "Jobs", 127 | nullable: true, 128 | oldClrType: typeof(string)); 129 | 130 | migrationBuilder.AlterColumn( 131 | name: "CompanyDescription", 132 | table: "Jobs", 133 | nullable: true, 134 | oldClrType: typeof(string)); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Views/Job/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @using Humanizer 3 | 4 | @{ 5 | ViewData["Title"] = "All Jobs"; 6 | Layout = "~/Views/Shared/_Layout.cshtml"; 7 | } 8 | 9 |
10 |
11 |

Find a job you will love

12 |
13 |
14 |
15 |
16 |
17 | 18 | 20 |
21 |
22 | 23 | 25 |
26 |
27 | 31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |

We have found @Model.Count() jobs

40 | @foreach (var job in Model) 41 | { 42 |
43 |
44 |
45 |
46 |
47 | Ipsioou 48 |
49 |
50 |

51 | @job.Title 52 |

53 |

54 | @job.CompanyName 55 |

56 |
57 |
58 |
59 |
60 | 61 | @job.Location 62 |
63 |
64 |

Posted @job.CreatedAt.Humanize()

65 |
66 |
67 |
68 | } 69 | @*{% if is_paginated %} 70 |
71 |
72 | 106 |
107 |
108 | {% endif %}*@ 109 |
110 |
111 | 112 | -------------------------------------------------------------------------------- /wwwroot/vendor/owl.carousel/assets/owl.carousel.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | /* 7 | * Owl Carousel - Core 8 | */ 9 | .owl-carousel { 10 | display: none; 11 | width: 100%; 12 | -webkit-tap-highlight-color: transparent; 13 | /* position relative and z-index fix webkit rendering fonts issue */ 14 | position: relative; 15 | z-index: 1; } 16 | .owl-carousel .owl-stage { 17 | position: relative; 18 | -ms-touch-action: pan-Y; 19 | touch-action: manipulation; 20 | -moz-backface-visibility: hidden; 21 | /* fix firefox animation glitch */ } 22 | .owl-carousel .owl-stage:after { 23 | content: "."; 24 | display: block; 25 | clear: both; 26 | visibility: hidden; 27 | line-height: 0; 28 | height: 0; } 29 | .owl-carousel .owl-stage-outer { 30 | position: relative; 31 | overflow: hidden; 32 | /* fix for flashing background */ 33 | -webkit-transform: translate3d(0px, 0px, 0px); } 34 | .owl-carousel .owl-wrapper, 35 | .owl-carousel .owl-item { 36 | -webkit-backface-visibility: hidden; 37 | -moz-backface-visibility: hidden; 38 | -ms-backface-visibility: hidden; 39 | -webkit-transform: translate3d(0, 0, 0); 40 | -moz-transform: translate3d(0, 0, 0); 41 | -ms-transform: translate3d(0, 0, 0); } 42 | .owl-carousel .owl-item { 43 | position: relative; 44 | min-height: 1px; 45 | float: left; 46 | -webkit-backface-visibility: hidden; 47 | -webkit-tap-highlight-color: transparent; 48 | -webkit-touch-callout: none; } 49 | .owl-carousel .owl-item img { 50 | display: block; 51 | width: 100%; } 52 | .owl-carousel .owl-nav.disabled, 53 | .owl-carousel .owl-dots.disabled { 54 | display: none; } 55 | .owl-carousel .owl-nav .owl-prev, 56 | .owl-carousel .owl-nav .owl-next, 57 | .owl-carousel .owl-dot { 58 | cursor: pointer; 59 | -webkit-user-select: none; 60 | -khtml-user-select: none; 61 | -moz-user-select: none; 62 | -ms-user-select: none; 63 | user-select: none; } 64 | .owl-carousel .owl-nav button.owl-prev, 65 | .owl-carousel .owl-nav button.owl-next, 66 | .owl-carousel button.owl-dot { 67 | background: none; 68 | color: inherit; 69 | border: none; 70 | padding: 0 !important; 71 | font: inherit; } 72 | .owl-carousel.owl-loaded { 73 | display: block; } 74 | .owl-carousel.owl-loading { 75 | opacity: 0; 76 | display: block; } 77 | .owl-carousel.owl-hidden { 78 | opacity: 0; } 79 | .owl-carousel.owl-refresh .owl-item { 80 | visibility: hidden; } 81 | .owl-carousel.owl-drag .owl-item { 82 | -ms-touch-action: pan-y; 83 | touch-action: pan-y; 84 | -webkit-user-select: none; 85 | -moz-user-select: none; 86 | -ms-user-select: none; 87 | user-select: none; } 88 | .owl-carousel.owl-grab { 89 | cursor: move; 90 | cursor: grab; } 91 | .owl-carousel.owl-rtl { 92 | direction: rtl; } 93 | .owl-carousel.owl-rtl .owl-item { 94 | float: right; } 95 | 96 | /* No Js */ 97 | .no-js .owl-carousel { 98 | display: block; } 99 | 100 | /* 101 | * Owl Carousel - Animate Plugin 102 | */ 103 | .owl-carousel .animated { 104 | animation-duration: 1000ms; 105 | animation-fill-mode: both; } 106 | 107 | .owl-carousel .owl-animated-in { 108 | z-index: 0; } 109 | 110 | .owl-carousel .owl-animated-out { 111 | z-index: 1; } 112 | 113 | .owl-carousel .fadeOut { 114 | animation-name: fadeOut; } 115 | 116 | @keyframes fadeOut { 117 | 0% { 118 | opacity: 1; } 119 | 100% { 120 | opacity: 0; } } 121 | 122 | /* 123 | * Owl Carousel - Auto Height Plugin 124 | */ 125 | .owl-height { 126 | transition: height 500ms ease-in-out; } 127 | 128 | /* 129 | * Owl Carousel - Lazy Load Plugin 130 | */ 131 | .owl-carousel .owl-item { 132 | /** 133 | This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong 134 | calculation of the height of the owl-item that breaks page layouts 135 | */ } 136 | .owl-carousel .owl-item .owl-lazy { 137 | opacity: 0; 138 | transition: opacity 400ms ease; } 139 | .owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) { 140 | max-height: 0; } 141 | .owl-carousel .owl-item img.owl-lazy { 142 | transform-style: preserve-3d; } 143 | 144 | /* 145 | * Owl Carousel - Video Plugin 146 | */ 147 | .owl-carousel .owl-video-wrapper { 148 | position: relative; 149 | height: 100%; 150 | background: #000; } 151 | 152 | .owl-carousel .owl-video-play-icon { 153 | position: absolute; 154 | height: 80px; 155 | width: 80px; 156 | left: 50%; 157 | top: 50%; 158 | margin-left: -40px; 159 | margin-top: -40px; 160 | background: url("owl.video.play.png") no-repeat; 161 | cursor: pointer; 162 | z-index: 1; 163 | -webkit-backface-visibility: hidden; 164 | transition: transform 100ms ease; } 165 | 166 | .owl-carousel .owl-video-play-icon:hover { 167 | -ms-transform: scale(1.3, 1.3); 168 | transform: scale(1.3, 1.3); } 169 | 170 | .owl-carousel .owl-video-playing .owl-video-tn, 171 | .owl-carousel .owl-video-playing .owl-video-play-icon { 172 | display: none; } 173 | 174 | .owl-carousel .owl-video-tn { 175 | opacity: 0; 176 | height: 100%; 177 | background-position: center center; 178 | background-repeat: no-repeat; 179 | background-size: contain; 180 | transition: opacity 400ms ease; } 181 | 182 | .owl-carousel .owl-video-frame { 183 | position: relative; 184 | z-index: 1; 185 | height: 100%; 186 | width: 100%; } 187 | -------------------------------------------------------------------------------- /wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | // Unobtrusive validation support library for jQuery and jQuery Validate 2 | // Copyright (c) .NET Foundation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 4 | // @version v3.2.11 5 | !function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),m.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),m.add("fileextensions",["extensions"],function(a){e(a,"extension",a.params.extensions)}),a(function(){f.unobtrusive.parse(document)}),f.unobtrusive}); -------------------------------------------------------------------------------- /Views/Home/Search.cshtml: -------------------------------------------------------------------------------- 1 | @using Humanizer 2 | @model IEnumerable 3 | 4 | @{ 5 | ViewBag.Title = "title"; 6 | Layout = "_Layout"; 7 | } 8 | 9 |
    10 |
    11 |

    Find a job you will love

    12 |
    13 |
    14 |
    15 |
    16 |
    17 | 18 | 20 |
    21 |
    22 | 23 | 25 |
    26 |
    27 | 30 |
    31 |
    32 |
    33 |
    34 |
    35 |
    36 |
    37 |
    38 |

    We have found @Model.Count() jobs

    39 | @foreach (var job in Model) 40 | { 41 |
    42 |
    43 |
    44 |
    45 |
    46 | Ipsioou 48 |
    49 |
    50 |

    51 | 53 | @job.Title 54 | 55 |

    56 |

    57 | @job.CompanyName 58 |

    59 |
    60 |
    61 |
    62 |
    63 | 64 | @job.Location 65 |
    66 |
    67 |

    Posted @job.CreatedAt.Humanize()

    68 |
    69 |
    70 |
    71 | } 72 | @* {% if is_paginated %} *@ 73 | @*
    *@ 74 | @*
    *@ 75 | @* *@ 111 | @*
    *@ 112 | @*
    *@ 113 | @* {% endif %} *@ 114 |
    115 |
    -------------------------------------------------------------------------------- /Views/Home/JobDetails.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.ViewModels.Home.JobDetailsViewModel 2 | 3 | @using Humanizer 4 | @using Microsoft.AspNetCore.Identity 5 | @inject SignInManager SignInManager 6 | @inject UserManager UserManager 7 | 8 | @{ 9 | ViewData["Title"] = "Job Details"; 10 | Layout = "~/Views/Shared/_Layout.cshtml"; 11 | } 12 | 13 |
    14 |
    15 |

    16 | @Model.Job.Title
    17 | at @Model.Job.CompanyName 18 |

    19 |
    20 | 21 | @Model.Job.Location | Posted @Model.Job.CreatedAt.Humanize() | 22 | @if (Model.Job.Type == "Full time") 23 | { 24 | Full time 25 | } 26 | else if (Model.Job.Type == "Part time") 27 | { 28 | Part time 29 | } 30 | else 31 | { 32 | Internship 33 | } 34 |
    35 |
    36 |
    37 |
    38 |
    39 |
    40 |
    41 |

    Category: N/A

    42 |
    Last date: @Model.Job.LastDate.Date
    43 |
    Salary: Negotiable
    44 |
    45 |

    @Model.Job.Description

    46 |
    47 |
    48 | @if (SignInManager.IsSignedIn(User)) 49 | { 50 | if (Model.IsApplied) 51 | { 52 | 53 | } 54 | else 55 | { 56 |
    57 | @Html.AntiForgeryToken() 58 | @**@ 59 | 61 |
    62 | } 63 | } 64 | else 65 | { 66 |
    67 | @Html.AntiForgeryToken() 68 | 69 | 71 |
    72 | } 73 |
    74 |
    75 |
    76 |
    77 |

    About @Model.Job.CompanyName

    78 |

    @Model.Job.CompanyDescription

    79 | 91 |
    92 | @if (SignInManager.IsSignedIn(User)) 93 | { 94 | if (Model.IsApplied) 95 | { 96 | 97 | } 98 | else 99 | { 100 |
    101 | @Html.AntiForgeryToken() 102 | @**@ 103 | 105 |
    106 | } 107 | } 108 | else 109 | { 110 |
    111 | @Html.AntiForgeryToken() 112 | 113 | 115 |
    116 | } 117 |
    118 |
    119 |
    120 |
    121 |
    122 | 123 | -------------------------------------------------------------------------------- /Views/Dashboard/Applicants.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @using Humanizer 3 | @{ 4 | ViewData["Title"] = "Applicants"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |
    9 |
    10 |
    11 |
    12 |

    Applicants for all of your position

    13 |
    14 |
    15 |
    16 |
    17 |
    18 |
    19 |
    20 | @foreach (var applicant in Model) 21 | { 22 |
    23 |
    24 |

    @applicant.User.FirstName @applicant.User.LastName

    25 | 27 | Contact 28 | 29 |

    30 | Applied @applicant.CreatedAt.Humanize() 31 |

    32 |
    33 |

    34 |
    35 | 37 |
    38 |
    39 |
    40 |
    41 | } 42 | @*{% if is_paginated %} 43 |
    44 |
    45 | 80 |
    81 |
    82 | {% else %} 83 |

    You are end

    84 | {% endif %}*@@*{% if is_paginated %} 85 |
    86 |
    87 | 122 |
    123 |
    124 | {% else %} 125 |

    You are end

    126 | {% endif %}*@ 127 |
    128 |
    129 |
    130 | -------------------------------------------------------------------------------- /wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | *, 9 | *::before, 10 | *::after { 11 | box-sizing: border-box; 12 | } 13 | 14 | html { 15 | font-family: sans-serif; 16 | line-height: 1.15; 17 | -webkit-text-size-adjust: 100%; 18 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 19 | } 20 | 21 | article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { 22 | display: block; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 28 | font-size: 1rem; 29 | font-weight: 400; 30 | line-height: 1.5; 31 | color: #212529; 32 | text-align: left; 33 | background-color: #fff; 34 | } 35 | 36 | [tabindex="-1"]:focus { 37 | outline: 0 !important; 38 | } 39 | 40 | hr { 41 | box-sizing: content-box; 42 | height: 0; 43 | overflow: visible; 44 | } 45 | 46 | h1, h2, h3, h4, h5, h6 { 47 | margin-top: 0; 48 | margin-bottom: 0.5rem; 49 | } 50 | 51 | p { 52 | margin-top: 0; 53 | margin-bottom: 1rem; 54 | } 55 | 56 | abbr[title], 57 | abbr[data-original-title] { 58 | text-decoration: underline; 59 | -webkit-text-decoration: underline dotted; 60 | text-decoration: underline dotted; 61 | cursor: help; 62 | border-bottom: 0; 63 | -webkit-text-decoration-skip-ink: none; 64 | text-decoration-skip-ink: none; 65 | } 66 | 67 | address { 68 | margin-bottom: 1rem; 69 | font-style: normal; 70 | line-height: inherit; 71 | } 72 | 73 | ol, 74 | ul, 75 | dl { 76 | margin-top: 0; 77 | margin-bottom: 1rem; 78 | } 79 | 80 | ol ol, 81 | ul ul, 82 | ol ul, 83 | ul ol { 84 | margin-bottom: 0; 85 | } 86 | 87 | dt { 88 | font-weight: 700; 89 | } 90 | 91 | dd { 92 | margin-bottom: .5rem; 93 | margin-left: 0; 94 | } 95 | 96 | blockquote { 97 | margin: 0 0 1rem; 98 | } 99 | 100 | b, 101 | strong { 102 | font-weight: bolder; 103 | } 104 | 105 | small { 106 | font-size: 80%; 107 | } 108 | 109 | sub, 110 | sup { 111 | position: relative; 112 | font-size: 75%; 113 | line-height: 0; 114 | vertical-align: baseline; 115 | } 116 | 117 | sub { 118 | bottom: -.25em; 119 | } 120 | 121 | sup { 122 | top: -.5em; 123 | } 124 | 125 | a { 126 | color: #007bff; 127 | text-decoration: none; 128 | background-color: transparent; 129 | } 130 | 131 | a:hover { 132 | color: #0056b3; 133 | text-decoration: underline; 134 | } 135 | 136 | a:not([href]):not([tabindex]) { 137 | color: inherit; 138 | text-decoration: none; 139 | } 140 | 141 | a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { 142 | color: inherit; 143 | text-decoration: none; 144 | } 145 | 146 | a:not([href]):not([tabindex]):focus { 147 | outline: 0; 148 | } 149 | 150 | pre, 151 | code, 152 | kbd, 153 | samp { 154 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 155 | font-size: 1em; 156 | } 157 | 158 | pre { 159 | margin-top: 0; 160 | margin-bottom: 1rem; 161 | overflow: auto; 162 | } 163 | 164 | figure { 165 | margin: 0 0 1rem; 166 | } 167 | 168 | img { 169 | vertical-align: middle; 170 | border-style: none; 171 | } 172 | 173 | svg { 174 | overflow: hidden; 175 | vertical-align: middle; 176 | } 177 | 178 | table { 179 | border-collapse: collapse; 180 | } 181 | 182 | caption { 183 | padding-top: 0.75rem; 184 | padding-bottom: 0.75rem; 185 | color: #6c757d; 186 | text-align: left; 187 | caption-side: bottom; 188 | } 189 | 190 | th { 191 | text-align: inherit; 192 | } 193 | 194 | label { 195 | display: inline-block; 196 | margin-bottom: 0.5rem; 197 | } 198 | 199 | button { 200 | border-radius: 0; 201 | } 202 | 203 | button:focus { 204 | outline: 1px dotted; 205 | outline: 5px auto -webkit-focus-ring-color; 206 | } 207 | 208 | input, 209 | button, 210 | select, 211 | optgroup, 212 | textarea { 213 | margin: 0; 214 | font-family: inherit; 215 | font-size: inherit; 216 | line-height: inherit; 217 | } 218 | 219 | button, 220 | input { 221 | overflow: visible; 222 | } 223 | 224 | button, 225 | select { 226 | text-transform: none; 227 | } 228 | 229 | select { 230 | word-wrap: normal; 231 | } 232 | 233 | button, 234 | [type="button"], 235 | [type="reset"], 236 | [type="submit"] { 237 | -webkit-appearance: button; 238 | } 239 | 240 | button:not(:disabled), 241 | [type="button"]:not(:disabled), 242 | [type="reset"]:not(:disabled), 243 | [type="submit"]:not(:disabled) { 244 | cursor: pointer; 245 | } 246 | 247 | button::-moz-focus-inner, 248 | [type="button"]::-moz-focus-inner, 249 | [type="reset"]::-moz-focus-inner, 250 | [type="submit"]::-moz-focus-inner { 251 | padding: 0; 252 | border-style: none; 253 | } 254 | 255 | input[type="radio"], 256 | input[type="checkbox"] { 257 | box-sizing: border-box; 258 | padding: 0; 259 | } 260 | 261 | input[type="date"], 262 | input[type="time"], 263 | input[type="datetime-local"], 264 | input[type="month"] { 265 | -webkit-appearance: listbox; 266 | } 267 | 268 | textarea { 269 | overflow: auto; 270 | resize: vertical; 271 | } 272 | 273 | fieldset { 274 | min-width: 0; 275 | padding: 0; 276 | margin: 0; 277 | border: 0; 278 | } 279 | 280 | legend { 281 | display: block; 282 | width: 100%; 283 | max-width: 100%; 284 | padding: 0; 285 | margin-bottom: .5rem; 286 | font-size: 1.5rem; 287 | line-height: inherit; 288 | color: inherit; 289 | white-space: normal; 290 | } 291 | 292 | progress { 293 | vertical-align: baseline; 294 | } 295 | 296 | [type="number"]::-webkit-inner-spin-button, 297 | [type="number"]::-webkit-outer-spin-button { 298 | height: auto; 299 | } 300 | 301 | [type="search"] { 302 | outline-offset: -2px; 303 | -webkit-appearance: none; 304 | } 305 | 306 | [type="search"]::-webkit-search-decoration { 307 | -webkit-appearance: none; 308 | } 309 | 310 | ::-webkit-file-upload-button { 311 | font: inherit; 312 | -webkit-appearance: button; 313 | } 314 | 315 | output { 316 | display: inline-block; 317 | } 318 | 319 | summary { 320 | display: list-item; 321 | cursor: pointer; 322 | } 323 | 324 | template { 325 | display: none; 326 | } 327 | 328 | [hidden] { 329 | display: none !important; 330 | } 331 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /Views/Dashboard/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |
    9 |
    10 |
    11 |
    12 |

    dashboard

    13 |

    All created jobs

    14 |
    15 |
    16 |
    17 |
    18 |
    19 |
    20 |
    21 | 28 |
    29 |
    30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | @foreach (var job in Model) 43 | { 44 | 45 | 48 | 58 | 59 | 60 | 69 | 98 | 99 | } 100 | 101 |
    Job titlePosition filledDate postedDate expiringApplicantsActions
    46 | @job.Title 47 | 49 | @if (job.Filled) 50 | { 51 | Filled 52 | } 53 | else 54 | { 55 | Not Filled 56 | } 57 | @job.CreatedAt@job.LastDate 61 | 65 | @job.Applicants.Count() 66 | 67 | 68 | 70 | 71 | Edit 72 | 73 |
    74 | @if (job.Filled) 75 | { 76 | 78 | 79 | 80 |
    81 | } 82 | else 83 | { 84 | 88 | 89 | filled 90 |
    91 | } 92 |
    93 | 96 |
    97 |
    102 |
    103 |
    104 | 122 |
    123 |
    124 |
    125 |
    126 |
    127 | -------------------------------------------------------------------------------- /Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.ViewModels.Home.TrendingJobViewModel 2 | @using Humanizer 3 | @{ 4 | ViewData["Title"] = "Home Page"; 5 | } 6 | 7 |
    8 |
    9 |
    10 |
    11 |
    12 |

    13 | Find a job you will 14 | love. 15 |

    16 |
    17 |
    18 |
    19 |
    20 |
    21 | 22 | 24 |
    25 |
    26 |
    27 |
    28 | 29 | 31 |
    32 |
    33 |
    34 | 38 |
    39 |
    40 |
    41 |
    42 |
    43 |
    44 |
    45 |
    46 |
    47 |
    48 |
    49 |

    Featured jobs

    50 | 90 |
    91 |
    92 |
    93 |
    94 |

    Trending this month

    95 | @foreach (var trending in Model.Trendings) 96 | { 97 |
    98 |
    99 |
    100 |
    101 |
    102 | ShareBoardd 104 |
    105 |
    106 |

    107 | @trending.Title 108 |

    109 |

    110 | @trending.CompanyName 111 |

    112 |
    113 |
    114 |
    115 |
    116 | 117 | @trending.Location 118 |
    119 |
    120 |

    Posted @trending.CreatedAt.Humanize()

    121 |
    122 |
    123 |
    124 | 126 | 127 | 128 |
    129 |
    130 |
    131 |
    132 | } 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |
    140 |

    Start searching for your new job now!

    141 |

    See our job offers

    142 |
    143 |
    144 |
    145 |
    -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | !/Logs/ 342 | -------------------------------------------------------------------------------- /Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using JobPortal.Models; 2 | using JobPortal.ViewModels; 3 | using Microsoft.AspNetCore.Identity; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace JobPortal.Controllers 10 | { 11 | [Route("accounts/")] 12 | public class AccountController : Controller 13 | { 14 | private UserManager _userManager; 15 | private SignInManager _signManager; 16 | private RoleManager _roleManager; 17 | private readonly ILogger _logger; 18 | private readonly ApplicationDbContext _context; 19 | 20 | public AccountController(UserManager userManager, 21 | SignInManager signManager, RoleManager roleManager, ApplicationDbContext context, ILogger logger) 22 | { 23 | _userManager = userManager; 24 | _signManager = signManager; 25 | _roleManager = roleManager; 26 | _context = context; 27 | _logger = logger; 28 | } 29 | 30 | [HttpGet] 31 | [Route("employer/register")] 32 | public IActionResult EmployerRegister() 33 | { 34 | return View(); 35 | } 36 | 37 | [HttpPost] 38 | [Route("employer/register")] 39 | public async Task EmployerRegister( 40 | [Bind("FirstName", "LastName", "Email", "Password", "ConfirmPassword")] 41 | EmployerRegisterViewModel model) 42 | { 43 | if (ModelState.IsValid) 44 | { 45 | var user = new User 46 | { 47 | UserName = model.FirstName, 48 | FirstName = model.FirstName, 49 | LastName = model.LastName, 50 | Email = model.Email 51 | }; 52 | var result = await _userManager.CreateAsync(user, model.Password); 53 | //IdentityResult roleResult = await _roleManager.CreateAsync(new IdentityRole("Employee")); 54 | 55 | if (result.Succeeded) 56 | { 57 | bool checkRole = await _roleManager.RoleExistsAsync("Employer"); 58 | if (!checkRole) 59 | { 60 | var role = new IdentityRole(); 61 | role.Name = "Employer"; 62 | await _roleManager.CreateAsync(role); 63 | 64 | await _userManager.AddToRoleAsync(user, "Employer"); 65 | } 66 | else 67 | { 68 | await _userManager.AddToRoleAsync(user, "Employer"); 69 | } 70 | 71 | //await _signManager.SignInAsync(user, false); 72 | return RedirectToAction("Index", "Home"); 73 | } 74 | else 75 | { 76 | foreach (var error in result.Errors) 77 | { 78 | ModelState.AddModelError("", error.Description); 79 | } 80 | } 81 | } 82 | 83 | return View(); 84 | } 85 | 86 | [HttpGet] 87 | [Route("employee/register")] 88 | public IActionResult EmployeeRegister() 89 | { 90 | return View(); 91 | } 92 | 93 | [HttpPost] 94 | [Route("employee/register")] 95 | public async Task EmployeeRegister( 96 | [Bind("FirstName", "LastName", "Email", "Password", "ConfirmPassword")] 97 | EmployeeRegisterViewModel model) 98 | { 99 | if (ModelState.IsValid) 100 | { 101 | var user = new User 102 | { 103 | UserName = model.FirstName, 104 | FirstName = model.FirstName, 105 | LastName = model.LastName, 106 | Email = model.Email 107 | }; 108 | var result = await _userManager.CreateAsync(user, model.Password); 109 | //IdentityResult roleResult = await _roleManager.CreateAsync(new IdentityRole("Employee")); 110 | 111 | if (result.Succeeded) 112 | { 113 | bool checkRole = await _roleManager.RoleExistsAsync("Employee"); 114 | if (!checkRole) 115 | { 116 | var role = new IdentityRole(); 117 | role.Name = "Employee"; 118 | await _roleManager.CreateAsync(role); 119 | 120 | await _userManager.AddToRoleAsync(user, "Employee"); 121 | } 122 | else 123 | { 124 | await _userManager.AddToRoleAsync(user, "Employee"); 125 | } 126 | 127 | //await _signManager.SignInAsync(user, false); 128 | return RedirectToAction("Login", "Account"); 129 | } 130 | 131 | foreach (var error in result.Errors) 132 | { 133 | ModelState.AddModelError("", error.Description); 134 | } 135 | } 136 | 137 | return View(); 138 | } 139 | 140 | [HttpGet] 141 | [Route("login")] 142 | public IActionResult Login(string returnUrl = "") 143 | { 144 | var model = new LoginViewModel {ReturnUrl = returnUrl}; 145 | return View(model); 146 | } 147 | 148 | [HttpPost] 149 | [Route("login")] 150 | public async Task Login(LoginViewModel model) 151 | { 152 | if (ModelState.IsValid) 153 | { 154 | var user = await _userManager.FindByEmailAsync(model.Email); 155 | if (user == null) 156 | { 157 | ModelState.AddModelError(string.Empty, "Invalid login attempt."); 158 | return View(model); 159 | } 160 | 161 | var userName = user.UserName; 162 | 163 | var result = await _signManager.PasswordSignInAsync(userName, 164 | model.Password, model.RememberMe, lockoutOnFailure: false); 165 | 166 | 167 | if (result.Succeeded) 168 | { 169 | if (!string.IsNullOrEmpty(model.ReturnUrl) && Url.IsLocalUrl(model.ReturnUrl)) 170 | { 171 | return Redirect(model.ReturnUrl); 172 | } 173 | 174 | return RedirectToAction("Index", "Home"); 175 | } 176 | } 177 | 178 | ModelState.AddModelError("", "Invalid login attempt"); 179 | return View(model); 180 | } 181 | 182 | [HttpPost] 183 | public async Task Logout() 184 | { 185 | await _signManager.SignOutAsync(); 186 | return RedirectToAction("Index", "Home"); 187 | } 188 | 189 | [Authorize(Roles = "Employee")] 190 | [HttpGet] 191 | [Route("employee/edit-profile")] 192 | public async Task EditProfile() 193 | { 194 | var user = await _userManager.GetUserAsync(HttpContext.User); 195 | 196 | return View(user); 197 | } 198 | 199 | [Authorize(Roles = "Employee")] 200 | [HttpPost] 201 | [Route("employee/update-profile")] 202 | public async Task UpdateProfile([FromForm] User model) 203 | { 204 | // _logger.LogError(model.Gender.ToString()); 205 | var user = await _userManager.GetUserAsync(HttpContext.User); 206 | user.FirstName = model.FirstName; 207 | user.LastName = model.LastName; 208 | user.Gender = model.Gender; 209 | 210 | _context.Users.Update(user); 211 | 212 | await _context.SaveChangesAsync(); 213 | 214 | return RedirectToActionPermanent("EditProfile", "Account"); 215 | } 216 | } 217 | } -------------------------------------------------------------------------------- /Views/Job/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model JobPortal.Models.Job 2 | 3 | @using JobPortal.Helpers 4 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 5 | 6 | @{ 7 | ViewData["Title"] = "Create"; 8 | Layout = "~/Views/Shared/_Layout.cshtml"; 9 | } 10 | 11 | @section Stylesheets { 12 | 13 | } 14 | 15 |
    16 |
    17 |
    18 |
    19 |

    Add a new position

    20 |
    21 |
    22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 |
    29 | @Html.ValidationSummary(false, "", new { @class = "text-danger" }) 30 |
    31 |
    32 |

    Job details

    33 |

    34 | Some additional info for this screen about validity of 35 | the ads, etc. Pellentesque habitant morbi tristique senectus et netus et malesuada 36 | fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, 37 | tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean 38 | ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien 39 | ullamcorper pharetra. 40 |

    41 |
    42 |
    43 |
    44 |
    45 |
    46 | @Html.LabelFor(c => c.Title) 47 | @Html.TextBoxFor(m => m.Title, new { @class = "form-control" }) 48 | @Html.ValidationMessageFor(x => x.Title) 49 |
    50 |
    51 |
    52 |
    53 | @Html.LabelFor(c => c.Description) 54 | @Html.TextAreaFor(m => m.Description, new { @class = "form-control", rows = 5 }) 55 | @Html.ValidationMessageFor(x => x.Description) 56 |
    57 |
    58 |
    59 |
    60 | @Html.LabelFor(c => c.Location) 61 | @Html.TextBoxFor(m => m.Location, new { @class = "form-control" }) 62 | @Html.ValidationMessageFor(x => x.Location) 63 |
    64 |
    65 | @Html.LabelFor(c => c.Type) 66 | 72 |
    73 |
    74 |
    75 |
    76 | 77 | 86 |
    87 |
    88 |
    89 |
    90 | 93 | 94 |
    95 |
    96 | @Html.LabelFor(c => c.LastDate, "Validity of the post") 97 | @Html.TextBoxFor(m => m.LastDate, new { @class = "form-control", @type = "date" }) 98 | @* 99 | *@ 100 |
    101 |
    102 |
    103 |
    104 |
    105 |
    106 |
    107 |
    108 |
    109 |

    Company details

    110 |
    111 |
    112 |
    113 |
    114 | @Html.LabelFor(c => c.CompanyName, "Company Name") 115 | @Html.TextBoxFor(m => m.CompanyName, new { @class = "form-control" }) 116 |
    117 |
    118 |
    119 |
    120 | @Html.LabelFor(c => c.CompanyDescription, "Company Description") 121 | @Html.TextAreaFor(m => m.CompanyDescription, new { @class = "form-control", rows = 3 }) 122 |
    123 |
    124 |
    125 |
    126 | @Html.LabelFor(c => c.Website, "Company Website") 127 | @Html.TextBoxFor(m => m.Website, new { @class = "form-control", @type = "url" }) 128 |
    129 |
    130 |
    131 |
    132 |
    133 |
    134 | 137 |
    138 |
    139 |
    140 |
    141 |
    142 |
    143 | 147 |
    148 |
    149 |
    150 |
    151 |
    152 |
    153 |
    154 | 155 | -------------------------------------------------------------------------------- /Migrations/20190912083400_InitialCreate.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using JobPortal.Models; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace JobPortal.Migrations 10 | { 11 | [DbContext(typeof(ApplicationDbContext))] 12 | [Migration("20190912083400_InitialCreate")] 13 | partial class InitialCreate 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 64); 21 | 22 | modelBuilder.Entity("JobPortal.Models.User", b => 23 | { 24 | b.Property("Id") 25 | .ValueGeneratedOnAdd(); 26 | 27 | b.Property("AccessFailedCount"); 28 | 29 | b.Property("ConcurrencyStamp") 30 | .IsConcurrencyToken(); 31 | 32 | b.Property("Email") 33 | .HasMaxLength(256); 34 | 35 | b.Property("EmailConfirmed"); 36 | 37 | b.Property("FirstName") 38 | .HasMaxLength(20); 39 | 40 | b.Property("Gender") 41 | .IsRequired() 42 | .HasConversion(new ValueConverter(v => default(string), v => default(string), new ConverterMappingHints(size: 1))) 43 | .HasMaxLength(10); 44 | 45 | b.Property("LastName") 46 | .HasMaxLength(60); 47 | 48 | b.Property("LockoutEnabled"); 49 | 50 | b.Property("LockoutEnd"); 51 | 52 | b.Property("NormalizedEmail") 53 | .HasMaxLength(256); 54 | 55 | b.Property("NormalizedUserName") 56 | .HasMaxLength(256); 57 | 58 | b.Property("PasswordHash"); 59 | 60 | b.Property("PhoneNumber"); 61 | 62 | b.Property("PhoneNumberConfirmed"); 63 | 64 | b.Property("SecurityStamp"); 65 | 66 | b.Property("TwoFactorEnabled"); 67 | 68 | b.Property("UserName") 69 | .HasMaxLength(256); 70 | 71 | b.HasKey("Id"); 72 | 73 | b.HasIndex("NormalizedEmail") 74 | .HasName("EmailIndex"); 75 | 76 | b.HasIndex("NormalizedUserName") 77 | .IsUnique() 78 | .HasName("UserNameIndex"); 79 | 80 | b.ToTable("AspNetUsers"); 81 | }); 82 | 83 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => 84 | { 85 | b.Property("Id") 86 | .ValueGeneratedOnAdd(); 87 | 88 | b.Property("ConcurrencyStamp") 89 | .IsConcurrencyToken(); 90 | 91 | b.Property("Name") 92 | .HasMaxLength(256); 93 | 94 | b.Property("NormalizedName") 95 | .HasMaxLength(256); 96 | 97 | b.HasKey("Id"); 98 | 99 | b.HasIndex("NormalizedName") 100 | .IsUnique() 101 | .HasName("RoleNameIndex"); 102 | 103 | b.ToTable("AspNetRoles"); 104 | }); 105 | 106 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 107 | { 108 | b.Property("Id") 109 | .ValueGeneratedOnAdd(); 110 | 111 | b.Property("ClaimType"); 112 | 113 | b.Property("ClaimValue"); 114 | 115 | b.Property("RoleId") 116 | .IsRequired(); 117 | 118 | b.HasKey("Id"); 119 | 120 | b.HasIndex("RoleId"); 121 | 122 | b.ToTable("AspNetRoleClaims"); 123 | }); 124 | 125 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 126 | { 127 | b.Property("Id") 128 | .ValueGeneratedOnAdd(); 129 | 130 | b.Property("ClaimType"); 131 | 132 | b.Property("ClaimValue"); 133 | 134 | b.Property("UserId") 135 | .IsRequired(); 136 | 137 | b.HasKey("Id"); 138 | 139 | b.HasIndex("UserId"); 140 | 141 | b.ToTable("AspNetUserClaims"); 142 | }); 143 | 144 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 145 | { 146 | b.Property("LoginProvider"); 147 | 148 | b.Property("ProviderKey"); 149 | 150 | b.Property("ProviderDisplayName"); 151 | 152 | b.Property("UserId") 153 | .IsRequired(); 154 | 155 | b.HasKey("LoginProvider", "ProviderKey"); 156 | 157 | b.HasIndex("UserId"); 158 | 159 | b.ToTable("AspNetUserLogins"); 160 | }); 161 | 162 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 163 | { 164 | b.Property("UserId"); 165 | 166 | b.Property("RoleId"); 167 | 168 | b.HasKey("UserId", "RoleId"); 169 | 170 | b.HasIndex("RoleId"); 171 | 172 | b.ToTable("AspNetUserRoles"); 173 | }); 174 | 175 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 176 | { 177 | b.Property("UserId"); 178 | 179 | b.Property("LoginProvider"); 180 | 181 | b.Property("Name"); 182 | 183 | b.Property("Value"); 184 | 185 | b.HasKey("UserId", "LoginProvider", "Name"); 186 | 187 | b.ToTable("AspNetUserTokens"); 188 | }); 189 | 190 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 191 | { 192 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 193 | .WithMany() 194 | .HasForeignKey("RoleId") 195 | .OnDelete(DeleteBehavior.Cascade); 196 | }); 197 | 198 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 199 | { 200 | b.HasOne("JobPortal.Models.User") 201 | .WithMany() 202 | .HasForeignKey("UserId") 203 | .OnDelete(DeleteBehavior.Cascade); 204 | }); 205 | 206 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 207 | { 208 | b.HasOne("JobPortal.Models.User") 209 | .WithMany() 210 | .HasForeignKey("UserId") 211 | .OnDelete(DeleteBehavior.Cascade); 212 | }); 213 | 214 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 215 | { 216 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 217 | .WithMany() 218 | .HasForeignKey("RoleId") 219 | .OnDelete(DeleteBehavior.Cascade); 220 | 221 | b.HasOne("JobPortal.Models.User") 222 | .WithMany() 223 | .HasForeignKey("UserId") 224 | .OnDelete(DeleteBehavior.Cascade); 225 | }); 226 | 227 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 228 | { 229 | b.HasOne("JobPortal.Models.User") 230 | .WithMany() 231 | .HasForeignKey("UserId") 232 | .OnDelete(DeleteBehavior.Cascade); 233 | }); 234 | #pragma warning restore 612, 618 235 | } 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /wwwroot/js/front.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Job Board Template 3 | * Copyright 2016-2018, Ondrej Svestka 4 | */ 5 | 6 | $(function () { 7 | 8 | map(); 9 | menuSliding(); 10 | 11 | // ------------------------------------------------------- // 12 | // Testimonials Slider 13 | // ------------------------------------------------------ // 14 | $(".testimonials").owlCarousel({ 15 | nav: false, 16 | dots: true, 17 | responsiveClass: true, 18 | responsive: { 19 | 0: { 20 | items: 1 21 | }, 22 | 600: { 23 | items: 1 24 | }, 25 | 1000: { 26 | items: 3 27 | }, 28 | 1200: { 29 | items: 4 30 | } 31 | } 32 | }); 33 | 34 | 35 | // ------------------------------------------------------- // 36 | // Bootstrap Select 37 | // ------------------------------------------------------ // 38 | $('.select2').selectpicker(); 39 | 40 | }); 41 | 42 | // ------------------------------------------------------- // 43 | // Styled Google Map 44 | // ------------------------------------------------------ // 45 | 46 | function map() { 47 | 48 | if ($('#map').length > 0) { 49 | 50 | 51 | function initMap() { 52 | 53 | var location = new google.maps.LatLng(50.0875726, 14.4189987); 54 | 55 | var mapCanvas = document.getElementById('map'); 56 | var mapOptions = { 57 | center: location, 58 | zoom: 16, 59 | panControl: false, 60 | mapTypeId: google.maps.MapTypeId.ROADMAP 61 | } 62 | var map = new google.maps.Map(mapCanvas, mapOptions); 63 | 64 | var markerImage = 'img/marker.png'; 65 | 66 | var marker = new google.maps.Marker({ 67 | position: location, 68 | map: map, 69 | icon: markerImage 70 | }); 71 | 72 | var contentString = '
    ' + 73 | '

    Info Window Content

    ' + 74 | '
    ' + 75 | '

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.

    ' + 76 | '
    ' + 77 | '
    '; 78 | 79 | var infowindow = new google.maps.InfoWindow({ 80 | content: contentString, 81 | maxWidth: 400 82 | }); 83 | 84 | marker.addListener('click', function () { 85 | infowindow.open(map, marker); 86 | }); 87 | 88 | var styles = [{ 89 | "featureType": "landscape", 90 | "stylers": [{ 91 | "saturation": -100 92 | }, { 93 | "lightness": 65 94 | }, { 95 | "visibility": "on" 96 | }] 97 | }, { 98 | "featureType": "poi", 99 | "stylers": [{ 100 | "saturation": -100 101 | }, { 102 | "lightness": 51 103 | }, { 104 | "visibility": "off" 105 | }] 106 | }, { 107 | "featureType": "road.highway", 108 | "stylers": [{ 109 | "saturation": -100 110 | }, { 111 | "visibility": "simplified" 112 | }] 113 | }, { 114 | "featureType": "road.arterial", 115 | "stylers": [{ 116 | "saturation": -100 117 | }, { 118 | "lightness": 30 119 | }, { 120 | "visibility": "on" 121 | }] 122 | }, { 123 | "featureType": "road.local", 124 | "stylers": [{ 125 | "saturation": -100 126 | }, { 127 | "lightness": 40 128 | }, { 129 | "visibility": "on" 130 | }] 131 | }, { 132 | "featureType": "transit", 133 | "stylers": [{ 134 | "saturation": -100 135 | }, { 136 | "visibility": "simplified" 137 | }] 138 | }, { 139 | "featureType": "administrative.province", 140 | "stylers": [{ 141 | "visibility": "off" 142 | }] 143 | }, { 144 | "featureType": "water", 145 | "elementType": "labels", 146 | "stylers": [{ 147 | "visibility": "on" 148 | }, { 149 | "lightness": -25 150 | }, { 151 | "saturation": -100 152 | }] 153 | }, { 154 | "featureType": "water", 155 | "elementType": "geometry", 156 | "stylers": [{ 157 | "hue": "#ffff00" 158 | }, { 159 | "lightness": -25 160 | }, { 161 | "saturation": -97 162 | }] 163 | }]; 164 | 165 | map.set('styles', styles); 166 | 167 | 168 | } 169 | 170 | google.maps.event.addDomListener(window, 'load', initMap); 171 | 172 | 173 | } 174 | 175 | } 176 | 177 | 178 | // ------------------------------------------------------- // 179 | // Sliding dropdowns 180 | // ------------------------------------------------------ // 181 | 182 | function menuSliding() { 183 | 184 | 185 | var dropdowns = $('.dropdown'); 186 | 187 | dropdowns.on('show.bs.dropdown', function (e) { 188 | 189 | var dropdownMenu = $(this).find('.dropdown-menu').first(); 190 | 191 | if ($(window).width() > 750) { 192 | dropdownMenu.stop(true, true).slideDown(); 193 | 194 | } else { 195 | dropdownMenu.stop(true, true).show(); 196 | } 197 | } 198 | 199 | ); 200 | dropdowns.on('hide.bs.dropdown', function (e) { 201 | 202 | var dropdownMenu = $(this).find('.dropdown-menu').first(); 203 | 204 | if ($(window).width() > 750) { 205 | dropdownMenu.stop(true, true).slideUp(); 206 | } else { 207 | dropdownMenu.stop(true, true).hide(); 208 | } 209 | }); 210 | 211 | } 212 | 213 | // ------------------------------------------------------- // 214 | // Utilities - tooltips, external links, scroll-to links 215 | // ------------------------------------------------------ // 216 | 217 | function utils() { 218 | 219 | /* tooltips */ 220 | 221 | $('[data-toggle="tooltip"]').tooltip(); 222 | 223 | /* click on the box activates the radio */ 224 | 225 | $('#checkout').on('click', '.box.shipping-method, .box.payment-method', function (e) { 226 | var radio = $(this).find(':radio'); 227 | radio.prop('checked', true); 228 | }); 229 | /* click on the box activates the link in it */ 230 | 231 | $('.box.clickable').on('click', function (e) { 232 | 233 | window.location = $(this).find('a').attr('href'); 234 | }); 235 | /* external links in new window*/ 236 | 237 | $('.external').on('click', function (e) { 238 | 239 | e.preventDefault(); 240 | window.open($(this).attr("href")); 241 | }); 242 | /* animated scrolling */ 243 | 244 | $('.scroll-to, .scroll-to-top').click(function (event) { 245 | 246 | var full_url = this.href; 247 | var parts = full_url.split("#"); 248 | if (parts.length > 1) { 249 | 250 | scrollTo(full_url); 251 | event.preventDefault(); 252 | } 253 | }); 254 | 255 | function scrollTo(full_url) { 256 | var parts = full_url.split("#"); 257 | var trgt = parts[1]; 258 | var target_offset = $("#" + trgt).offset(); 259 | var target_top = target_offset.top - 100; 260 | if (target_top < 0) { 261 | target_top = 0; 262 | } 263 | 264 | $('html, body').animate({ 265 | scrollTop: target_top 266 | }, 1000); 267 | } 268 | } 269 | 270 | // ------------------------------------------------------ // 271 | // For demo purposes, can be deleted 272 | // ------------------------------------------------------ // 273 | 274 | var stylesheet = $('link#theme-stylesheet'); 275 | $("").insertAfter(stylesheet); 276 | var alternateColour = $('link#new-stylesheet'); 277 | 278 | if ($.cookie("theme_csspath")) { 279 | alternateColour.attr("href", $.cookie("theme_csspath")); 280 | } 281 | 282 | $("#colour").change(function () { 283 | 284 | if ($(this).val() !== '') { 285 | 286 | var theme_csspath = 'css/style.' + $(this).val() + '.css'; 287 | 288 | alternateColour.attr("href", theme_csspath); 289 | 290 | $.cookie("theme_csspath", theme_csspath, { 291 | expires: 365, 292 | path: document.URL.substr(0, document.URL.lastIndexOf('/')) 293 | }); 294 | 295 | } 296 | 297 | return false; 298 | }); -------------------------------------------------------------------------------- /wwwroot/vendor/bootstrap-select/css/bootstrap-select.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap-select v1.13.1 (https://developer.snapappointments.com/bootstrap-select) 3 | * 4 | * Copyright 2012-2018 SnapAppointments, LLC 5 | * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) 6 | */.bootstrap-select>select.bs-select-hidden,select.bs-select-hidden,select.selectpicker{display:none!important}.bootstrap-select{width:220px\9}.bootstrap-select>.dropdown-toggle{position:relative;width:100%;z-index:1;text-align:right;white-space:nowrap}.bootstrap-select>.dropdown-toggle.bs-placeholder,.bootstrap-select>.dropdown-toggle.bs-placeholder:active,.bootstrap-select>.dropdown-toggle.bs-placeholder:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder:hover{color:#999}.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-danger,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-danger:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-danger:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-danger:hover,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-dark,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-dark:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-dark:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-dark:hover,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-info,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-info:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-info:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-info:hover,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-primary,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-primary:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-primary:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-primary:hover,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary:hover,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-success,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-success:active,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-success:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-success:hover{color:rgba(255,255,255,.5)}.bootstrap-select>select{position:absolute!important;bottom:0;left:50%;display:block!important;width:.5px!important;height:100%!important;padding:0!important;opacity:0!important;border:none}.bootstrap-select>select.mobile-device{top:0;left:0;display:block!important;width:100%!important;z-index:2}.bootstrap-select.is-invalid .dropdown-toggle,.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle,.was-validated .bootstrap-select .selectpicker:invalid+.dropdown-toggle{border-color:#b94a48}.bootstrap-select.is-valid .dropdown-toggle,.was-validated .bootstrap-select .selectpicker:valid+.dropdown-toggle{border-color:#28a745}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}:not(.input-group)>.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child)>.btn{border-radius:0}.bootstrap-select:not(.input-group-btn),.bootstrap-select[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.dropdown-menu-right,.bootstrap-select[class*=col-].dropdown-menu-right,.row .bootstrap-select[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select,.form-horizontal .bootstrap-select,.form-inline .bootstrap-select{margin-bottom:0}.form-group-lg .bootstrap-select.form-control,.form-group-sm .bootstrap-select.form-control{padding:0}.form-group-lg .bootstrap-select.form-control .dropdown-toggle,.form-group-sm .bootstrap-select.form-control .dropdown-toggle{height:100%;font-size:inherit;line-height:inherit;border-radius:inherit}.bootstrap-select.form-control-lg .dropdown-toggle,.bootstrap-select.form-control-sm .dropdown-toggle{font-size:inherit;line-height:inherit;border-radius:inherit}.bootstrap-select.form-control-sm .dropdown-toggle{padding:.25rem .5rem}.bootstrap-select.form-control-lg .dropdown-toggle{padding:.5rem 1rem}.form-inline .bootstrap-select .form-control{width:100%}.bootstrap-select.disabled,.bootstrap-select>.disabled{cursor:not-allowed}.bootstrap-select.disabled:focus,.bootstrap-select>.disabled:focus{outline:0!important}.bootstrap-select.bs-container{position:absolute;top:0;left:0;height:0!important;padding:0!important}.bootstrap-select.bs-container .dropdown-menu{z-index:1060}.bootstrap-select .dropdown-toggle:before{content:'';display:inline-block}.bootstrap-select .dropdown-toggle .filter-option{position:absolute;top:0;left:0;padding-top:inherit;padding-right:inherit;padding-bottom:inherit;padding-left:inherit;height:100%;width:100%;text-align:left}.bootstrap-select .dropdown-toggle .filter-option-inner{padding-right:inherit}.bootstrap-select .dropdown-toggle .filter-option-inner-inner{overflow:hidden}.bootstrap-select .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.input-group .bootstrap-select.form-control .dropdown-toggle{border-radius:inherit}.bootstrap-select[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select .dropdown-menu>.inner:focus{outline:0!important}.bootstrap-select .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select .dropdown-menu li{position:relative}.bootstrap-select .dropdown-menu li.active small{color:#fff}.bootstrap-select .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select .dropdown-menu li a span.check-mark{display:none}.bootstrap-select .dropdown-menu li a span.text{display:inline-block}.bootstrap-select .dropdown-menu li small{padding-left:.5em}.bootstrap-select .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.fit-width .dropdown-toggle .filter-option{position:static;display:inline;padding:0}.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner,.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner{display:inline}.bootstrap-select.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark{position:absolute;display:inline-block;right:15px;top:5px}.bootstrap-select.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select .bs-ok-default:after{content:'';display:block;width:.5em;height:1em;border-style:solid;border-width:0 .26em .26em 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle,.bootstrap-select.show-menu-arrow.show>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before{bottom:auto;top:-4px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after{bottom:auto;top:-4px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle .filter-option:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle .filter-option:before,.bootstrap-select.show-menu-arrow.show>.dropdown-toggle .filter-option:after,.bootstrap-select.show-menu-arrow.show>.dropdown-toggle .filter-option:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none} -------------------------------------------------------------------------------- /Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | 3 | @inject SignInManager SignInManager 4 | @inject UserManager UserManager 5 | 6 | @{ 7 | var user = await UserManager.GetUserAsync(User); 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Home - Job Portal 17 | 18 | 19 | 20 | 21 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 32 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | @RenderSection("Stylesheets", required: false) 46 | 47 | 48 |
    49 | 141 |
    142 |
    143 | 144 | @if (!string.IsNullOrEmpty(TempData["message"] as string)) 145 | { 146 | if (TempData["type"] as string == "sucess") 147 | { 148 |
    149 | @TempData["message"] 150 |
    151 | } 152 | else 153 | { 154 |
    155 | @TempData["message"] 156 |
    157 | } 158 | } 159 | @RenderBody() 160 |
    161 | 162 |
    163 | 176 | 185 |
    186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | @RenderSection("Scripts", required: false) 196 | 197 | -------------------------------------------------------------------------------- /Migrations/20190912185036_JobModel.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using JobPortal.Models; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace JobPortal.Migrations 10 | { 11 | [DbContext(typeof(ApplicationDbContext))] 12 | [Migration("20190912185036_JobModel")] 13 | partial class JobModel 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 64); 21 | 22 | modelBuilder.Entity("JobPortal.Models.Job", b => 23 | { 24 | b.Property("Id") 25 | .ValueGeneratedOnAdd(); 26 | 27 | b.Property("CompanyDescription"); 28 | 29 | b.Property("CompanyName"); 30 | 31 | b.Property("CreatedAt"); 32 | 33 | b.Property("Description"); 34 | 35 | b.Property("Filled"); 36 | 37 | b.Property("LastDate"); 38 | 39 | b.Property("Location"); 40 | 41 | b.Property("Title") 42 | .HasMaxLength(255); 43 | 44 | b.Property("Type"); 45 | 46 | b.Property("UserId"); 47 | 48 | b.Property("Website"); 49 | 50 | b.HasKey("Id"); 51 | 52 | b.HasIndex("UserId"); 53 | 54 | b.ToTable("Jobs"); 55 | }); 56 | 57 | modelBuilder.Entity("JobPortal.Models.User", b => 58 | { 59 | b.Property("Id") 60 | .ValueGeneratedOnAdd(); 61 | 62 | b.Property("AccessFailedCount"); 63 | 64 | b.Property("ConcurrencyStamp") 65 | .IsConcurrencyToken(); 66 | 67 | b.Property("Email") 68 | .HasMaxLength(256); 69 | 70 | b.Property("EmailConfirmed"); 71 | 72 | b.Property("FirstName") 73 | .HasMaxLength(20); 74 | 75 | b.Property("Gender") 76 | .IsRequired() 77 | .HasConversion(new ValueConverter(v => default(string), v => default(string), new ConverterMappingHints(size: 1))) 78 | .HasMaxLength(10); 79 | 80 | b.Property("LastName") 81 | .HasMaxLength(60); 82 | 83 | b.Property("LockoutEnabled"); 84 | 85 | b.Property("LockoutEnd"); 86 | 87 | b.Property("NormalizedEmail") 88 | .HasMaxLength(256); 89 | 90 | b.Property("NormalizedUserName") 91 | .HasMaxLength(256); 92 | 93 | b.Property("PasswordHash"); 94 | 95 | b.Property("PhoneNumber"); 96 | 97 | b.Property("PhoneNumberConfirmed"); 98 | 99 | b.Property("SecurityStamp"); 100 | 101 | b.Property("TwoFactorEnabled"); 102 | 103 | b.Property("UserName") 104 | .HasMaxLength(256); 105 | 106 | b.HasKey("Id"); 107 | 108 | b.HasIndex("NormalizedEmail") 109 | .HasName("EmailIndex"); 110 | 111 | b.HasIndex("NormalizedUserName") 112 | .IsUnique() 113 | .HasName("UserNameIndex"); 114 | 115 | b.ToTable("AspNetUsers"); 116 | }); 117 | 118 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => 119 | { 120 | b.Property("Id") 121 | .ValueGeneratedOnAdd(); 122 | 123 | b.Property("ConcurrencyStamp") 124 | .IsConcurrencyToken(); 125 | 126 | b.Property("Name") 127 | .HasMaxLength(256); 128 | 129 | b.Property("NormalizedName") 130 | .HasMaxLength(256); 131 | 132 | b.HasKey("Id"); 133 | 134 | b.HasIndex("NormalizedName") 135 | .IsUnique() 136 | .HasName("RoleNameIndex"); 137 | 138 | b.ToTable("AspNetRoles"); 139 | }); 140 | 141 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 142 | { 143 | b.Property("Id") 144 | .ValueGeneratedOnAdd(); 145 | 146 | b.Property("ClaimType"); 147 | 148 | b.Property("ClaimValue"); 149 | 150 | b.Property("RoleId") 151 | .IsRequired(); 152 | 153 | b.HasKey("Id"); 154 | 155 | b.HasIndex("RoleId"); 156 | 157 | b.ToTable("AspNetRoleClaims"); 158 | }); 159 | 160 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 161 | { 162 | b.Property("Id") 163 | .ValueGeneratedOnAdd(); 164 | 165 | b.Property("ClaimType"); 166 | 167 | b.Property("ClaimValue"); 168 | 169 | b.Property("UserId") 170 | .IsRequired(); 171 | 172 | b.HasKey("Id"); 173 | 174 | b.HasIndex("UserId"); 175 | 176 | b.ToTable("AspNetUserClaims"); 177 | }); 178 | 179 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 180 | { 181 | b.Property("LoginProvider"); 182 | 183 | b.Property("ProviderKey"); 184 | 185 | b.Property("ProviderDisplayName"); 186 | 187 | b.Property("UserId") 188 | .IsRequired(); 189 | 190 | b.HasKey("LoginProvider", "ProviderKey"); 191 | 192 | b.HasIndex("UserId"); 193 | 194 | b.ToTable("AspNetUserLogins"); 195 | }); 196 | 197 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 198 | { 199 | b.Property("UserId"); 200 | 201 | b.Property("RoleId"); 202 | 203 | b.HasKey("UserId", "RoleId"); 204 | 205 | b.HasIndex("RoleId"); 206 | 207 | b.ToTable("AspNetUserRoles"); 208 | }); 209 | 210 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 211 | { 212 | b.Property("UserId"); 213 | 214 | b.Property("LoginProvider"); 215 | 216 | b.Property("Name"); 217 | 218 | b.Property("Value"); 219 | 220 | b.HasKey("UserId", "LoginProvider", "Name"); 221 | 222 | b.ToTable("AspNetUserTokens"); 223 | }); 224 | 225 | modelBuilder.Entity("JobPortal.Models.Job", b => 226 | { 227 | b.HasOne("JobPortal.Models.User", "User") 228 | .WithMany() 229 | .HasForeignKey("UserId"); 230 | }); 231 | 232 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 233 | { 234 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 235 | .WithMany() 236 | .HasForeignKey("RoleId") 237 | .OnDelete(DeleteBehavior.Cascade); 238 | }); 239 | 240 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 241 | { 242 | b.HasOne("JobPortal.Models.User") 243 | .WithMany() 244 | .HasForeignKey("UserId") 245 | .OnDelete(DeleteBehavior.Cascade); 246 | }); 247 | 248 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 249 | { 250 | b.HasOne("JobPortal.Models.User") 251 | .WithMany() 252 | .HasForeignKey("UserId") 253 | .OnDelete(DeleteBehavior.Cascade); 254 | }); 255 | 256 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 257 | { 258 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 259 | .WithMany() 260 | .HasForeignKey("RoleId") 261 | .OnDelete(DeleteBehavior.Cascade); 262 | 263 | b.HasOne("JobPortal.Models.User") 264 | .WithMany() 265 | .HasForeignKey("UserId") 266 | .OnDelete(DeleteBehavior.Cascade); 267 | }); 268 | 269 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 270 | { 271 | b.HasOne("JobPortal.Models.User") 272 | .WithMany() 273 | .HasForeignKey("UserId") 274 | .OnDelete(DeleteBehavior.Cascade); 275 | }); 276 | #pragma warning restore 612, 618 277 | } 278 | } 279 | } 280 | -------------------------------------------------------------------------------- /Migrations/20190913055118_Update Job.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using JobPortal.Models; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace JobPortal.Migrations 10 | { 11 | [DbContext(typeof(ApplicationDbContext))] 12 | [Migration("20190913055118_Update Job")] 13 | partial class UpdateJob 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 64); 21 | 22 | modelBuilder.Entity("JobPortal.Models.Job", b => 23 | { 24 | b.Property("Id") 25 | .ValueGeneratedOnAdd(); 26 | 27 | b.Property("CompanyDescription"); 28 | 29 | b.Property("CompanyName"); 30 | 31 | b.Property("CreatedAt"); 32 | 33 | b.Property("Description"); 34 | 35 | b.Property("Filled"); 36 | 37 | b.Property("LastDate"); 38 | 39 | b.Property("Location"); 40 | 41 | b.Property("Title") 42 | .HasMaxLength(255); 43 | 44 | b.Property("Type"); 45 | 46 | b.Property("UserId"); 47 | 48 | b.Property("Website"); 49 | 50 | b.HasKey("Id"); 51 | 52 | b.HasIndex("UserId"); 53 | 54 | b.ToTable("Jobs"); 55 | }); 56 | 57 | modelBuilder.Entity("JobPortal.Models.User", b => 58 | { 59 | b.Property("Id") 60 | .ValueGeneratedOnAdd(); 61 | 62 | b.Property("AccessFailedCount"); 63 | 64 | b.Property("ConcurrencyStamp") 65 | .IsConcurrencyToken(); 66 | 67 | b.Property("Email") 68 | .HasMaxLength(256); 69 | 70 | b.Property("EmailConfirmed"); 71 | 72 | b.Property("FirstName") 73 | .HasMaxLength(20); 74 | 75 | b.Property("Gender") 76 | .IsRequired() 77 | .HasConversion(new ValueConverter(v => default(string), v => default(string), new ConverterMappingHints(size: 1))) 78 | .HasMaxLength(10); 79 | 80 | b.Property("LastName") 81 | .HasMaxLength(60); 82 | 83 | b.Property("LockoutEnabled"); 84 | 85 | b.Property("LockoutEnd"); 86 | 87 | b.Property("NormalizedEmail") 88 | .HasMaxLength(256); 89 | 90 | b.Property("NormalizedUserName") 91 | .HasMaxLength(256); 92 | 93 | b.Property("PasswordHash"); 94 | 95 | b.Property("PhoneNumber"); 96 | 97 | b.Property("PhoneNumberConfirmed"); 98 | 99 | b.Property("SecurityStamp"); 100 | 101 | b.Property("TwoFactorEnabled"); 102 | 103 | b.Property("UserName") 104 | .HasMaxLength(256); 105 | 106 | b.HasKey("Id"); 107 | 108 | b.HasIndex("NormalizedEmail") 109 | .HasName("EmailIndex"); 110 | 111 | b.HasIndex("NormalizedUserName") 112 | .IsUnique() 113 | .HasName("UserNameIndex"); 114 | 115 | b.ToTable("AspNetUsers"); 116 | }); 117 | 118 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => 119 | { 120 | b.Property("Id") 121 | .ValueGeneratedOnAdd(); 122 | 123 | b.Property("ConcurrencyStamp") 124 | .IsConcurrencyToken(); 125 | 126 | b.Property("Name") 127 | .HasMaxLength(256); 128 | 129 | b.Property("NormalizedName") 130 | .HasMaxLength(256); 131 | 132 | b.HasKey("Id"); 133 | 134 | b.HasIndex("NormalizedName") 135 | .IsUnique() 136 | .HasName("RoleNameIndex"); 137 | 138 | b.ToTable("AspNetRoles"); 139 | }); 140 | 141 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 142 | { 143 | b.Property("Id") 144 | .ValueGeneratedOnAdd(); 145 | 146 | b.Property("ClaimType"); 147 | 148 | b.Property("ClaimValue"); 149 | 150 | b.Property("RoleId") 151 | .IsRequired(); 152 | 153 | b.HasKey("Id"); 154 | 155 | b.HasIndex("RoleId"); 156 | 157 | b.ToTable("AspNetRoleClaims"); 158 | }); 159 | 160 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 161 | { 162 | b.Property("Id") 163 | .ValueGeneratedOnAdd(); 164 | 165 | b.Property("ClaimType"); 166 | 167 | b.Property("ClaimValue"); 168 | 169 | b.Property("UserId") 170 | .IsRequired(); 171 | 172 | b.HasKey("Id"); 173 | 174 | b.HasIndex("UserId"); 175 | 176 | b.ToTable("AspNetUserClaims"); 177 | }); 178 | 179 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 180 | { 181 | b.Property("LoginProvider"); 182 | 183 | b.Property("ProviderKey"); 184 | 185 | b.Property("ProviderDisplayName"); 186 | 187 | b.Property("UserId") 188 | .IsRequired(); 189 | 190 | b.HasKey("LoginProvider", "ProviderKey"); 191 | 192 | b.HasIndex("UserId"); 193 | 194 | b.ToTable("AspNetUserLogins"); 195 | }); 196 | 197 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 198 | { 199 | b.Property("UserId"); 200 | 201 | b.Property("RoleId"); 202 | 203 | b.HasKey("UserId", "RoleId"); 204 | 205 | b.HasIndex("RoleId"); 206 | 207 | b.ToTable("AspNetUserRoles"); 208 | }); 209 | 210 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 211 | { 212 | b.Property("UserId"); 213 | 214 | b.Property("LoginProvider"); 215 | 216 | b.Property("Name"); 217 | 218 | b.Property("Value"); 219 | 220 | b.HasKey("UserId", "LoginProvider", "Name"); 221 | 222 | b.ToTable("AspNetUserTokens"); 223 | }); 224 | 225 | modelBuilder.Entity("JobPortal.Models.Job", b => 226 | { 227 | b.HasOne("JobPortal.Models.User", "User") 228 | .WithMany() 229 | .HasForeignKey("UserId"); 230 | }); 231 | 232 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => 233 | { 234 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 235 | .WithMany() 236 | .HasForeignKey("RoleId") 237 | .OnDelete(DeleteBehavior.Cascade); 238 | }); 239 | 240 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => 241 | { 242 | b.HasOne("JobPortal.Models.User") 243 | .WithMany() 244 | .HasForeignKey("UserId") 245 | .OnDelete(DeleteBehavior.Cascade); 246 | }); 247 | 248 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => 249 | { 250 | b.HasOne("JobPortal.Models.User") 251 | .WithMany() 252 | .HasForeignKey("UserId") 253 | .OnDelete(DeleteBehavior.Cascade); 254 | }); 255 | 256 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => 257 | { 258 | b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") 259 | .WithMany() 260 | .HasForeignKey("RoleId") 261 | .OnDelete(DeleteBehavior.Cascade); 262 | 263 | b.HasOne("JobPortal.Models.User") 264 | .WithMany() 265 | .HasForeignKey("UserId") 266 | .OnDelete(DeleteBehavior.Cascade); 267 | }); 268 | 269 | modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => 270 | { 271 | b.HasOne("JobPortal.Models.User") 272 | .WithMany() 273 | .HasForeignKey("UserId") 274 | .OnDelete(DeleteBehavior.Cascade); 275 | }); 276 | #pragma warning restore 612, 618 277 | } 278 | } 279 | } 280 | --------------------------------------------------------------------------------