|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Web.UI;
|
|
|
using BWP.B3Frameworks.BO;
|
|
|
using BWP.B3Frameworks.Utils;
|
|
|
using BWP.B3Sale.BL;
|
|
|
using Forks.EnterpriseServices.BusinessInterfaces;
|
|
|
|
|
|
namespace BWP.Web.Pages.WeixinMessage_
|
|
|
{
|
|
|
public class CusAcceptWeixinMessageTemplate : WeixinMessageUtil.IWeixinMessageView
|
|
|
{
|
|
|
WeixinMessage mMessage;
|
|
|
|
|
|
public CusAcceptWeixinMessageTemplate(WeixinMessage message)
|
|
|
{
|
|
|
mMessage = message;
|
|
|
}
|
|
|
|
|
|
public System.Web.UI.Control CreateContent()
|
|
|
{
|
|
|
var bl = BIFactory.Create<ICustomerAcceptBL>();
|
|
|
var cusAccept = bl.Load(mMessage.TargetID.Value);
|
|
|
|
|
|
var html = @"
|
|
|
<article class=""weui-article"">
|
|
|
<h1>{title}</h1>
|
|
|
<section>
|
|
|
<table border=""1"" cellspacing=""0"">
|
|
|
<tr><td>会计单位</td><td>{AccountingUnit_Name}</td><td>发货时间</td><td>{LoadTime}</td></tr>
|
|
|
<tr><td>销售出库报价数量合计</td><td>{AcceptNumber}</td><td>销售出库金额</td><td>{Money}</td></tr>
|
|
|
<tr><td>送货员</td><td>{Deliveryman_Name}</td><td>车牌号</td><td>{Car_Name}</td></tr>
|
|
|
<tr><td>运费金额</td><td>{FreightPrice}</td><td>客户</td><td>{Customer_Name}</td></tr>
|
|
|
</table>
|
|
|
<table border=""1"" cellspacing=""0"" style=""margin-top:10px;"">
|
|
|
<tr><th>存货</th><th>规格</th><th>验收数量</th><th>验收金额</th><th>主单位</th><th>辅单位</th><th>品牌项</th><th>备注</th></tr>
|
|
|
{trs}
|
|
|
</table>
|
|
|
</section>
|
|
|
</article>
|
|
|
";
|
|
|
html = html.Replace("{title}", mMessage.Title);
|
|
|
html = html.Replace("{AccountingUnit_Name}", cusAccept.AccountingUnit_Name).Replace("{LoadTime}", cusAccept.LoadTime == null ? "" : cusAccept.LoadTime.Value.ToString()).Replace("{AcceptNumber}", cusAccept.AcceptNumber == null ? "" : cusAccept.AcceptNumber.Value.ToString()).Replace("{Money}", cusAccept.Money == null ? string.Empty : cusAccept.Money.Value.ToString()).Replace("{Deliveryman_Name}", cusAccept.Deliveryman_Name).Replace("{Car_Name}", cusAccept.Car_Name).Replace("{FreightPrice}", cusAccept.FreightPrice == null ? string.Empty : cusAccept.FreightPrice.Value.ToString()).Replace("{Customer_Name}", cusAccept.Customer_Name);
|
|
|
if (cusAccept.Details.Count() > 0) {
|
|
|
var str = new StringBuilder();
|
|
|
foreach (var detail in cusAccept.Details) {
|
|
|
str.Append("<str>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.Goods_Name);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.Goods_Spec);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.AcceptNum);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.AcceptMoney);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.Unit);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.Goods_SecondUnit);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.BrandItem_Name);
|
|
|
str.Append("</td>");
|
|
|
str.Append("<td>");
|
|
|
str.Append(detail.Remark);
|
|
|
str.Append("</td>");
|
|
|
str.Append("</str>");
|
|
|
}
|
|
|
html = html.Replace("{trs}", str.ToString());
|
|
|
}
|
|
|
return new LiteralControl(html);
|
|
|
}
|
|
|
|
|
|
public string GetTitle()
|
|
|
{
|
|
|
return mMessage.Title;
|
|
|
}
|
|
|
}
|
|
|
}
|