@ -56,17 +56,22 @@ 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 = dt . Rows [ 0 ] [ 0 ] . ToString ( ) ;
//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."
+ "\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." ;
this . DataCollect ( ) ;
this . DataBind ( ) ;
@ -239,22 +244,22 @@ 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中不存在对应信息,请先维护" ) ;
}
//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 _Body = dt.Rows[0][0].ToString();
//string[] strArray = _Body.Split(new char[1] { ' ' });
@ -281,29 +286,36 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
< table style = ' width : 1 0 0 % ; table - layout : fixed ; font - size : 1 6 px ; ' border : 0 px cellspacing = '4' >
< tbody > ";
int k = 0 ;
foreach ( var item in strArray )
{
if ( k < = strArray . Length - 1 )
{
if ( item . StartsWith ( "\n" ) )
{
mailMessage + = string . Format ( @ "
mailMessage + = string . Format ( @ "
< tr >
< td style = ' color : Red ; ' > { 0 } < / td >
< td > { 0 } < / td >
< / tr >
", item);
}
else
{
mailMessage + = string . Format ( @ "
", " Dear Supplier : ");
mailMessage + = string . Format ( @ "
< tr >
< td > { 0 } < / td >
< / tr >
", item + " ");
}
}
i + + ;
}
", " Please refer to the New PO , Confirm it within today and feedback the delivery date within 2 Days , Thanks . ");
mailMessage + = string . Format ( @ "
< tr >
< td > { 0 } < / td >
< / tr >
", " 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." ) ;
mailMessage + = string . Format ( @ "
< tr >
< td > { 0 } < / td >
< / tr >
", " Best Regards ");
mailMessage + = string . Format ( @ "
< tr >
< td > { 0 } < / td >
@ -411,19 +423,21 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
{
DropDownList_Notices . Items . Clear ( ) ;
string _SelSQL = @"SELECT PrintTemplateTypeName 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中不存在对应信息,请先维护" ) ;
}
foreach ( DataRow item in _dt . Rows )
{
this . DropDownList_Notices . Items . Add ( "" + item [ "PrintTemplateTypeName" ] . ToString ( ) + "" ) ;
}
//string _SelSQL = @"SELECT PrintTemplateTypeName 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中不存在对应信息,请先维护");
//}
//foreach (DataRow item in _dt.Rows)
//{
// this.DropDownList_Notices.Items.Add("" + item["PrintTemplateTypeName"].ToString() + "");
//}
this . DropDownList_Notices . Items . Add ( "发送模板" ) ;
DropDownList_Notices . SelectedIndex = 0 ;
@ -460,23 +474,23 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
OnLoadData_DefaultImpl ( sender ) ;
string MaileTile = string . Empty ;
MaileTile = "供应商:" + SupplierName + ",采购订单 " + POCode + "已经审批" ;
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中不存在对应信息,请先维护" ) ;
}
_SelSQL = @ "select c.DefaultEmail from PM_PurchaseOrder a
MaileTile = "采购订单 " + POCode + "已经审批," + "供应商:" + SupplierName ;
//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中不存在对应信息,请先维护");
//}
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() + " ' ";
_SelSQLDs = new DataSet ( ) ;
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 ] ;
@ -489,7 +503,13 @@ namespace UFIDA.U9.Cust.WC.CustPOSendMailUI
this . MailTitle86 . Text = MaileTile ;
this . MailText53 . Text = dt . Rows [ 0 ] [ 0 ] . ToString ( ) + "\r\n" + "采购员邮箱:" + PurMail
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."
+ "\r\n" + "采购员邮箱:" + PurMail
+ "\r\n" + "采购经理邮箱:yu.zhou@panawincn.com" ;
this . DataCollect ( ) ;