Compare commits
3 Commits
7b0a1b0073
...
c4dcd589db
Author | SHA1 | Date | |
---|---|---|---|
c4dcd589db | |||
414bf7ece1 | |||
ac6f52ce16 |
@ -38,17 +38,12 @@ namespace MarcoBMS.Services.Controllers
|
||||
//var tenant = User.FindFirst("TenantId")?.Value;
|
||||
//return (tenant != null ? Convert.ToInt32(tenant) : 1);
|
||||
}
|
||||
private int GetUserId()
|
||||
{
|
||||
var tenant = User.FindFirst("Id")?.Value;
|
||||
return (tenant != null ? Convert.ToInt32(tenant) : 1);
|
||||
}
|
||||
|
||||
[HttpGet("log/attendance/{attendanceid}")]
|
||||
|
||||
public async Task<IActionResult> GetAttendanceLogById(int attendanceid)
|
||||
{
|
||||
int TenantId = GetUserId();
|
||||
int TenantId = GetTenantId();
|
||||
|
||||
List<AttendanceLog> lstAttendance = await _context.AttendanceLogs.Where(c => c.AttendanceId == attendanceid && c.TenantId == TenantId).ToListAsync();
|
||||
|
||||
@ -59,7 +54,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
public async Task<IActionResult> GetAttendanceLogByEmployeeId(int employeeid, [FromQuery] string? date = null)
|
||||
{
|
||||
int TenantId = GetUserId();
|
||||
int TenantId = GetTenantId();
|
||||
DateOnly forDate = new DateOnly();
|
||||
|
||||
if (date != null && DateOnly.TryParse(date, out forDate) == false)
|
||||
@ -84,7 +79,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
public async Task<IActionResult> EmployeeAttendanceByDateRange([FromQuery] int projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null)
|
||||
{
|
||||
int TenantId = GetUserId();
|
||||
int TenantId = GetTenantId();
|
||||
DateTime fromDate = new DateTime();
|
||||
DateTime toDate = new DateTime();
|
||||
|
||||
@ -149,9 +144,9 @@ namespace MarcoBMS.Services.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("project/team")]
|
||||
|
||||
public async Task<IActionResult> EmployeeAttendanceByProject([FromQuery] int projectId, [FromQuery] string? date = null)
|
||||
public async Task<IActionResult> EmployeeAttendanceByProject([FromQuery] int projectId, [FromQuery] bool IncludeInActive, [FromQuery] string? date = null)
|
||||
{
|
||||
int TenantId = GetUserId();
|
||||
int TenantId = GetTenantId();
|
||||
DateTime forDate = new DateTime();
|
||||
|
||||
if (date != null && DateTime.TryParse(date, out forDate) == false)
|
||||
@ -172,7 +167,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
List<Attendance> lstAttendance = await _context.Attendes.Where(c => c.ProjectID == projectId && c.AttendanceDate.Date == forDate && c.TenantId == TenantId).ToListAsync();
|
||||
|
||||
|
||||
List<ProjectAllocation> projectteam = await _projectsHelper.GetTeamByProject(TenantId, projectId, true);
|
||||
List<ProjectAllocation> projectteam = await _projectsHelper.GetTeamByProject(TenantId, projectId, IncludeInActive);
|
||||
foreach (ProjectAllocation teamMember in projectteam)
|
||||
{
|
||||
|
||||
@ -304,7 +299,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
Longitude = recordAttendanceDot.Longitude,
|
||||
|
||||
TenantId = TenantId,
|
||||
UpdatedBy = GetUserId(),
|
||||
UpdatedBy = recordAttendanceDot.EmployeeID,
|
||||
UpdatedOn = recordAttendanceDot.Date
|
||||
};
|
||||
//if (recordAttendanceDot.Image != null && recordAttendanceDot.Image.Count > 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user