Skip to content

Commit 7d0991d

Browse files
committed
updated
1 parent bed6842 commit 7d0991d

8 files changed

Lines changed: 31 additions & 32 deletions

File tree

HRManagementSystem.Dtos/AdvertisementAppUserDtos/AdvertisementAppUserListDto.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace HRManagementSystem.Dtos
1+
namespace HRManagementSystem.Dtos
82
{
93
public class AdvertisementAppUserListDto
104
{
@@ -21,4 +15,4 @@ public class AdvertisementAppUserListDto
2115
public int WorkExperince { get; set; }
2216
public string CvPath { get; set; }
2317
}
24-
}
18+
}

HRManagementSystem.UI/Controllers/AdvertisementController.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public AdvertisementController(IAppUserService appUserService, IAdvertisementApp
2222

2323

2424
[Authorize(Roles = "Member")]
25-
[HttpGet]
2625
public async Task<IActionResult> Send(int advertisementId)
2726
{
2827
var userId = int.Parse((User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier)).Value);
2928
var userResponse = await _appUserService.GetByIdAsync<AppUserListDto>(userId);
3029

3130
ViewBag.GenderId = userResponse.Data.GenderId;
31+
3232
var items = Enum.GetValues(typeof(MilitaryStatusType));
3333

3434
var list = new List<MilitaryStatusListDto>();
@@ -38,18 +38,20 @@ public async Task<IActionResult> Send(int advertisementId)
3838
list.Add(new MilitaryStatusListDto
3939
{
4040
Id = item,
41-
Definition = Enum.GetName(typeof(MilitaryStatusType), item)
41+
Definition = Enum.GetName(typeof(MilitaryStatusType), item),
4242
});
4343
}
4444

4545
ViewBag.MilitaryStatus = new SelectList(list, "Id", "Definition");
46-
return View(new AdvertisementAppUserCreateModel()
46+
47+
return View(new AdvertisementAppUserCreateModel
4748
{
4849
AdvertisementId = advertisementId,
4950
AppUserId = userId,
5051
});
5152
}
5253

54+
5355
[Authorize(Roles = "Member")]
5456
[HttpPost]
5557
public async Task<IActionResult> Send(AdvertisementAppUserCreateModel model)
@@ -73,7 +75,6 @@ public async Task<IActionResult> Send(AdvertisementAppUserCreateModel model)
7375
dto.WorkExperience = model.WorkExperience;
7476

7577
var response = await _advertisementAppUserService.CreateAsync(dto);
76-
7778
if (response.ResponseType == Common.Objects.ResponseType.ValidationError)
7879
{
7980
foreach (var error in response.ValidationErrors)
@@ -95,23 +96,25 @@ public async Task<IActionResult> Send(AdvertisementAppUserCreateModel model)
9596
list.Add(new MilitaryStatusListDto
9697
{
9798
Id = item,
98-
Definition = Enum.GetName(typeof(MilitaryStatusType), item)
99+
Definition = Enum.GetName(typeof(MilitaryStatusType), item),
99100
});
100101
}
101102

102103
ViewBag.MilitaryStatus = new SelectList(list, "Id", "Definition");
103104

104105
return View(model);
105106
}
106-
107-
return RedirectToAction("HumanResources", "Home");
107+
else
108+
{
109+
return RedirectToAction("HumanResource", "Home");
110+
}
108111
}
109112

110113
[Authorize(Roles = "Admin")]
111114
public async Task<IActionResult> List()
112115
{
113116
var list = await _advertisementAppUserService.GetList(AdvertisementAppUserStatusType.Applied);
114-
return View();
117+
return View(list);
115118
}
116119

117120
[Authorize(Roles = "Admin")]

HRManagementSystem.UI/Controllers/ApplicationController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public IActionResult Create()
2727
return View(new AdvertisementCreateDto());
2828
}
2929

30-
3130
[HttpPost]
3231
public async Task<IActionResult> Create(AdvertisementCreateDto dto)
3332
{

HRManagementSystem.UI/HRManagementSystem.UI.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
@@ -38,6 +38,7 @@
3838

3939
<ItemGroup>
4040
<ProjectReference Include="..\HRManagementSystem.Business\HRManagementSystem.Business.csproj" />
41+
<ProjectReference Include="..\HRManagementSystem.Common\HRManagementSystem.Common.csproj" />
4142
</ItemGroup>
4243

4344
<ItemGroup>

HRManagementSystem.UI/Views/Advertisement/List.cshtml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
if (Model?.Count > 0)
1111
{
1212
<div class="text-end my-3">
13-
<a asp-action="ApprovedList" asp-controller="Advertisement">Applications invited for interview</a>
14-
<a asp-action="RejectedList" asp-controller="Advertisement">Rejected Application</a>
13+
<a class="btn btn-info" asp-action="ApprovedList" asp-controller="Advertisement">Interview</a>
14+
<a class="btn btn-warning" asp-action="RejectedList" asp-controller="Advertisement">Rejected</a>
1515
</div>
1616
<table class="table mt-3 table-sm table-hover table-striped">
1717
<thead>
@@ -35,27 +35,30 @@
3535
<td>@advertisementAppUser.AppUser.Gender.Definition</td>
3636
<td>@advertisementAppUser.AdvertisementAppUserStatus.Definition</td>
3737
<td>@advertisementAppUser.MilitaryStatus.Definition</td>
38-
<td>@(advertisementAppUser.EndDate == null ? "Exempt or have completed military service" : advertisementAppUser.EndDate?.ToString("dddd,dd MMMM yyyy"))</td>
38+
<td>@(advertisementAppUser.EndDate == null ? "Muaf yada yapmış" : advertisementAppUser.EndDate?.ToString("dddd, dd MMMM yyyy"))</td>
3939
<td>@advertisementAppUser.WorkExperince</td>
4040
<td>
41-
<a asp-action="SetStatus" asp-controller="Advertisement" asp-route-advertisementAppUserId="@advertisementAppUser.Id" asp-route-type="@((int)AdvertisementAppUserStatusType.Interview)">Interview</a>
42-
<a asp-action="SetStatus" asp-controller="Advertisement" asp-route-advertisementAppUserId="@advertisementAppUser.Id" asp-route-type="@((int)AdvertisementAppUserStatusType.Negative)">Reject</a>
41+
<div>
42+
<a class="btn btn-sm btn-success" asp-action="SetStatus" asp-controller="Advertisement" asp-route-advertisementAppUserId="@advertisementAppUser.Id" asp-route-type="@((int)AdvertisementAppUserStatusType.Interview)">Interview</a></div>
43+
44+
<div>
45+
<a class="btn btn-sm btn-danger" asp-action="SetStatus" asp-controller="Advertisement" asp-route-advertisementAppUserId="@advertisementAppUser.Id" asp-route-type="@((int)AdvertisementAppUserStatusType.Negative)">Reject</a>
46+
</div>
4347
</td>
4448
</tr>
45-
4649
}
4750
</tbody>
4851
</table>
4952
}
5053
else
5154
{
5255
<div class="text-end my-3">
53-
<a asp-action="ApprovedList" asp-controller="Advertisement">Applications invited for interview</a>
54-
<a asp-action="RejectedList" asp-asp-controller="Advertisement">Rejected Application</a>
56+
<a class="btn btn-info" asp-action="ApprovedList" asp-controller="Advertisement">Interview</a>
57+
<a class="btn btn-warning" asp-action="RejectedList" asp-controller="Advertisement">Rejected</a>
5558
</div>
5659

5760
<div class="mt-3 text-center lead">
58-
There is no application!
61+
There is no advertisement!
5962
</div>
6063
}
6164
}

HRManagementSystem.UI/Views/Application/List.cshtml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
ViewData["Title"] = "List";
55
Layout = "~/Views/Shared/_Layout.cshtml";
66
}
7+
78
<div class="container-fluid">
89
@{
9-
1010
if (Model?.Count > 0)
1111
{
1212
<div class="text-end my-3">
@@ -26,25 +26,24 @@
2626
<tr>
2727
<td>@advertisement.Title</td>
2828
<td>@advertisement.CreatedDate.ToString("dddd,dd MMMM yyyy")</td>
29-
<td>@(advertisement.Status == true ? "Active" : "Passive")</td>
29+
<td>@(advertisement.Status? "Active" : "Passive")</td>
3030
<td>
3131
<a asp-action="Update" asp-controller="Application" asp-route-id="@advertisement.Id">Update</a>
3232
<a asp-action="Remove" asp-controller="Application" asp-route-id="@advertisement.Id">Remove</a>
3333
</td>
3434
</tr>
35-
3635
}
3736
</tbody>
3837
</table>
3938
}
4039
else
4140
{
4241
<div class="text-end my-3">
43-
<a asp-action="Create" asp-asp-controller="Application">New Application</a>
42+
<a asp-action="Create" asp-asp-controller="Application" class="btn btn-primary">New Application</a>
4443
</div>
4544

4645
<div class="mt-3 text-center lead">
47-
There is no advertisement!
46+
There is no application!
4847
</div>
4948
}
5049
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)