From 8ee7dc94a2567c6ca6ceb806bfe5880df7dd84d8 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 18 Aug 2023 14:23:11 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=99=E0=B8=97=E0=B8=B6=E0=B8=81=E0=B9=81=E0=B8=A5=E0=B8=B0?= =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=E0=B9=80=E0=B8=A5?= =?UTF-8?q?=E0=B8=82=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=84=E0=B8=B3=E0=B8=AA?= =?UTF-8?q?=E0=B8=B1=E0=B9=88=E0=B8=87=20=E0=B8=88=E0=B8=B2=E0=B8=81=20int?= =?UTF-8?q?=20to=20str?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Application/Repositories/GenericRepository.cs | 6 +----- BMA.EHR.Command.Service/Controllers/OrderController.cs | 4 ++-- BMA.EHR.Command.Service/Requests/CreateCommandRequest.cs | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/BMA.EHR.Application/Repositories/GenericRepository.cs b/BMA.EHR.Application/Repositories/GenericRepository.cs index 2f2a6e58..29354dc1 100644 --- a/BMA.EHR.Application/Repositories/GenericRepository.cs +++ b/BMA.EHR.Application/Repositories/GenericRepository.cs @@ -14,7 +14,6 @@ namespace BMA.EHR.Application.Repositories private readonly DbSet _dbSet; private readonly IHttpContextAccessor _httpContextAccessor; - #endregion #region " Constructor and Destructor " @@ -36,9 +35,7 @@ namespace BMA.EHR.Application.Repositories protected string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; - protected bool? IsPlacementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); - - + protected bool? IsPlacementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); #endregion @@ -63,7 +60,6 @@ namespace BMA.EHR.Application.Repositories (entity as EntityBase).CreatedAt = DateTime.Now; } - await _dbSet.AddAsync(entity); await _dbContext.SaveChangesAsync(); diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs index b3b1be0d..365ade86 100644 --- a/BMA.EHR.Command.Service/Controllers/OrderController.cs +++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs @@ -381,7 +381,7 @@ namespace BMA.EHR.Command.Service.Controllers { var inserted = new Domain.Models.Commands.Core.Command { - CommandNo = req.orderNo.ToString(), + CommandNo = req.orderNo, CommandYear = req.orderYear.ToString(), CommandSubject = req.orderTitle, PositionName = req.registerPosition, @@ -433,7 +433,7 @@ namespace BMA.EHR.Command.Service.Controllers var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue); var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId); - order.CommandNo = req.orderNo.ToString(); + order.CommandNo = req.orderNo; order.CommandYear = req.orderYear.ToString(); order.CommandSubject = req.orderTitle; order.PositionName = req.registerPosition; diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandRequest.cs b/BMA.EHR.Command.Service/Requests/CreateCommandRequest.cs index c14accfd..15db35af 100644 --- a/BMA.EHR.Command.Service/Requests/CreateCommandRequest.cs +++ b/BMA.EHR.Command.Service/Requests/CreateCommandRequest.cs @@ -4,9 +4,9 @@ { public Guid orderTypeValue { get; set; } - public string orderTitle { get; set; } + public string orderTitle { get; set; } = string.Empty; - public int orderNo { get; set; } + public string orderNo { get; set; } = string.Empty; public int orderYear { get; set; }