api รายงาน + Reopen Issue
This commit is contained in:
parent
d5a78f2d0f
commit
48892556fd
10 changed files with 662 additions and 10 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Models.HR;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using BMA.EHR.Domain.Shared;
|
||||
|
|
@ -83,7 +84,38 @@ namespace BMA.EHR.Application.Repositories
|
|||
{
|
||||
try
|
||||
{
|
||||
var data = _dbContext.Set<Profile>().AsQueryable();
|
||||
var data = _dbContext.Set<Profile>().AsQueryable()
|
||||
.Where(x => x.ProfileType == "officer");
|
||||
|
||||
|
||||
if (citizenId != null)
|
||||
data = data.Where(x => x.CitizenId!.Contains(citizenId));
|
||||
|
||||
if (firstName != null)
|
||||
data = data.Where(x => x.FirstName!.Contains(firstName));
|
||||
|
||||
if (lastName != null)
|
||||
data = data.Where(x => x.LastName!.Contains(lastName));
|
||||
|
||||
data = data.Include(x => x.Prefix)
|
||||
.Include(x => x.Position)
|
||||
.Include(x => x.PositionLevel)
|
||||
.Include(x => x.PosNo);
|
||||
|
||||
return await data.ToListAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<Profile>> SearchProfileEmployee(string? citizenId, string? firstName, string? lastName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = _dbContext.Set<Profile>().AsQueryable()
|
||||
.Where(x => x.ProfileType == "employee");
|
||||
|
||||
|
||||
if (citizenId != null)
|
||||
|
|
@ -96,6 +128,8 @@ namespace BMA.EHR.Application.Repositories
|
|||
data = data.Where(x => x.LastName!.Contains(lastName));
|
||||
|
||||
data = data.Include(x => x.Prefix);
|
||||
//.Include(x => x.PosNoEmployee);
|
||||
|
||||
|
||||
return await data.ToListAsync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue