Ejemplo n.º 1
0
        public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context)
        {
            string           baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"];
            RestClient       client  = new RestClient(baseUrl);
            RestServiceError error;

            ECCentral.BizEntity.IM.ProductInfo product = new ECCentral.BizEntity.IM.ProductInfo();
            product.CompanyCode = "8601";
            product.SysNo       = 4234534;
            var ar = client.Update("/MKTService/Job/BatchUpdateKeywordsFromQueue", product, out error);
        }
Ejemplo n.º 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
        }
Ejemplo n.º 3
0
        public virtual void BatchUpdateKeywordsFromProduct(ECCentral.BizEntity.IM.ProductInfo product)
        {
            ProductKeywordsQueue productInfo = keywordDA.GetSingleProduct(product.CompanyCode, product.SysNo);
            int index = 0;

            if (productInfo == null)
            {
                return;
            }
            //WriteLog("没有找到Product SysNo 为{0}的数据", productId);
            //WriteLog("正在更新的Product SysNo为{0}的keywords", productId);
            BatchUpdateProductPageKeywords(product.CompanyCode, new List <ProductKeywordsQueue> {
                productInfo
            }, ref index);
        }
        /// <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
        }
Ejemplo n.º 5
0
 public virtual void BatchUpdateKeywordsFromProduct(ECCentral.BizEntity.IM.ProductInfo product)
 {
     ObjectFactory <ProductPageKeywordsProcessor> .Instance.BatchUpdateKeywordsFromProduct(product);
 }
 public virtual void BatchUpdateKeywordsFromProduct(ECCentral.BizEntity.IM.ProductInfo product)
 {
     productPageKeywordsAppService.BatchUpdateKeywordsFromProduct(product);
 }