diff --git a/Areas/OTcalculate/Controllers/HrDashboardController.cs b/Areas/OTcalculate/Controllers/HrDashboardController.cs index 5e515d1..72bcf1e 100644 --- a/Areas/OTcalculate/Controllers/HrDashboardController.cs +++ b/Areas/OTcalculate/Controllers/HrDashboardController.cs @@ -1,10 +1,47 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using PSTW_CentralSystem.Areas.OTcalculate.Models; +using PSTW_CentralSystem.DBContext; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; namespace PSTW_CentralSystem.Areas.OTcalculate.Controllers { [Area("OTcalculate")] public class HrDashboardController : Controller { + private readonly CentralSystemContext _context; + + public HrDashboardController(CentralSystemContext context) + { + _context = context; + } + + [HttpGet] + public async Task GetRateList() + { + var users = await _context.Users + .Where(u => u.Id != 1 && u.Id != 2) + .Include(u => u.Department) + .Select(u => new RateModel + { + Id = u.Id.ToString(), + FullName = u.FullName, + departmentId = u.departmentId, + DepartmentName = u.Department != null ? u.Department.DepartmentName : "N/A" + }) + .ToListAsync(); + + return Json(users); + } + + public IActionResult Rate() + { + return View(); + } + public IActionResult OtApproval() { return View(); @@ -15,11 +52,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Controllers return View(); } - public IActionResult Rate() - { - return View(); - } - public IActionResult Calendar() { return View(); diff --git a/Areas/OTcalculate/Models/CalendarModel.cs b/Areas/OTcalculate/Models/CalendarModel.cs new file mode 100644 index 0000000..9c39e80 --- /dev/null +++ b/Areas/OTcalculate/Models/CalendarModel.cs @@ -0,0 +1,6 @@ +namespace PSTW_CentralSystem.Areas.OTcalculate.Models +{ + public class CalendarModel + { + } +} diff --git a/Areas/OTcalculate/Models/RateModel.cs b/Areas/OTcalculate/Models/RateModel.cs index bde8851..e3b7658 100644 --- a/Areas/OTcalculate/Models/RateModel.cs +++ b/Areas/OTcalculate/Models/RateModel.cs @@ -6,6 +6,17 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Models { public class RateModel { + [Key] + public required string Id { get; set; } + + public required string FullName { get; set; } + + public int? departmentId { get; set; } + + [ForeignKey("departmentId")] + public virtual DepartmentModel? Department { get; set; } + + public string? DepartmentName { get; set; } } } diff --git a/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml b/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml index c61132d..fef2412 100644 --- a/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml +++ b/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml @@ -3,10 +3,129 @@ Layout = "~/Views/Shared/_Layout.cshtml"; } -
-
-
-

Name:

+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers + \ No newline at end of file +
+ + +
+
+ @* Holiday *@ +
+
+
+

UPDATE HOLIDAY

+
+
+ + + + +
+
+ + +
+
+ + + + +
+ + +
+
+
+
+ + @* Weekend *@ +
+
+
+

UPDATE WEEKEND

+
+
+ +
+
+ + +
+
+ + + + +
+ + +
+
+
+
+
+ + @* Updated Data*@ +
+
+
+
+

Holiday Updates

+
+
+
    +
  • + {{ holiday.Date }}: {{ holiday.HolidayName }} ({{ holiday.States.join(', ') }}) +
  • +
+
+
+
+ +
+
+
+

Weekend Updates

+
+
+
    +
  • + {{ weekend.States.join(', ') }}: {{ weekend.WeekendDays }} +
  • +
+
+
+
+
+
diff --git a/Areas/OTcalculate/Views/HrDashboard/Rate.cshtml b/Areas/OTcalculate/Views/HrDashboard/Rate.cshtml index 68cd433..84ecf71 100644 --- a/Areas/OTcalculate/Views/HrDashboard/Rate.cshtml +++ b/Areas/OTcalculate/Views/HrDashboard/Rate.cshtml @@ -1,90 +1,98 @@ -@{ +@model List + +@{ ViewData["Title"] = "Rate Update"; Layout = "~/Views/Shared/_Layout.cshtml"; } @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -
-
- -
-

- -

-
Rate
+
- -
-
-
-
-
-
-
-
-
-
-

UPDATE RATE

-
-
-
+
+
+
+ +
+
+
+
+
+
+

UPDATE RATE

+
+
+
- @* Enter Rate *@ + @* Enter Rate *@
- -
- -
-
- + +
+
-
-
-
-
-
-
-
-
-
+
+
+
+ @* User Table Rate *@ +
+
+
+
+
+
+
+
-
- +
-
+
+
+
+ @section Scripts { @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} - - +} \ No newline at end of file diff --git a/Areas/OTcalculate/Views/HrDashboard/Settings.cshtml b/Areas/OTcalculate/Views/HrDashboard/Settings.cshtml index 40acac7..39779cc 100644 --- a/Areas/OTcalculate/Views/HrDashboard/Settings.cshtml +++ b/Areas/OTcalculate/Views/HrDashboard/Settings.cshtml @@ -4,31 +4,36 @@ } @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -