diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index ad17595f8..cebb629bf 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -100,7 +100,8 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.Type), t => t.Type.Contains(queryQCQuestionConfigure.Type)) .WhereIf(queryQCQuestionConfigure.LanguageType!=null, t =>t.LanguageType== queryQCQuestionConfigure.LanguageType) .WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent==true,t=>t.ParentId==null) - .OrderBy(t=>t.ShowOrder) + .OrderByDescending(x=>x.LanguageType) + .ThenBy(t=>t.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider); return await QCQuestionQueryable.ToPagedListAsync(queryQCQuestionConfigure.PageIndex, queryQCQuestionConfigure.PageSize, queryQCQuestionConfigure.SortField.IsNullOrEmpty()?nameof(queryQCQuestionConfigure.QuestionName): queryQCQuestionConfigure.SortField, queryQCQuestionConfigure.Asc); diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index dd384b16e..c46d9550a 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.Contracts .ProjectTo(_mapper.ConfigurationProvider); - var list = await trialQCQuestionQueryable.OrderBy(t => t.ShowOrder).ToListAsync(); + var list = await trialQCQuestionQueryable.OrderByDescending(x=>x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync(); var isHaveQCQuestion = _repository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId).Any();