diff --git a/ICSSoft.FromERP/ICSSoft.FromERP/ICSWHSendMail.cs b/ICSSoft.FromERP/ICSSoft.FromERP/ICSWHSendMail.cs index 033e6f1..13ce89a 100644 --- a/ICSSoft.FromERP/ICSSoft.FromERP/ICSWHSendMail.cs +++ b/ICSSoft.FromERP/ICSSoft.FromERP/ICSWHSendMail.cs @@ -73,9 +73,9 @@ namespace ICSSoft.FromERP } - public void Execute() + public void Execute(string WhCode) { - log.Info("发送邮件开始……………………………………………………………………"); + log.Info(WhCode + "发送邮件开始……………………………………………………………………"); string sql = ""; try { @@ -95,8 +95,9 @@ namespace ICSSoft.FromERP string sqlMail = @"SELECT b.F_ItemCode, b.F_ItemName, b.F_Define1, b.F_Define2, b.F_Define3, b.F_Define4 FROM [dbo].[Sys_SRM_Items] a left join [Sys_SRM_ItemsDetail] b on a.f_id = b.f_itemid - where a.F_EnCode = 'WHSendMail' + where a.F_EnCode = '{0}' order by b.F_SortCode"; + sqlMail = string.Format(sqlMail, WhCode); DataTable mailDt = ICSHelper.ExecuteTable(conStr, sqlMail); DataRow[] drs1 = mailDt.Select("F_ItemCode = '001'"); DataRow[] drs2 = mailDt.Select("F_ItemCode = '002'"); @@ -180,7 +181,7 @@ VALUES (newid(), '{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', log.Error(ex.ToString()); } - log.Info("发送邮件结束……………………………………………………………………"); + log.Info(WhCode + "发送邮件结束……………………………………………………………………"); } #region 发邮件 diff --git a/ICSSoft.FromERP/ICSSoft.Test/Program.cs b/ICSSoft.FromERP/ICSSoft.Test/Program.cs index 5c4d23d..26629bd 100644 --- a/ICSSoft.FromERP/ICSSoft.Test/Program.cs +++ b/ICSSoft.FromERP/ICSSoft.Test/Program.cs @@ -25,8 +25,10 @@ namespace ICSSoft.Test //ICSWareHouseLotInfoDoc test = new ICSWareHouseLotInfoDoc(); //test.Execute(); - ICSTransferAuto test = new ICSTransferAuto(); - test.Execute(); + ICSWHSendMail test = new ICSWHSendMail(); + test.Execute("WHSendMail"); + + test.Execute("WHSendMail109"); }