Merge remote-tracking branch 'origin/glms/feature/1.4.2' into glms/feature/1.4.2
This commit is contained in:
@@ -169,19 +169,42 @@ namespace YLErp.Modules.SwapModule
|
||||
/// </summary>
|
||||
/// <param name="tradeId"></param>
|
||||
/// <returns></returns>
|
||||
public string SendConfirmEamil(string contractCode)
|
||||
///
|
||||
public string SendConfirmEamil(int tradeId)
|
||||
{
|
||||
var tradeContract = DbContext.trade_contract_r.Where(x => x.IsValid && x.TradeId == tradeId && x.Type == ContractTypeEnum.Trade).FirstOrDefault();
|
||||
if (tradeContract == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
tradeContract.send_email_result = "发送中";
|
||||
DbContext.SaveChanges();
|
||||
var sendResult = SendEmail(tradeContract.ContractCode);
|
||||
if (string.IsNullOrEmpty(sendResult))
|
||||
{
|
||||
tradeContract.send_email_result = "已发送";
|
||||
}
|
||||
else
|
||||
{
|
||||
tradeContract.send_email_result = "发送失败:" + sendResult;
|
||||
}
|
||||
DbContext.SaveChanges();
|
||||
return string.IsNullOrEmpty(sendResult) ? "已发送" : "发送失败:" + sendResult;
|
||||
}
|
||||
public string SendConfirmEamil(string ContractCode)
|
||||
{
|
||||
//var tradeContract = DbContext.trade_contract_r.Where(x => x.IsValid && x.TradeId == tradeId && x.Type == ContractTypeEnum.Trade).FirstOrDefault();
|
||||
//if (tradeContract == null)
|
||||
//{
|
||||
// return "";
|
||||
//}
|
||||
var contracts = DbContext.trade_contract_r.Where(o => o.ContractCode == contractCode && o.Type == ContractTypeEnum.Trade && o.IsValid).ToArray();
|
||||
var contracts = DbContext.trade_contract_r.Where(o => o.ContractCode == ContractCode && o.Type == ContractTypeEnum.Trade && o.IsValid).ToArray();
|
||||
foreach (var tradeContract in contracts)
|
||||
{
|
||||
tradeContract.send_email_result = "发送中";
|
||||
DbContext.SaveChanges();
|
||||
}
|
||||
var contractCode = contracts.FirstOrDefault()?.ContractCode;
|
||||
|
||||
var sendResult = SendEmail(contractCode);
|
||||
foreach (var tradeContract in contracts)
|
||||
|
||||
Reference in New Issue
Block a user