61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
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<IActionResult> 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();
|
|
}
|
|
|
|
public IActionResult Settings()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Calendar()
|
|
{
|
|
return View();
|
|
}
|
|
}
|
|
}
|