Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2024-12-26 15:10:13 +07:00
commit 3bb92d337a
23 changed files with 1539 additions and 570 deletions

File diff suppressed because it is too large Load diff

View file

@ -223,7 +223,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
} }
if (IsSendMail == true) if (IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
//} //}
@ -268,7 +283,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
}*/ }*/
if (IsSendMail == true) if (IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
} }
@ -327,7 +357,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
} }
if (IsSendMail == true) if (IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
@ -343,6 +388,11 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
public Guid ReceiverUserId { get; set; } public Guid ReceiverUserId { get; set; }
public string NotiLink { get; set; } public string NotiLink { get; set; }
} }
public class ResultRequest
{
public string result { get; set; }
}
public async Task PushNotificationsLinkAsync(NotisLinkRequest[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false) public async Task PushNotificationsLinkAsync(NotisLinkRequest[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false)
{ {
try try
@ -380,7 +430,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
} }
if (IsSendMail == true) if (IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId.ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
@ -435,7 +500,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
} }
if (data.IsSendMail == true) if (data.IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{data.ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
@ -482,7 +562,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
} }
if (IsSendMail == true) if (IsSendMail == true)
{ {
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
} }
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
} }

View file

@ -94,7 +94,7 @@ namespace BMA.EHR.Application.Responses.Profiles
public Guid? LastUpdateUserId { get; set; } public Guid? LastUpdateUserId { get; set; }
public string? CreatedFullName { get; set; } public string? CreatedFullName { get; set; }
public string? LastUpdateFullName { get; set; } public string? LastUpdateFullName { get; set; }
public string PosNo { get; set; } = string.Empty; public string? PosNo { get; set; } = string.Empty;
public double? Amount { get; set; } public double? Amount { get; set; }
@ -102,15 +102,15 @@ namespace BMA.EHR.Application.Responses.Profiles
public double? MouthSalaryAmount { get; set; } public double? MouthSalaryAmount { get; set; }
public int Order { get; set; } public int? Order { get; set; }
public DateTime? Date { get; set; } public DateTime? Date { get; set; }
public string PositionLevel { get; set; } = string.Empty; public string? PositionLevel { get; set; } = string.Empty;
public string PositionType { get; set; } = string.Empty; public string? PositionType { get; set; } = string.Empty;
public string Position { get; set; } = string.Empty; public string? Position { get; set; } = string.Empty;
} }

View file

@ -1039,6 +1039,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new { result.Add(new {
fullName = _null, fullName = _null,
positionname = r.RemarkHorizontal, positionname = r.RemarkHorizontal,
@ -1047,6 +1048,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
salary = _null, salary = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -14,16 +14,16 @@
"AllowedHosts": "*", "AllowedHosts": "*",
"ConnectionStrings": { "ConnectionStrings": {
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
//"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" //"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=53636;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
//"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", //"DefaultConnection": "server=hrms.chin.in.th;user=root;password=adminVM123;port=53636;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", "LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" "DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
}, },
"Jwt": { "Jwt": {
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", "Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr" "Issuer": "https://hrms-id.chin.in.th/realms/hrms"
}, },
"EPPlus": { "EPPlus": {
"ExcelPackage": { "ExcelPackage": {
@ -42,9 +42,9 @@
}, },
"Protocol": "HTTPS", "Protocol": "HTTPS",
"Node": { "Node": {
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation" "API": "https://hrms.chin.in.th/api/v1/probation"
}, },
"API": "https://bma-ehr.frappet.synology.me/api/v1", "API": "https://hrms.chin.in.th/api/v1",
"RabbitMQ": { "RabbitMQ": {
"URL": "localhost", "URL": "localhost",
"UserName": "frappet", "UserName": "frappet",

View file

@ -0,0 +1,97 @@
using BMA.EHR.Domain.Common;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.MetaData.Service.Request;
using BMA.EHR.MetaData.Service.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
namespace BMA.EHR.MetaData.Service.Controllers
{
[Route("api/v{version:apiVersion}/metadata/main")]
[ApiVersion("1.0")]
[ApiController]
[Produces("application/json")]
[Authorize]
[SwaggerTag("จัดการข้อมูลตำแหน่ง เพื่อนำไปใช้งานในระบบ")]
public class MainController : BaseController
{
#region " Fields "
private readonly BloodGroupService _bloodGroupService;
private readonly EducationLevelService _educationLevelService;
private readonly GenderService _genderService;
private readonly ProvinceService _provinceService;
private readonly PrefixService _prefixService;
private readonly RelationshipService _relationshipService;
private readonly ReligionService _religionService;
#endregion
#region " Constructor and Destructor "
public MainController(
BloodGroupService bloodGroupService,
ProvinceService provinceService,
EducationLevelService educationLevelService,
GenderService genderService,
PrefixService prefixService,
RelationshipService relationshipService,
ReligionService religionService)
{
_bloodGroupService = bloodGroupService;
_provinceService = provinceService;
_educationLevelService = educationLevelService;
_genderService = genderService;
_prefixService = prefixService;
_relationshipService = relationshipService;
_religionService = religionService;
}
#endregion
#region " Methods "
/// <summary>
/// อ่านข้อมูล ข้อมูลเกี่ยวกับบุคคล
/// </summary>
/// <returns></returns>
/// <response code="200">อ่านข้อมูล ข้อมูลเกี่ยวกับบุคคล สำเร็จ</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("person")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> GetsMainPersonAsync()
{
try
{
var bloodGroups = await _bloodGroupService.GetsAsync(showAll: false);
var provinces = await _provinceService.GetsAsync(showAll: false);
var educationLevels = await _educationLevelService.GetsAsync(showAll: false);
var genders = await _genderService.GetsAsync(showAll: false);
var prefixs = await _prefixService.GetsAsync(showAll: false);
var relationships = await _relationshipService.GetsAsync(showAll: false);
var religions = await _religionService.GetsAsync(showAll: false);
return Success(new
{
bloodGroups,
provinces,
educationLevels,
genders,
prefixs,
relationships,
religions,
});
}
catch (Exception ex)
{
return Error(ex);
}
}
#endregion
}
}

View file

@ -89,6 +89,14 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<PositionPathService>(); builder.Services.AddTransient<PositionPathService>();
builder.Services.AddTransient<PositionPathSideService>(); builder.Services.AddTransient<PositionPathSideService>();
builder.Services.AddTransient<PositionTypeService>(); builder.Services.AddTransient<PositionTypeService>();
builder.Services.AddTransient<BloodGroupService>();
builder.Services.AddTransient<EducationLevelService>();
builder.Services.AddTransient<GenderService>();
builder.Services.AddTransient<ProvinceService>();
builder.Services.AddTransient<PrefixService>();
builder.Services.AddTransient<RelationshipService>();
builder.Services.AddTransient<ReligionService>();
builder.Services.AddControllers(options => builder.Services.AddControllers(options =>
{ {
options.SuppressAsyncSuffixInActionNames = false; options.SuppressAsyncSuffixInActionNames = false;

View file

@ -0,0 +1,92 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class BloodGroupService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ILogger<BloodGroupService> _logger;
#endregion
#region " Constructor and Destructor "
public BloodGroupService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor,
ILogger<BloodGroupService> logger)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
_logger = logger;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<BloodGroup>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.BloodGroups.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.BloodGroups.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<BloodGroup?> GetByIdAsync(Guid id)
{
return await _context.BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, BloodGroup updated)
{
var existData = await _context.BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdatedAt = DateTime.Now;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(BloodGroup inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.BloodGroups.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -0,0 +1,90 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class EducationLevelService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public EducationLevelService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<EducationLevel>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.EducationLevels.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.EducationLevels.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<EducationLevel?> GetByIdAsync(Guid id)
{
return await _context.EducationLevels.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, EducationLevel updated)
{
var existData = await _context.EducationLevels.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdatedAt = DateTime.Now;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(EducationLevel inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.EducationLevels.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -0,0 +1,90 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class GenderService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public GenderService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<Gender>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.Genders.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.Genders.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<Gender?> GetByIdAsync(Guid id)
{
return await _context.Genders.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, Gender updated)
{
var existData = await _context.Genders.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdatedAt = DateTime.Now;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(Gender inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.Genders.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -0,0 +1,90 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class PrefixService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public PrefixService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<Prefix>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.Prefixes.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.Prefixes.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<Prefix?> GetByIdAsync(Guid id)
{
return await _context.Prefixes.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, Prefix updated)
{
var existData = await _context.Prefixes.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
existData.LastUpdatedAt = DateTime.Now;
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(Prefix inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.Prefixes.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -0,0 +1,93 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class ProvinceService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public ProvinceService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<Province>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.Provinces.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.Provinces.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<Province?> GetByIdAsync(Guid id)
{
return await _context.Provinces
.AsQueryable()
.Include(x => x.Districts)
.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, Province updated)
{
var existData = await _context.Provinces.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdatedAt = DateTime.Now;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(Province inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.Provinces.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -0,0 +1,89 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services;
public class RelationshipService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public RelationshipService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<Relationship>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.Relationships.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.Relationships.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<Relationship?> GetByIdAsync(Guid id)
{
return await _context.Relationships.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, Relationship updated)
{
var existData = await _context.Relationships.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
existData.LastUpdatedAt = DateTime.Now;
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(Relationship inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.Relationships.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}

View file

@ -0,0 +1,90 @@
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using System.Security.Claims;
namespace BMA.EHR.MetaData.Service.Services
{
public class ReligionService
{
#region " Fields "
private readonly ApplicationDBContext _context;
private readonly IHttpContextAccessor _httpContextAccessor;
#endregion
#region " Constructor and Destructor "
public ReligionService(ApplicationDBContext context,
IHttpContextAccessor httpContextAccessor)
{
_context = context;
_httpContextAccessor = httpContextAccessor;
}
#endregion
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
#endregion
#region " Methods "
public async Task<IEnumerable<Religion>> GetsAsync(bool showAll = true)
{
if (showAll)
return await _context.Religions.AsQueryable()
.OrderBy(d => d.Name)
.ToListAsync();
else
return await _context.Religions.AsQueryable()
.Where(p => p.IsActive)
.OrderBy(d => d.Name)
.ToListAsync();
}
public async Task<Religion?> GetByIdAsync(Guid id)
{
return await _context.Religions.FirstOrDefaultAsync(x => x.Id == id);
}
public async Task UpdateAsync(Guid id, Religion updated)
{
var existData = await _context.Religions.FirstOrDefaultAsync(x => x.Id == id);
if (existData != null)
{
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
{
existData.Name = updated.Name;
existData.IsActive = updated.IsActive;
existData.LastUpdateUserId = UserId ?? "";
existData.LastUpdateFullName = FullName ?? "";
existData.LastUpdatedAt = DateTime.Now;
}
await _context.SaveChangesAsync();
}
}
public async Task CreateAsync(Religion inserted)
{
inserted.CreatedUserId = UserId ?? "";
inserted.CreatedFullName = FullName ?? "System Administrator";
inserted.CreatedAt = DateTime.Now;
inserted.LastUpdatedAt = DateTime.Now;
inserted.LastUpdateFullName = FullName ?? "System Administrator";
inserted.LastUpdateUserId = UserId ?? "";
await _context.Religions.AddAsync(inserted);
await _context.SaveChangesAsync();
}
#endregion
}
}

View file

@ -844,6 +844,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -866,6 +867,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -1054,6 +1056,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1076,6 +1079,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -1261,6 +1265,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1277,6 +1282,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -1464,6 +1470,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1480,6 +1487,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -1678,6 +1686,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1699,6 +1708,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -161,10 +161,10 @@ namespace BMA.EHR.Placement.Service.Controllers
if (org.result.isOfficer == false) if (org.result.isOfficer == false)
{ {
rootId = org.result.rootId == null ? "" : org.result.rootId; rootId = org.result.rootId == null ? "" : org.result.rootId;
child1Id = org.result.child1Id == null ? "" : org.result.child1Id; // child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
child2Id = org.result.child2Id == null ? "" : org.result.child2Id; // child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
child3Id = org.result.child3Id == null ? "" : org.result.child3Id; // child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
child4Id = org.result.child4Id == null ? "" : org.result.child4Id; // child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
var data1 = await _context.PlacementProfiles var data1 = await _context.PlacementProfiles
.Where(x => x.Placement.Id == examId) .Where(x => x.Placement.Id == examId)
.Where(x => x.Draft == true) .Where(x => x.Draft == true)
@ -633,10 +633,10 @@ namespace BMA.EHR.Placement.Service.Controllers
if (org.result.isOfficer == false) if (org.result.isOfficer == false)
{ {
rootId = org.result.rootId == null ? "" : org.result.rootId; rootId = org.result.rootId == null ? "" : org.result.rootId;
child1Id = org.result.child1Id == null ? "" : org.result.child1Id; // child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
child2Id = org.result.child2Id == null ? "" : org.result.child2Id; // child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
child3Id = org.result.child3Id == null ? "" : org.result.child3Id; // child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
child4Id = org.result.child4Id == null ? "" : org.result.child4Id; // child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
var placement = await _context.Placements var placement = await _context.Placements
.Where(x => x.Id == examId) .Where(x => x.Id == examId)
.Select(x => new .Select(x => new
@ -727,7 +727,7 @@ namespace BMA.EHR.Placement.Service.Controllers
.FirstOrDefaultAsync(x => x.Id == req.PersonalId); .FirstOrDefaultAsync(x => x.Id == req.PersonalId);
if (person == null) if (person == null)
return Error(GlobalMessages.DataNotFound, 404); return Error(GlobalMessages.DataNotFound, 404);
bool? _nullBool = null;
person.OrganizationPosition = null; person.OrganizationPosition = null;
person.PositionNumber = null; person.PositionNumber = null;
person.PositionPath = null; person.PositionPath = null;
@ -762,7 +762,7 @@ namespace BMA.EHR.Placement.Service.Controllers
person.child4ShortName = null; person.child4ShortName = null;
person.orgRevisionId = null; person.orgRevisionId = null;
person.posMasterNo = null; person.posMasterNo = null;
person.positionName = null; //person.positionName = null;
person.positionField = null; person.positionField = null;
person.posTypeId = null; person.posTypeId = null;
person.posTypeName = null; person.posTypeName = null;
@ -772,7 +772,7 @@ namespace BMA.EHR.Placement.Service.Controllers
person.nodeId = null; person.nodeId = null;
person.posmasterId = null; person.posmasterId = null;
person.positionId = null; person.positionId = null;
person.Draft = false; person.Draft = _nullBool;
person.typeCommand = null; person.typeCommand = null;
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -1623,6 +1623,8 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "")
{
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1645,6 +1647,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -1927,6 +1930,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -1948,6 +1952,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -2250,6 +2255,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2273,6 +2279,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -2476,6 +2483,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2499,6 +2507,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -2693,6 +2702,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2714,6 +2724,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -628,6 +628,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -641,6 +642,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -974,6 +974,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -995,6 +996,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -838,6 +838,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -855,6 +856,7 @@ namespace BMA.EHR.Placement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -1280,5 +1280,49 @@ namespace BMA.EHR.Retirement.Service.Controllers
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return Success(true); return Success(true);
} }
/// <summary>
/// report1
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("report1")]
public async Task<ActionResult<ResponseObject>> report1(string? nodeId = null, int? node = 0, DateOnly? startDate = null, DateOnly? startEnd = null)
{
var data = new
{
template = "retirement01",
reportName = "xlsx-report",
data = ""
};
return Success(data);
}
/// <summary>
/// report2
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("report2")]
public async Task<ActionResult<ResponseObject>> report2(string? nodeId = null, int? node = 0, DateOnly? startDate = null, DateOnly? startEnd = null)
{
var data = new
{
template = "retirement02",
reportName = "xlsx-report",
data = ""
};
return Success(data);
}
} }
} }

View file

@ -82,7 +82,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
var child2Id = ""; var child2Id = "";
var child3Id = ""; var child3Id = "";
var child4Id = ""; var child4Id = "";
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position"; var apiUrl = $"{_configuration["API"]}/org/permission/checkOrg/{UserId}";
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
@ -721,6 +721,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -743,6 +744,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -925,6 +927,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -948,6 +951,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -2394,6 +2394,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2411,6 +2412,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -2575,6 +2577,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2592,6 +2595,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch

View file

@ -2337,6 +2337,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2354,6 +2355,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch
@ -2518,6 +2520,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
result.Add(r); result.Add(r);
string? _null = null; string? _null = null;
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
result.Add(new result.Add(new
{ {
No = _null, No = _null,
@ -2535,6 +2538,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
RemarkVertical = _null, RemarkVertical = _null,
}); });
} }
}
return Success(result); return Success(result);
} }
catch catch