示例#1
0
 /// <summary>
 /// 提交CS处理
 /// </summary>
 /// <param name="item"></param>
 public virtual void SubmitReplyToCSProcess(ECCentral.BizEntity.SO.SOComplaintCotentInfo item)
 {
     ECCentral.BizEntity.Customer.CustomerInfo customer = ExternalDomainBroker.GetCustomerInfo(item.CustomerSysNo.Value);
     item.CustomerEmail = customer.BasicInfo.Email;
     item.CustomerName  = customer.BasicInfo.CustomerName;
     item.CustomerPhone = customer.BasicInfo.CellPhone;
     ExternalDomainBroker.AddComplain(item);
 }
示例#2
0
        /// <summary>
        /// 回复邮件操作,并发送邮件
        /// </summary>
        /// <param name="item"></param>
        public virtual void UpdateProductReviewMailLog(ProductReview item)
        {
            //保存邮件日志
            if (!string.IsNullOrEmpty(item.ProductReviewMailLog.TopicMailContent.Content) || !string.IsNullOrEmpty(item.ProductReviewMailLog.CSNote.Content))
            {
                if (productReviewMailLogDA.CheckProductCommentMailLog(item.ProductReviewMailLog))
                {
                    productReviewMailLogDA.UpdateProductCommentMailLog(item.ProductReviewMailLog);
                }
                else
                {
                    productReviewMailLogDA.CreateProductCommentMailLog(item.ProductReviewMailLog);
                }
            }
            productReviewDA.UpdateProductReview(item);

            #region 发送邮件
            KeyValueVariables replaceVariables = new KeyValueVariables();

            ECCentral.BizEntity.IM.ProductInfo product = ExternalDomainBroker.GetProductInfo(item.ProductSysNo.Value);
            replaceVariables.AddKeyValue(@"ProductID", product.ProductID);
            replaceVariables.AddKeyValue(@"ProductName", product.ProductName);

            replaceVariables.AddKeyValue(@"ProductLink", item.ProductID);
            replaceVariables.AddKeyValue(@"Title", item.Title);
            replaceVariables.AddKeyValue(@"ProductContent", string.Format(ResouceManager.GetMessageString("MKT.Comment", "Comment_ProductReviewMailMainContent"), item.Prons, item.Cons, item.Service));

            //replaceVariables.AddKeyValue(@"#InUser#", ServiceContext.Current.);
            //replaceVariables.AddKeyValue(@"#InDateAll#", DateTime.Now.ToString());
            replaceVariables.AddKeyValue(@"InDateAll-Y", DateTime.Now.Year.ToString());
            replaceVariables.AddKeyValue(@"InDateAll-M", DateTime.Now.Month.ToString());
            replaceVariables.AddKeyValue(@"InDateAll-D", DateTime.Now.Day.ToString());

            replaceVariables.AddKeyValue(@"EmailText", item.ProductReviewMailLog.TopicMailContent.Content);
            replaceVariables.AddKeyValue(@"All", DateTime.Now.ToString());
            replaceVariables.AddKeyValue(@"InDate-Y", DateTime.Now.Year.ToString());
            replaceVariables.AddKeyValue(@"InDate-M", DateTime.Now.Month.ToString());
            replaceVariables.AddKeyValue(@"InDate-D", DateTime.Now.Day.ToString());
            replaceVariables.AddKeyValue(@"Year", DateTime.Now.Year.ToString());

            ECCentral.BizEntity.Customer.CustomerInfo customer = ExternalDomainBroker.GetCustomerInfo(item.CustomerSysNo.Value);
            replaceVariables.AddKeyValue(@"CustomerName", customer.BasicInfo.CustomerID);
            if (string.IsNullOrEmpty(customer.BasicInfo.Email))
            {
                //throw new BizException("邮件地址为空!");
                throw new BizException(ResouceManager.GetMessageString("MKT.ProductReview", "ProductReview_EmailNotNull"));
            }
            else
            {
                ECCentral.Service.Utility.EmailHelper.SendEmailByTemplate(customer.BasicInfo.Email, "MKT_ProductReviewMailContent", replaceVariables, false);
            }
            #endregion
        }
        public ProductPriceCompareEntity Load(int sysNo)
        {
            var productPriceCompare = _ProductPriceCompareDA.Load(sysNo);

            var productInfo = ExternalDomainBroker.GetProductInfo(productPriceCompare.ProductSysNo);

            if (productInfo != null)
            {
                productPriceCompare.ProductID   = productInfo.ProductID;
                productPriceCompare.ProductName = productInfo.ProductBasicInfo.ProductBriefName;
            }
            var customerInfo = ExternalDomainBroker.GetCustomerInfo(productPriceCompare.CustomerSysNo);

            if (customerInfo != null)
            {
                productPriceCompare.CustomerID    = customerInfo.BasicInfo.CustomerID;
                productPriceCompare.CustomerName  = customerInfo.BasicInfo.CustomerName;
                productPriceCompare.CustomerEmail = customerInfo.BasicInfo.Email;
            }

            return(productPriceCompare);
        }
        /// <summary>
        /// 回复邮件操作,并发送邮件
        /// </summary>
        /// <param name="item"></param>
        public virtual void UpdateProductConsultMailLog(ProductReview item)
        {
            if (productReviewMailLogDA.CheckProductCommentMailLog(item.ProductReviewMailLog))
            {
                productReviewMailLogDA.UpdateProductCommentMailLog(item.ProductReviewMailLog);
            }
            else
            {
                productReviewMailLogDA.CreateProductCommentMailLog(item.ProductReviewMailLog);
            }

            #region 发送邮件
            KeyValueVariables replaceVariables = new KeyValueVariables();

            ECCentral.BizEntity.IM.ProductInfo product = ExternalDomainBroker.GetProductInfo(item.ProductSysNo.Value);
            replaceVariables.AddKeyValue(@"ProductID", product.ProductID);
            replaceVariables.AddKeyValue(@"ProductName", product.ProductName);

            replaceVariables.AddKeyValue(@"Content", item.ProductReviewMailLog.Content);
            replaceVariables.AddKeyValue(@"EmailText", item.ProductReviewMailLog.TopicMailContent.Content);
            replaceVariables.AddKeyValue(@"All", DateTime.Now.ToString());
            replaceVariables.AddKeyValue(@"InDate-Y", DateTime.Now.Year.ToString());
            replaceVariables.AddKeyValue(@"InDate-M", DateTime.Now.Month.ToString());
            replaceVariables.AddKeyValue(@"InDate-D", DateTime.Now.Day.ToString());
            replaceVariables.AddKeyValue(@"Year", DateTime.Now.Year.ToString());

            ECCentral.BizEntity.Customer.CustomerInfo customer = ExternalDomainBroker.GetCustomerInfo(item.CustomerSysNo.Value);
            replaceVariables.AddKeyValue(@"CustomerName", customer.BasicInfo.CustomerID);
            if (string.IsNullOrEmpty(customer.BasicInfo.Email))
            {
                throw new BizException("邮件地址为空!");
            }
            else
            {
                ECCentral.Service.Utility.EmailHelper.SendEmailByTemplate(customer.BasicInfo.Email, "MKT_ProductConsultMailContent", replaceVariables, false);
            }
            #endregion
        }
示例#5
0
        /// <summary>
        /// 检查客户条件是否满足
        /// </summary>
        /// <param name="customerSysNo"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        protected virtual List <string> CheckCustomerCondition(SOInfo soInfo, PSCustomerCondition condition)
        {
            List <string> errorList = new List <string>();

            if (condition == null)
            {
                return(errorList);
            }
            CustomerInfo customerInfo = ExternalDomainBroker.GetCustomerInfo(soInfo.BaseInfo.CustomerSysNo.Value);

            if (customerInfo == null)
            {
                //throw new BizException("订单信息异常:找不到该客户的详细信息!");
                throw new BizException(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_NeedCustomerInfo"));
            }
            if (condition.NeedEmailVerification.HasValue && condition.NeedEmailVerification.Value)
            {
                if (customerInfo.BasicInfo.IsEmailConfirmed == null || !customerInfo.BasicInfo.IsEmailConfirmed.Value)
                {
                    //errorList.Add("该客户的Email未验证,不符合要求!");
                    errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_ErrorEmail"));
                    return(errorList);
                }
            }
            if (condition.NeedMobileVerification.HasValue && condition.NeedMobileVerification.Value)
            {
                if (customerInfo.BasicInfo.CellPhoneConfirmed == null || !customerInfo.BasicInfo.CellPhoneConfirmed.Value)
                {
                    //errorList.Add("该客户的手机未验证,不符合要求!");
                    errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_ErrorPhone"));
                    return(errorList);
                }
            }
            if (condition.InvalidForAmbassador.HasValue && condition.InvalidForAmbassador.Value)
            {
                if (customerInfo.AgentInfo != null)
                {
                    //errorList.Add("该活动泰隆优选大使不可参加!");
                    errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_CanntBeJoin"));
                    return(errorList);
                }
            }
            if (condition.RelAreas != null && condition.RelAreas.AreaList != null && condition.RelAreas.AreaList.Count > 0)
            {
                int      districtSysNo = customerInfo.BasicInfo.DwellAreaSysNo.Value;
                AreaInfo area          = ObjectFactory <ICommonBizInteract> .Instance.GetAreaInfo(districtSysNo);

                if (condition.RelAreas.AreaList.Find(f => f.SysNo == area.ProvinceSysNo) == null)
                {
                    //errorList.Add("该客户的所属地不在本活动的限定地区范围内!");
                    errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_ErrorArea"));
                    return(errorList);
                }
            }

            if (condition.RelCustomerRanks != null && condition.RelCustomerRanks.CustomerRankList != null && condition.RelCustomerRanks.CustomerRankList.Count > 0)
            {
                if (condition.RelCustomerRanks.CustomerRankList[0].SysNo.Value != -1)
                {
                    if (condition.RelCustomerRanks.CustomerRankList.Find(f => f.SysNo == (int)customerInfo.Rank.Value) == null)
                    {
                        //errorList.Add("该用户不在本活动的限定用户组范围内!");
                        errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_ErrorUser"));
                        return(errorList);
                    }
                }
            }

            if (condition.RelCustomers != null && condition.RelCustomers.CustomerIDList != null && condition.RelCustomers.CustomerIDList.Count > 0)
            {
                if (condition.RelCustomers.CustomerIDList.Find(f => f.CustomerSysNo == customerInfo.SysNo) == null)
                {
                    //errorList.Add("该用户不属于本活动的绑定用户!");
                    errorList.Add(ResouceManager.GetMessageString("MKT.Calculate", "Calculate_UserOutOfArry"));
                    return(errorList);
                }
            }

            return(errorList);
        }