示例#1
0
        /// <summary>
        /// 发送增票SMS短信
        /// </summary>
        /// <param name="soInfo">SO 信息</param>
        public void SendVATSMS(SOInfo soInfo)
        {
            try
            {
                if (soInfo.InvoiceInfo.IsVAT.Value)
                {
                    int stockSysNo = soInfo.Items[0].StockSysNo.Value;

                    string mobilePhone = string.Empty;
                    if (!string.IsNullOrEmpty(soInfo.ReceiverInfo.MobilePhone))
                    {
                        mobilePhone = soInfo.ReceiverInfo.MobilePhone;
                    }
                    else
                    {
                        mobilePhone = soInfo.ReceiverInfo.Phone;
                    }
                    ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = GetCustomerBaseInfo(soInfo.BaseInfo.CustomerSysNo.Value);
                    string customerLanguageCode = customerInfo.FavoriteLanguageCode;
                    string smsContent           = ObjectFactory <ECCentral.Service.IBizInteract.ICustomerBizInteract> .Instance.GetSMSContent(soInfo.WebChannel == null?null : soInfo.WebChannel.ChannelID, customerLanguageCode, soInfo.ShippingInfo.ShipTypeSysNo.Value, BizEntity.Customer.SMSType.OrderOutBound);

                    if (!AppSettingHelper.NEG_NotVAT_StockSysNoList.Exists(no => no == stockSysNo))
                    {
                        //发送短信
                        smsContent = ResourceHelper.Get("NEG_SMS_SO_VATSend");
                        ExternalDomainBroker.SendSMS(mobilePhone, smsContent, BizEntity.Common.SMSPriority.Normal);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
            }
        }
示例#2
0
        public void ActivateElectronicSendMailToCustomer(SOInfo soInfo)
        {
            try
            {
                ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = GetCustomerBaseInfo(soInfo.BaseInfo.CustomerSysNo.Value);
                string customerEmail = customerInfo.Email == null ? null : customerInfo.Email.Trim();

                if (customerEmail == null)
                {
                    return;
                }
                KeyValueVariables keyValueVariables = new KeyValueVariables();
                keyValueVariables.Add("CustomerID", customerInfo.CustomerID);
                keyValueVariables.Add("Quantity", soInfo.Items[0].Quantity);
                keyValueVariables.Add("TotalAmount", (soInfo.Items[0].Quantity.Value * soInfo.Items[0].OriginalPrice.Value).ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("ExpireYear", DateTime.Now.AddYears(2).Year);
                keyValueVariables.Add("ExpireMonth", DateTime.Now.Month);
                keyValueVariables.Add("ExpireDay", DateTime.Now.Day);
                keyValueVariables.Add("NowYear", DateTime.Now.Year);
                ExternalDomainBroker.SendExternalEmail(customerEmail, "SO_ActivateElectronicGiftCard", keyValueVariables, customerInfo.FavoriteLanguageCode);
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
            }
        }
示例#3
0
 public void RecommendCustomerAddExperienceSendMail(ECCentral.BizEntity.Customer.CustomerBasicInfo recommendCustomerInfo, string newCustomerID, decimal experience)
 {
     try
     {
         string customerEmail = recommendCustomerInfo.Email == null ? null : recommendCustomerInfo.Email.Trim();
         if (customerEmail == null)
         {
             return;
         }
         KeyValueVariables keyValueVariables = new KeyValueVariables();
         keyValueVariables.Add("RmdCustomerID", recommendCustomerInfo.CustomerID);
         keyValueVariables.Add("NewCustomerID", newCustomerID);
         keyValueVariables.Add("Experience", experience);
         ExternalDomainBroker.SendExternalEmail(customerEmail, "SO_ShipOut_UserAddExperience", keyValueVariables, recommendCustomerInfo.FavoriteLanguageCode);
     }
     catch (Exception ex)
     {
         ExceptionHelper.HandleException(ex);
     }
 }
示例#4
0
        public void SendSMS(SOInfo soInfo, BizEntity.Customer.SMSType type)
        {
            try
            {
                ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = GetCustomerBaseInfo(soInfo.BaseInfo.CustomerSysNo.Value);
                string customerLanguageCode = customerInfo.FavoriteLanguageCode;

                string smsContent = ObjectFactory <ECCentral.Service.IBizInteract.ICustomerBizInteract> .Instance.GetSMSContent(soInfo.WebChannel == null?null : soInfo.WebChannel.ChannelID, customerLanguageCode, soInfo.ShippingInfo.ShipTypeSysNo.Value, type);

                if (string.IsNullOrEmpty(smsContent))
                {
                    return;
                }
                string mobilePhone = string.Empty;
                if (!string.IsNullOrEmpty(soInfo.ReceiverInfo.MobilePhone))
                {
                    mobilePhone = soInfo.ReceiverInfo.MobilePhone;
                }
                else
                {
                    mobilePhone = soInfo.ReceiverInfo.Phone;
                }

                if (smsContent.IndexOf("SO#") != -1)
                {
                    smsContent = smsContent.Replace("SO#", soInfo.BaseInfo.SOID);
                }
                else
                {
                    return;
                }

                // 上海仓库自提且分期付款,特殊短信内容
                ExternalDomainBroker.SendSMS(mobilePhone, smsContent, BizEntity.Common.SMSPriority.Normal);
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
            }
        }
示例#5
0
        /// <summary>
        /// 如果是新客户的第一张订单,为推荐人增加经验值
        /// </summary>
        /// <param name="soInfo">订单</param>
        /// <param name="customerInfo">订单客户</param>
        public void AddExperienceByRecommend(SOInfo soInfo)
        {
            SOBaseInfo soBaseInfo = soInfo.BaseInfo;

            ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = ExternalDomainBroker.GetCustomerInfo(soBaseInfo.CustomerSysNo.Value).BasicInfo;

            string companyCode = soInfo.CompanyCode;

            // 对象为空
            if (customerInfo == null || soInfo == null)
            {
                return;
            }

            // 该客户没有推荐人
            if (!customerInfo.RecommendedByCustomerSysNo.HasValue || customerInfo.RecommendedByCustomerSysNo.Value == 0)
            {
                return;
            }

            // 判断订单是否是该客户的第一张成功出库的订单
            if (!SODA.IsFirstSO(soInfo.SysNo.Value, soBaseInfo.CustomerSysNo.Value))
            {
                return;
            }


            // 获取推荐人信息
            ECCentral.BizEntity.Customer.CustomerBasicInfo rmdCustomerInfo = ExternalDomainBroker.GetCustomerInfo(customerInfo.RecommendedByCustomerSysNo.Value).BasicInfo;

            // 没有相应的推荐人信息
            if (rmdCustomerInfo == null)
            {
                return;
            }

            // 推荐人不能是客户自己
            if (customerInfo.CustomerSysNo == rmdCustomerInfo.CustomerSysNo)
            {
                return;
            }

            // 如果推荐人被禁用,不对其增加经验值
            if (rmdCustomerInfo.Status.Value == BizEntity.Customer.CustomerStatus.InValid)
            {
                return;
            }

            // 订单金额
            decimal soAmount = soBaseInfo.CashPay + soBaseInfo.PayPrice.Value + soBaseInfo.ShipPrice.Value + soBaseInfo.PremiumAmount.Value + soBaseInfo.PromotionAmount.Value;
            // 推荐人经验值的增加数量为订单金额的10%
            decimal rate          = AppSettingHelper.RecommendExperienceRatio;
            decimal addExperience = decimal.Round(soAmount * rate, 0); // 应该增加的经验值,4舍5入到整数

            // 如果增加值<1,
            if (addExperience > 0)
            {
                string logMemo = string.Format("SO#{0}:引荐新用户,首次购物成功,加经验值。", soInfo.SysNo);
                ExternalDomainBroker.AdjustCustomerExperience(rmdCustomerInfo.CustomerSysNo.Value, addExperience, BizEntity.Customer.ExperienceLogType.Recommend, logMemo);
                ObjectFactory <SOSendMessageProcessor> .Instance.RecommendCustomerAddExperienceSendMail(rmdCustomerInfo, customerInfo.CustomerID, addExperience);
            }
        }
示例#6
0
        /// <summary>
        /// 拆单邮件
        /// </summary>
        /// <param name="masterSOInfo"></param>
        /// <param name="subSOList"></param>
        public void SendSplitSOEmail(SOInfo masterSOInfo, List <SOInfo> subSOList)
        {
            try
            {
                ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = GetCustomerBaseInfo(masterSOInfo.BaseInfo.CustomerSysNo.Value);
                string customerEmail = customerInfo.Email == null ? null : customerInfo.Email.Trim();

                if (customerEmail == null)
                {
                    return;
                }
                #region 填充基本信息
                KeyValueVariables keyValueVariables = new KeyValueVariables();
                KeyTableVariables keyTableVariables = new KeyTableVariables();
                keyValueVariables.Add("CustomerID", customerInfo.CustomerID);
                keyValueVariables.Add("CustomerName", customerInfo.CustomerName);
                keyValueVariables.Add("ReceiveName", masterSOInfo.InvoiceInfo.Header);
                keyValueVariables.Add("ReceiveContact", masterSOInfo.ReceiverInfo.Name);
                ECCentral.BizEntity.Common.AreaInfo areaInfo = ExternalDomainBroker.GetAreaInfoByDistrictSysNo(masterSOInfo.ReceiverInfo.AreaSysNo.Value);
                keyValueVariables.Add("ProvinceName", areaInfo.ProvinceName);
                keyValueVariables.Add("CityName", areaInfo.CityName);
                keyValueVariables.Add("DistrictName", areaInfo.DistrictName);
                keyValueVariables.Add("ReceiveAddress", masterSOInfo.ReceiverInfo.Address);
                keyValueVariables.Add("ReceiveZip", masterSOInfo.ReceiverInfo.Zip);
                keyValueVariables.Add("ReceivePhone", String.IsNullOrEmpty(masterSOInfo.ReceiverInfo.Phone) ? masterSOInfo.ReceiverInfo.MobilePhone : masterSOInfo.ReceiverInfo.Phone);

                keyValueVariables.Add("SOSysNo", masterSOInfo.SysNo.Value);
                keyValueVariables.Add("SubSOSysNoList", String.Join(",", subSOList.Select <SOInfo, int>(subSOInfo => subSOInfo.SysNo.Value).ToArray()));
                keyValueVariables.Add("Memo", masterSOInfo.BaseInfo.Memo);
                keyValueVariables.Add("NowYear", DateTime.Now.Year);
                #endregion 填充基本信息

                #region 替换邮件模板内连接追踪代码
                ReplaceCM_MMC("SO_Splited", keyValueVariables);
                #endregion

                #region 填充拆单信息
                string pagePath = string.Empty;
                string imgSrc   = string.Empty;

                int i = 1;
                ECCentral.BizEntity.Common.PayType      payType      = ExternalDomainBroker.GetPayTypeBySysNo(masterSOInfo.BaseInfo.PayTypeSysNo.Value);
                ECCentral.BizEntity.Common.ShippingType shippingType = ExternalDomainBroker.GetShippingTypeBySysNo(masterSOInfo.ShippingInfo.ShipTypeSysNo.Value);

                DataTable subSO = new DataTable();
                subSO.Columns.AddRange(new DataColumn[]
                {
                    new DataColumn("GainPoint"),
                    new DataColumn("SubSOIndex"),
                    new DataColumn("PayType"),
                    new DataColumn("SOSysNo"),
                    new DataColumn("OrderTime"),
                    new DataColumn("ShipType"),
                    new DataColumn("ShipPeriod"),
                    new DataColumn("CashPay"),
                    new DataColumn("ShipPrice"),
                    new DataColumn("PremiumAmount"),
                    new DataColumn("ReceivableAmount"),
                    new DataColumn("ChangeAmount"),
                    new DataColumn("ChangeAmountDisplay"),
                    new DataColumn("GiftCardPay"),
                    new DataColumn("GiftCardDisplay"),
                    new DataColumn("PointPay"),
                    new DataColumn("PointPayDisplay"),
                    new DataColumn("PrePay"),
                    new DataColumn("PrePayDisplay"),
                    new DataColumn("PayPrice"),
                    new DataColumn("PayPriceDisplay"),
                    new DataColumn("PromotionAmount"),
                    new DataColumn("PromotionDisplay"),
                    new DataColumn("Weight"),
                    new DataColumn("SOItem", typeof(DataTable))
                });
                subSOList.ForEach(subSOInfo =>
                {
                    DataTable subSOItemList = new DataTable();
                    subSOItemList.Columns.AddRange(new DataColumn[]
                    {
                        new DataColumn("ProductID"),
                        new DataColumn("ProductName"),
                        new DataColumn("Price"),
                        new DataColumn("Quantity"),
                        new DataColumn("Amount"),
                        new DataColumn("PagePath"),
                        new DataColumn("ImgSrc")
                    });
                    subSOInfo.Items.ForEach(subSOItem =>
                    {
                        pagePath = "http://www.kjt.com/product/detail/" + subSOItem.ProductSysNo;
                        imgSrc   = "http://image.kjt.com/neg/P60/" + subSOItem.ProductID + ".jpg";
                        ReplaceProductCM_MMC("SO_Splited", ref pagePath, subSOItem.ProductID);
                        subSOItemList.Rows.Add(new string[]
                        {
                            subSOItem.ProductID,
                            subSOItem.ProductName,
                            subSOItem.OriginalPrice.Value.ToString(SOConst.DecimalFormat),
                            subSOItem.Quantity.Value.ToString(),
                            (subSOItem.Quantity.Value * subSOItem.OriginalPrice.Value).ToString(SOConst.DecimalFormat),
                            pagePath,
                            imgSrc
                        });
                    });

                    string changeAmount = (subSOInfo.BaseInfo.OriginalReceivableAmount - subSOInfo.BaseInfo.ReceivableAmount).ToString(SOConst.DecimalFormat);
                    subSO.Rows.Add(new object[]
                    {
                        subSOInfo.BaseInfo.GainPoint,
                        i++,
                        payType.PayTypeName,
                        subSOInfo.BaseInfo.SOID,
                        subSOInfo.BaseInfo.CreateTime.Value.ToString(SOConst.DateTimeFormat),
                        shippingType.ShippingTypeName,
                        shippingType.Period,
                        subSOInfo.BaseInfo.CashPay.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.ShipPrice.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.PremiumAmount.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.ReceivableAmount.ToString(SOConst.DecimalFormat),
                        changeAmount,
                        changeAmount != (0M).ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.GiftCardPay.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.GiftCardPay != 0,
                        subSOInfo.BaseInfo.PointPay,
                        subSOInfo.BaseInfo.PointPay != 0,
                        subSOInfo.BaseInfo.PrepayAmount.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.PrepayAmount != 0,
                        subSOInfo.BaseInfo.PayPrice.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.PayPrice != 0,
                        subSOInfo.BaseInfo.PromotionAmount.Value.ToString(SOConst.DecimalFormat),
                        subSOInfo.BaseInfo.PromotionAmount != 0,
                        subSOInfo.ShippingInfo.Weight,
                        subSOItemList
                    });

                    KeyTableVariables subSOItemTableVariables = new KeyTableVariables();
                });
                #endregion

                keyTableVariables.Add("SubSOList", subSO);

                ExternalDomainBroker.SendExternalEmail(customerEmail, "SO_Splited", keyValueVariables, keyTableVariables, customerInfo.FavoriteLanguageCode);
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
            }
        }
示例#7
0
        private void SendEmailToCustomerForSOInfo(SOInfo soInfo, string emailTemplateID)
        {
            try
            {
                ECCentral.BizEntity.Customer.CustomerBasicInfo customerInfo = GetCustomerBaseInfo(soInfo.BaseInfo.CustomerSysNo.Value);
                string customerEmail = customerInfo.Email == null ? null : customerInfo.Email.Trim();

                if (customerEmail == null)
                {
                    return;
                }
                KeyValueVariables keyValueVariables = new KeyValueVariables();
                KeyTableVariables keyTableVariables = new KeyTableVariables();

                #region 填充基本属性
                keyValueVariables.Add("SOSysNo", soInfo.BaseInfo.SysNo.Value.ToString());
                keyValueVariables.Add("SOID", soInfo.BaseInfo.SOID);
                keyValueVariables.Add("CustomerName", customerInfo.CustomerName);
                keyValueVariables.Add("CustomerID", customerInfo.CustomerID);
                keyValueVariables.Add("OrderTime", soInfo.BaseInfo.CreateTime.Value.ToString(SOConst.DateTimeFormat));
                keyValueVariables.Add("InvoiceHeader", soInfo.InvoiceInfo.Header);
                keyValueVariables.Add("ReceiveName", soInfo.ReceiverInfo.Name);
                ECCentral.BizEntity.Common.AreaInfo areaInfo = ExternalDomainBroker.GetAreaInfoByDistrictSysNo(soInfo.ReceiverInfo.AreaSysNo.Value);
                keyValueVariables.Add("ProvinceName", areaInfo.ProvinceName);
                keyValueVariables.Add("CityName", areaInfo.CityName);
                keyValueVariables.Add("DistrictName", areaInfo.DistrictName);
                keyValueVariables.Add("ReceiveAddress", soInfo.ReceiverInfo.Address);
                keyValueVariables.Add("ReceiveZip", soInfo.ReceiverInfo.Zip);
                keyValueVariables.Add("ReceivePhone", String.IsNullOrEmpty(soInfo.ReceiverInfo.Phone) ? soInfo.ReceiverInfo.MobilePhone : soInfo.ReceiverInfo.Phone);
                ECCentral.BizEntity.Common.PayType payType = ExternalDomainBroker.GetPayTypeBySysNo(soInfo.BaseInfo.PayTypeSysNo.Value);
                keyValueVariables.Add("PayType", payType.PayTypeName);
                ECCentral.BizEntity.Common.ShippingType shippingType = ExternalDomainBroker.GetShippingTypeBySysNo(soInfo.ShippingInfo.ShipTypeSysNo.Value);
                keyValueVariables.Add("ShipType", shippingType.ShippingTypeName);
                keyValueVariables.Add("ShipPeriod", shippingType.Period);
                keyValueVariables.Add("CashPay", soInfo.BaseInfo.CashPay.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("ShipPrice", soInfo.BaseInfo.ShipPrice.Value.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("PremiumAmount", soInfo.BaseInfo.PremiumAmount.Value.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("ReceivableAmount", soInfo.BaseInfo.ReceivableAmount.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("GainPoint", soInfo.BaseInfo.GainPoint.Value);
                keyValueVariables.Add("Weight", soInfo.ShippingInfo.Weight);

                string changeAmount = (soInfo.BaseInfo.OriginalReceivableAmount - soInfo.BaseInfo.ReceivableAmount).ToString(SOConst.DecimalFormat);
                keyValueVariables.Add("ChangeAmount", changeAmount);
                keyValueVariables.Add("ChangeAmountDisplay", changeAmount != (0M).ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("GiftCardPay", soInfo.BaseInfo.GiftCardPay.Value.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("GiftCardDisplay", soInfo.BaseInfo.GiftCardPay != 0);
                keyValueVariables.Add("PointPay", soInfo.BaseInfo.PointPayAmount);
                keyValueVariables.Add("PointPayDisplay", soInfo.BaseInfo.PointPay != 0);
                keyValueVariables.Add("PrePay", soInfo.BaseInfo.PrepayAmount.Value.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("PrePayDisplay", soInfo.BaseInfo.PrepayAmount != 0);
                keyValueVariables.Add("PayPrice", soInfo.BaseInfo.PayPrice.Value.ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("PayPriceDisplay", soInfo.BaseInfo.PayPrice != 0);
                keyValueVariables.Add("PromotionAmount", Math.Abs(soInfo.BaseInfo.PromotionAmount.Value).ToString(SOConst.DecimalFormat));
                keyValueVariables.Add("PromotionDisplay", soInfo.BaseInfo.PromotionAmount != 0);
                keyValueVariables.Add("NowYear", DateTime.Now.Year);
                keyValueVariables.Add("TariffAmt", soInfo.BaseInfo.TariffAmount.HasValue?soInfo.BaseInfo.TariffAmount.Value.ToString(SOConst.DecimalFormat) : 0M.ToString(SOConst.DecimalFormat));
                #endregion

                //int weight = 0;

                #region 替换邮件模板内连接追踪代码
                ReplaceCM_MMC(emailTemplateID, keyValueVariables);
                #endregion

                #region 填充商品
                string imgSrc   = string.Empty;
                string pagePath = string.Empty;
                soInfo.Items.ForEach(item =>
                {
                    //weight += item.Weight.Value * item.Quantity.Value;
                    string tbKey        = String.Format("Items_{0}", item.ProductType.ToString());
                    pagePath            = "http://www.kjt.com/product/detail/" + item.ProductSysNo;
                    imgSrc              = "http://image.kjt.com/neg/P60/" + item.ProductID + ".jpg";
                    DataTable tableList = null;
                    if (!keyTableVariables.ContainsKey(tbKey))
                    {
                        tableList = new DataTable();
                        tableList.Columns.AddRange(new DataColumn[]
                        {
                            new DataColumn("ProductID"),
                            new DataColumn("ProductName"),
                            new DataColumn("Price"),
                            new DataColumn("Quantity"),
                            new DataColumn("Amount"),
                            new DataColumn("PagePath"),
                            new DataColumn("ImgSrc")
                        });
                        keyTableVariables.Add(tbKey, tableList);
                    }
                    else
                    {
                        tableList = keyTableVariables[tbKey];
                    }
                    //连接增加追踪代码
                    ReplaceProductCM_MMC(emailTemplateID, ref pagePath, item.ProductID);
                    tableList.Rows.Add(new string[]
                    {
                        item.ProductType == SOProductType.Coupon ? null : item.ProductID,
                        item.ProductName,
                        item.OriginalPrice.Value.ToString(SOConst.DecimalFormat),
                        item.Quantity.Value.ToString(),
                        (item.Quantity.Value * item.OriginalPrice.Value).ToString(SOConst.DecimalFormat),
                        pagePath,
                        imgSrc
                    });
                });
                #endregion

                #region 组合销售
                List <SOPromotionInfo> comboPromotionList = soInfo.SOPromotions.FindAll(p => { return(p.PromotionType == SOPromotionType.Combo); });
                keyValueVariables.Add("PromotionInfoDisplay", soInfo.BaseInfo.PromotionAmount != 0);
                if (comboPromotionList != null)
                {
                    DataTable comboTable = new DataTable();
                    comboTable.Columns.AddRange(new DataColumn[]
                    {
                        new DataColumn("ComboName"),
                        new DataColumn("ComboDiscount"),
                        new DataColumn("ComboTime"),
                        new DataColumn("ComboTotalDiscount")
                    });
                    keyTableVariables.Add("ComboList", comboTable);
                    List <ECCentral.BizEntity.MKT.ComboInfo> comboInfoList = ExternalDomainBroker.GetComboList(comboPromotionList.Select <SOPromotionInfo, int>(p => p.PromotionSysNo.Value).ToList <int>());
                    if (comboInfoList != null)
                    {
                        comboPromotionList.ForEach(promotion =>
                        {
                            ECCentral.BizEntity.MKT.ComboInfo comboInfo = comboInfoList.FirstOrDefault(cb => cb.SysNo == promotion.PromotionSysNo);
                            comboTable.Rows.Add(new string[]
                            {
                                comboInfo == null ? null : comboInfo.Name.Content,
                                (promotion.DiscountAmount.Value / promotion.Time.Value).ToString(SOConst.DecimalFormat),
                                promotion.Time.Value.ToString(),
                                promotion.DiscountAmount.Value.ToString(SOConst.DecimalFormat)
                            });
                        });
                    }
                }
                #endregion

                #region 填充推荐商品信息
                string result = string.Empty;
                //测试订单号:388280
                List <CommendatoryProductsInfo> list = ObjectFactory <ISODA> .Instance.GetCommendatoryProducts(int.Parse(soInfo.BaseInfo.SOID));

                if (list != null && list.Count > 0)
                {
                    result = "<br /><table width=\"650px\" style=\"border-collapse: collapse; border: 1px solid #ddd;\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                             "<tr style=\"background:#fff;\">\n" +
                             "<td style=\"width:30px; padding:10px 0 0 10px;\"><img src=\"http://c1.neweggimages.com.cn/NeweggPic2/Marketing/201108/chuhuo/images/icon_4.jpg\" /></td>\n" +
                             "<td style=\"text-align:left; padding:10px 0 0 5px;\"><span style=\"font-family:\"微软雅黑\";font-size:16px; display:inline-block; padding:0; padding-left:5px;\"><strong>我们猜您可能还对下面的商品感兴趣</strong></span></td>\n" +
                             "</tr>\n" +
                             "</table>\n" +
                             "<div style=\"padding-top:10px;border-collapse: collapse; border: 1px solid #ddd;width:648px\">" +
                             "<table cellspacing=\"0\" cellpadding=\"0\" style=\"padding-bottom:10px;border-collapse: collapse; border:0;\">\n" +
                             "<tr style=\" background:#fff;\">\n" +
                             "[RevommendProductList1]\n" +
                             "</tr>\n" +
                             "<tr style=\"background:#fff;\">\n" +
                             "[RevommendProductList2]\n" +
                             "</tr>\n" +
                             "</table>\n" +
                             "</div>";
                    string item1 = string.Empty,
                           item2 = string.Empty;

                    IEnumerator <CommendatoryProductsInfo> rator = list.Take(3).GetEnumerator();
                    while (rator.MoveNext())
                    {
                        CommendatoryProductsInfo entity = rator.Current;
                        item1 += ReplaceCommendatoryProduct(entity, emailTemplateID);
                    }
                    rator = list.Skip(3).Take(3).GetEnumerator();
                    while (rator.MoveNext())
                    {
                        CommendatoryProductsInfo entity = rator.Current;
                        item2 += ReplaceCommendatoryProduct(entity, emailTemplateID);
                    }

                    result = result.Replace("[RevommendProductList1]", item1)
                             .Replace("[RevommendProductList2]", item2);

                    keyValueVariables.Add("CommendatoryProducts", result);
                }
                #endregion

                #region 填充备注信息
                string memo = string.Empty;
                if (!string.IsNullOrEmpty(soInfo.BaseInfo.MemoForCustomer))
                {
                    memo = @"<table border='0' cellpadding='5' cellspacing='0' style='width: 650px; border-collapse: collapse;font-size: 9pt;'>
                                <tr>
                                    <td style='border: 1px solid #ddd; color: #FF4E00; font-size: 10.5pt; font-weight: bold; background: #F2F2F2;'>
                                        备注信息
                                    </td>
                                </tr>
                                <tr>
                                    <td id='Memo' style='border: 1px solid #ddd;'>
                                        " + soInfo.BaseInfo.MemoForCustomer + @"
                                    </td>
                                </tr>
                            </table>";
                    keyValueVariables.Add("Memo", memo);
                }
                #endregion

                ExternalDomainBroker.SendExternalEmail(customerEmail, emailTemplateID, keyValueVariables, keyTableVariables, customerInfo.FavoriteLanguageCode);
            }
            catch (Exception ex)
            {
                ExceptionHelper.HandleException(ex);
            }
        }