예제 #1
0
        void ToHtml(int index, TradeInfo trade, StringBuilder sb)
        {
            sb.AppendLine("<table width='550px' align='center'>");
            sb.AppendLine("<tr><textarea style='border:0;OVERFLOW:visible;'></textarea></tr>");
            sb.AppendLine("<tr>");
            if (index > 0)
                sb.AppendFormat("<td width='6%' style='font-size:30px'><strong>{0}</strong></td>\n", index);
            sb.AppendFormat("<td>{0},{1},{2},{3} {4} {5} {6},{7}</td>\n",
                trade.MainTrade.ReceiverName,
                trade.MainTrade.ReceiverMobile,
                trade.MainTrade.ReceiverPhone,
                trade.MainTrade.ReceiverState,
                trade.MainTrade.ReceiverCity,
                trade.MainTrade.ReceiverDistrict,
                trade.MainTrade.ReceiverAddress,
                trade.MainTrade.ReceiverZip);
            sb.AppendLine("</tr>");
            sb.AppendLine("</table>");

            sb.AppendLine("<table width='550px' align='center' border='1px' bordercolor='#000000' cellspacing='0px' style='border-collapse:collapse'>");
            int orderIndex = 1;
            foreach (Order order in trade.Orders)
            {
                if (order.Status != "WAIT_SELLER_SEND_GOODS")
                    continue;

                ItemData itemData = Global.ItemDataContainer.GetItem(order.NumIid);
                String orderTitle = itemData != null ? itemData.UserName : order.Title;
                if (!String.IsNullOrEmpty(order.SkuPropertiesName))
                {
                    String key = "买的多,便宜多(请填写*n件的总价)";
                    orderTitle += "[" + order.SkuPropertiesName.Replace(key, "件数") + "]";
                }

                sb.AppendLine("<tr>");
                sb.AppendFormat("<td width='16%'>({0})</td>\n", orderIndex++);
                sb.AppendFormat("<td width='65%'>{0}</td>\n", orderTitle);
                sb.AppendFormat("<td width='10%'><strong>{0}</strong></td>\n", order.Num);
                sb.AppendFormat("<td>{0}</td>\n", itemData != null ? itemData.ItemType : "");
                sb.AppendLine("</tr>");
            }
            if (!String.IsNullOrEmpty(trade.SellerMemo))
                sb.AppendFormat("<tr><td>卖家备注</td><td><strong>{0}</strong></td><td></td><td></td></tr>\n", trade.SellerMemo);
            if (!String.IsNullOrEmpty(trade.BuyerMessage))
                sb.AppendFormat("<tr><td>买家留言</td><td><strong>{0}</strong></td><td></td><td></td></tr>\n", trade.BuyerMessage);
            sb.AppendLine("</table>");
        }
예제 #2
0
        void ShowTrade(TradeInfo tradeInfo, String info)
        {
            Trade trade = tradeInfo.MainTrade;
            labelReceiverAddress.Text = String.Format("{0}{1}{2}\n{3}",
                trade.ReceiverState,
                trade.ReceiverCity,
                trade.ReceiverDistrict,
                trade.ReceiverAddress);
            labelReceiverCity.Text = trade.ReceiverCity;
            labelReceiverName.Text = trade.ReceiverName;
            labelNo.Text = info;

            if (!String.IsNullOrEmpty(trade.ReceiverMobile))
                labelReceiverPhone.Text = trade.ReceiverMobile + "\n";
            if (!String.IsNullOrEmpty(trade.ReceiverPhone))
                labelReceiverPhone.Text += trade.ReceiverPhone;
            labelReceiverZip.Text = trade.ReceiverZip;
        }