diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index ab6159a09..d6ebff072 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3192,16 +3192,16 @@ namespace IRaCIS.Core.Infra.EFCore.Common var tableQuestionAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer) .Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault(); var answer=string.Empty; - var questionName=string.Empty; + if (tableQuestionAnswer != null) { answer = tableQuestionAnswer.Answer; - - } - questionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us? x.QuestionEnName:x.QuestionName).FirstOrDefaultAsync(); + var rowMark= await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync(); + var tableQuestionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us? x.QuestionEnName:x.QuestionName).FirstOrDefaultAsync(); + var questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync(); var liverSegmentation = await _dbContext.ReadingTableQuestionAnswer.Where(x => x.RowId == entity.RowId && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.liverSegmentation).Select(x => x.Answer).FirstOrDefaultAsync(); await InsertInspection(entity, type, x => new InspectionConvertDTO() @@ -3212,11 +3212,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { - QuestionName = questionName, + RowMark = rowMark, + TableQuestionName = tableQuestionName, Answer = answer, LiverSegmentation = liverSegmentation, - }); + },_userInfo.AuditIdentification); }