diff --git a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs index 76faf6503..7758d3f5d 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs @@ -25,7 +25,6 @@ namespace IRaCIS.Core.Application.Contracts { public Guid Id { get; set; } public string Name { get; set; } = string.Empty; - public string ValueCN { get; set; } = string.Empty; public string Value { get; set; } = string.Empty; public string Code { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs index f6dd559c5..b45df75ff 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs @@ -99,7 +99,7 @@ namespace IRaCIS.Core.Application.Services public async Task>> GetBasicDataSelect(string[] searchArray) { - var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider,new { _userInfo.IsEn_Us}).ToListAsync(); return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.ToList()); diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs index a5db56579..67e4ef6fc 100644 --- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs @@ -25,8 +25,10 @@ namespace IRaCIS.Core.Application.Service CreateMap(); + var isEn_Us = false; CreateMap() - .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); + .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)) + .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value:u.ValueCN)); CreateMap().ReverseMap(); @@ -40,7 +42,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum)) - + .ForMember(o => o.Value, t => t.MapFrom(u => u.MappedValue)) .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); var token = "";