diff --git a/UICode/CustPOSendMailUI/WebPart/CustPOSendMailUIFormWebPartCodeBehindExtend.cs b/UICode/CustPOSendMailUI/WebPart/CustPOSendMailUIFormWebPartCodeBehindExtend.cs
index 5551f5b..3f47972 100644
--- a/UICode/CustPOSendMailUI/WebPart/CustPOSendMailUIFormWebPartCodeBehindExtend.cs
+++ b/UICode/CustPOSendMailUI/WebPart/CustPOSendMailUIFormWebPartCodeBehindExtend.cs
@@ -31,6 +31,7 @@ using UFSoft.UBF.PRN.Control;
using UFSoft.UBF.Report.Tools;
using CusSupplierContactBP;
using System.Collections.Generic;
+using System.Linq;
@@ -56,22 +57,31 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
Action.OnSend(sender, new UIActionEventArgs());
- //string SelSQL = @"SELECT PrintTemplateText FROM Cust_PrintTemplateText WHERE PrintTemplateTypeName='" + this.DropDownList_Notices.Text + "'";
- //DataSet SelSQLDs = new DataSet();
- //UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), SelSQL.ToString(), null, out SelSQLDs);
- //DataTable dt = new DataTable();
- //dt = SelSQLDs.Tables[0];
- //if (dt.Rows.Count < 1)
- //{
- // throw new Exception("配置表Cust_PrintTemplateText中不存在对应信息,请先维护");
- //}
-
- this.MailText53.Text = "Dear Supplier:" + "\r\n" + "Please refer to the New PO, Confirm it within today and feedback the delivery date within 2 Days,Thanks."
+ if (this.DropDownList_Notices.Text == "英文模板")
+ {
+ this.MailText53.Text = "Dear Supplier:" + "\r\n" + "Please refer to the New PO, Confirm it within today and feedback the delivery date within 2 Days,Thanks."
+ "\r\n" + "Best Regards" + "\r\n" + "The information contained in this message is confidential and may be " +
"legally privileged. The message is intended solely for the addressee(s). " +
"If you are not the intended recipient, you are hereby notified that any use,dissemination " +
"or reproduction is strictly prohibited and may be unlawful. If you are not the intended recipient, " +
"please contact the sender by return e-mail and destroy all copies of the original message.";
+ }
+ else
+ {
+ string SelSQL = @"SELECT PrintTemplateText FROM Cust_PrintTemplateText WHERE PrintTemplateTypeName='" + this.DropDownList_Notices.Text + "'";
+ DataSet SelSQLDs = new DataSet();
+ UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), SelSQL.ToString(), null, out SelSQLDs);
+ DataTable dt = new DataTable();
+ dt = SelSQLDs.Tables[0];
+ if (dt.Rows.Count < 1)
+ {
+ throw new Exception("配置表Cust_PrintTemplateText中不存在对应模板正文信息,请先维护");
+ }
+ this.MailText53.Text = dt.Rows[0]["PrintTemplateText"].ToString();
+ }
+
+
+
this.DataCollect();
this.DataBind();
@@ -244,79 +254,112 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
message.CC.Add(CCAddress);//抄送人邮箱
}
- //string SelSQL = @"SELECT top 1 PrintTemplateText FROM Cust_PrintTemplateText ";
- //DataSet SelSQLDs = new DataSet();
- //UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), SelSQL.ToString(), null, out SelSQLDs);
- //DataTable dt = new DataTable();
- //dt = SelSQLDs.Tables[0];
- //if (dt.Rows.Count < 1)
- //{
- // throw new Exception("配置表Cust_PrintTemplateText中不存在对应信息,请先维护");
- //}
message.From = new MailAddress(SendAddress);//发件人邮箱
message.Subject = this.MailTitle86.Text;//邮件标题
message.SubjectEncoding = Encoding.UTF8;//标题格式为UTF8
- //string _Body = dt.Rows[0][0].ToString();
- //string[] strArray = _Body.Split(new char[1] { ' ' });
-
-
-
+ string mailMessage = "";
-
- string _SelSQL = @"select c.DefaultEmail from PM_PurchaseOrder a
- left join CBO_Operators b on a.PurOper = b.ID
- left join Base_Contact c on b.Contact = c.ID
- where a.DocNo ='" + CurrentState["POCode"].ToString() + "' and a.Org='" + CurrentState["OrgID"].ToString() + "'";
- DataSet _SelSQLDs = new DataSet();
- UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), _SelSQL.ToString(), null, out _SelSQLDs);
- DataTable dtPur = new DataTable();
- dtPur = _SelSQLDs.Tables[0];
- if (dtPur.Rows.Count == 0)
+ if (this.DropDownList_Notices.Text == "英文模板")
{
- throw new Exception("采购员未维护邮箱");
- }
-
- string PurMail = dtPur.Rows[0]["DefaultEmail"].ToString();//采购员收件邮箱
-
-
- string mailMessage = @"
+ mailMessage = @"
";
- int k = 0;
- mailMessage += string.Format(@"
+ int k = 0;
+ mailMessage += string.Format(@"
{0} |
", "Dear Supplier:");
- mailMessage += string.Format(@"
+ mailMessage += string.Format(@"
{0} |
", "Please refer to the New PO, Confirm it within today and feedback the delivery date within 2 Days,Thanks.");
- mailMessage += string.Format(@"
+ mailMessage += string.Format(@"
{0} |
", "Best Regards");
- mailMessage += string.Format(@"
+ mailMessage += string.Format(@"
{0} |
", "The information contained in this message is confidential and may be legally privileged. " +
- "The message is intended solely for the addressee(s). If you are not the intended recipient," +
- " you are hereby notified that any use, dissemination or reproduction is strictly prohibited" +
- " and may be unlawful. If you are not the intended recipient, please contact the sender " +
- "by return e-mail and destroy all copies of the original message.");
+ "The message is intended solely for the addressee(s). If you are not the intended recipient," +
+ " you are hereby notified that any use, dissemination or reproduction is strictly prohibited" +
+ " and may be unlawful. If you are not the intended recipient, please contact the sender " +
+ "by return e-mail and destroy all copies of the original message.");
+
+
+ mailMessage += @"
";
+ }
+ else
+ {
+ string SelSQL = @"SELECT PrintTemplateText FROM Cust_PrintTemplateText WHERE PrintTemplateTypeName='" + this.DropDownList_Notices.Text + "'";
+ DataSet SelSQLDs = new DataSet();
+ UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), SelSQL.ToString(), null, out SelSQLDs);
+ DataTable dt = SelSQLDs.Tables[0];
+ if (dt.Rows.Count < 1)
+ {
+ throw new Exception("配置表Cust_PrintTemplateText中不存在对应模板正文信息,请先维护");
+ }
+
+ string body = dt.Rows[0]["PrintTemplateText"].ToString();//正文信息
+
+ List bodylist = body.Split(' ').ToList();
+
+ mailMessage = @"
+
+
+ ";
+ foreach (var item in bodylist)
+ {
+ mailMessage += string.Format(@"
+
+ {0} |
+
+ ", item);
+ }
+
+
+
+ mailMessage += @"
";
+ }
+
+
+
+
+
+ //string _Body = dt.Rows[0][0].ToString();
+ //string[] strArray = _Body.Split(new char[1] { ' ' });
+
+
+
+
+
+ string _SelSQL = @"select c.DefaultEmail from PM_PurchaseOrder a
+ left join CBO_Operators b on a.PurOper = b.ID
+ left join Base_Contact c on b.Contact = c.ID
+ where a.DocNo ='" + CurrentState["POCode"].ToString() + "' and a.Org='" + CurrentState["OrgID"].ToString() + "'";
+ DataSet _SelSQLDs = new DataSet();
+ UFSoft.UBF.Util.DataAccess.DataAccessor.RunSQL(UFSoft.UBF.Util.DataAccess.DataAccessor.GetConn(), _SelSQL.ToString(), null, out _SelSQLDs);
+ DataTable dtPur = new DataTable();
+ dtPur = _SelSQLDs.Tables[0];
+ if (dtPur.Rows.Count == 0)
+ {
+ throw new Exception("采购员未维护邮箱");
+ }
+
+ string PurMail = dtPur.Rows[0]["DefaultEmail"].ToString();//采购员收件邮箱
- mailMessage += @"