This commit is contained in:
parent
95513f0e10
commit
9f3388eb20
2 changed files with 8 additions and 28 deletions
|
|
@ -143,7 +143,6 @@ namespace BMA.EHR.Application.Repositories
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<RetirementResignEmployee>().AsQueryable()
|
var data = await _dbContext.Set<RetirementResignEmployee>().AsQueryable()
|
||||||
.AsNoTracking()
|
|
||||||
.Include(x => x.Approvers)
|
.Include(x => x.Approvers)
|
||||||
.FirstOrDefaultAsync(x => x.Id == id);
|
.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
|
||||||
|
|
@ -155,15 +154,6 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public async Task<RetirementResignEmployee?> GetByIdWithTrackingAsync(Guid id)
|
|
||||||
{
|
|
||||||
var data = await _dbContext.Set<RetirementResignEmployee>().AsQueryable()
|
|
||||||
//.AsNoTracking()
|
|
||||||
.Include(x => x.Approvers)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == id);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
public async Task OfficerApproveRetirementResignEmployee(Guid id)
|
public async Task OfficerApproveRetirementResignEmployee(Guid id)
|
||||||
{
|
{
|
||||||
var rawData = await GetByIdAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
|
|
@ -200,7 +190,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -312,7 +302,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -398,7 +388,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
// Get UserId from token
|
// Get UserId from token
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -474,7 +464,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
// Get UserId from token
|
// Get UserId from token
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,6 @@ namespace BMA.EHR.Application.Repositories
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<RetirementResign>().AsQueryable()
|
var data = await _dbContext.Set<RetirementResign>().AsQueryable()
|
||||||
.AsNoTracking()
|
|
||||||
.Include(x => x.Approvers)
|
.Include(x => x.Approvers)
|
||||||
.FirstOrDefaultAsync(x => x.Id == id);
|
.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
|
||||||
|
|
@ -155,15 +154,6 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public async Task<RetirementResign?> GetByIdWithTrackingAsync(Guid id)
|
|
||||||
{
|
|
||||||
var data = await _dbContext.Set<RetirementResign>().AsQueryable()
|
|
||||||
//.AsNoTracking()
|
|
||||||
.Include(x => x.Approvers)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == id);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
public async Task OfficerApproveRetirementResign(Guid id)
|
public async Task OfficerApproveRetirementResign(Guid id)
|
||||||
{
|
{
|
||||||
var rawData = await GetByIdAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
|
|
@ -198,7 +188,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -309,7 +299,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -394,7 +384,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
// Get UserId from token
|
// Get UserId from token
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
@ -473,7 +463,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
// Get UserId from token
|
// Get UserId from token
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
var rawData = await GetByIdWithTrackingAsync(id);
|
var rawData = await GetByIdAsync(id);
|
||||||
if (rawData == null)
|
if (rawData == null)
|
||||||
{
|
{
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue