diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 900e308af..2e64e5721 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -251,7 +251,7 @@ namespace IRaCIS.Core.Application.Service //设置工作语言 var isEn_US = _userInfo.IsEn_Us; - var workLanguage = _userInfo.IsEn_Us ? UserWorkLanguage.US : UserWorkLanguage.CN; + var workLanguage = isEn_US ? UserWorkLanguage.US : UserWorkLanguage.CN; var messageToSend = new MimeMessage(); @@ -298,7 +298,7 @@ namespace IRaCIS.Core.Application.Service //设置工作语言 var isEn_US = _userInfo.IsEn_Us; - var workLanguage = _userInfo.IsEn_Us ? UserWorkLanguage.US : UserWorkLanguage.CN; + var workLanguage = isEn_US ? UserWorkLanguage.US : UserWorkLanguage.CN; var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId); @@ -363,7 +363,7 @@ namespace IRaCIS.Core.Application.Service await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new IdentityUser() { EmailToken = token }); - routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token; + routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&lang=" + (isEn_US ? "en" : "zh") + "&access_token=" + token; var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login")); @@ -485,7 +485,7 @@ namespace IRaCIS.Core.Application.Service //设置工作语言 var isEn_US = _userInfo.IsEn_Us; - var workLanguage = _userInfo.IsEn_Us ? UserWorkLanguage.US : UserWorkLanguage.CN; + var workLanguage = isEn_US ? UserWorkLanguage.US : UserWorkLanguage.CN; var messageToSend = new MimeMessage(); //发件地址 @@ -746,7 +746,7 @@ namespace IRaCIS.Core.Application.Service await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new Domain.Models.IdentityUser() { EmailToken = token }); } - var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token; + var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&lang=" + (isEn_US ? "en" : "zh") + "&access_token=" + token; var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login")); @@ -834,7 +834,7 @@ namespace IRaCIS.Core.Application.Service if (feedBack.VisitTaskId != null) { - var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "FeedBackTypeToIR" && t.ParentId != null && t.Code == ((int)feedBack.QuestionType).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync(); + var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "FeedBackTypeToIR" && t.ParentId != null && t.Code == ((int)feedBack.QuestionType).ToString()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefaultAsync(); var info = await _visitTaskRepository.Where(t => t.Id == feedBack.VisitTaskId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.SourceSubjectVisit.VisitName }).FirstNotNullAsync(); @@ -864,7 +864,7 @@ namespace IRaCIS.Core.Application.Service } else if (feedBack.SubjectVisitId != null) { - var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialSubjectVisitFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync(); + var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialSubjectVisitFeedBack).ToString()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefaultAsync(); var info = await _subjectVisitRepository.Where(t => t.Id == feedBack.SubjectVisitId).Select(t => new { t.Trial.ResearchProgramNo, t.Trial.TrialCode, SubejctCode = t.Subject.Code, t.VisitName }).FirstNotNullAsync(); @@ -895,7 +895,7 @@ namespace IRaCIS.Core.Application.Service else if (feedBack.TrialId != null) { - var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync(); + var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialFeedBack).ToString()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefaultAsync(); var info = await _trialRepository.Where(t => t.Id == feedBack.TrialId).Select(t => new { t.ResearchProgramNo, t.TrialCode }).FirstNotNullAsync(); @@ -1003,7 +1003,7 @@ namespace IRaCIS.Core.Application.Service //设置工作语言 var isEn_US = _userInfo.IsEn_Us; - var workLanguage = _userInfo.IsEn_Us ? UserWorkLanguage.US : UserWorkLanguage.CN; + var workLanguage = isEn_US ? UserWorkLanguage.US : UserWorkLanguage.CN; var messageToSend = new MimeMessage(); //发件地址 @@ -1013,7 +1013,7 @@ namespace IRaCIS.Core.Application.Service //主题 //---[来自展影IRC] 关于重置邮箱的提醒 - var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; + var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => { @@ -1043,7 +1043,7 @@ namespace IRaCIS.Core.Application.Service //设置工作语言 var isEn_US = _userInfo.IsEn_Us; - var workLanguage = _userInfo.IsEn_Us ? UserWorkLanguage.US : UserWorkLanguage.CN; + var workLanguage = isEn_US ? UserWorkLanguage.US : UserWorkLanguage.CN; var messageToSend = new MimeMessage(); //发件地址 @@ -1053,7 +1053,7 @@ namespace IRaCIS.Core.Application.Service //主题 //---[来自展影IRC] 关于重置邮箱的提醒 - var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; + var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => {