Пример #1
0
        /// <summary>
        /// 撮合交易回复发送邮件
        /// </summary>
        /// <param name="info"></param>
        public static void SendMailMatchedTradingReply(ProductMatchedTradingReplyInfo info, int productSysNo, string productName)
        {
            AsyncEmail email = new AsyncEmail();

            email.MailAddress = info.CustomerInfo.Email;
            email.CustomerID  = info.CustomerInfo.CustomerID;
            email.Status      = (int)EmailStatus.NotSend;
            email.ImgBaseUrl  = ConfigurationManager.AppSettings["CDNWebDomain"].ToString();

            string subject = string.Empty;

            email.MailBody = MailHelper.GetMailTemplateBody("ConsultReply", out subject);
            string productdetail = ConstValue.WebDomain + "/Product/Detail/" + productSysNo.ToString();

            MatchedTradingInfo consultInfo = MatchedTradingDA.GetProductMatchedTrading(info.MatchedTradingSysNo);

            email.MailSubject = subject;
            email.MailBody    = email.MailBody.Replace("[ProducDetail]", productdetail)
                                .Replace("[ProductName]", productName)
                                .Replace("[ImgBaseUrl]", email.ImgBaseUrl)
                                .Replace("[WebBaseUrl]", ConstValue.WebDomain)
                                .Replace("[CurrentDateTime]", DateTime.Now.ToString("yyyy-MM-dd"))
                                .Replace("[Content]", StringUtility.RemoveHtmlTag(consultInfo.Content))
                                .Replace("[ReplyContent]", StringUtility.RemoveHtmlTag(info.Content));

            EmailDA.SendEmail(email);
        }
        public ActionResult AjaxSaveReplay()
        {
            string sysNoText = Request.Form["SysNo"];
            int    sysNo     = 0;

            int.TryParse(sysNoText, out sysNo);
            if (sysNo > 0)
            {
                string content = Request.Form["Content"];
                if (!string.IsNullOrEmpty(content))
                {
                    ProductMatchedTradingReplyInfo entity = new ProductMatchedTradingReplyInfo();
                    entity.ReplyContent        = content;
                    entity.MatchedTradingSysNo = sysNo;
                    entity.SellerSysNo         = UserAuthHelper.GetCurrentUser().SellerSysNo;
                    entity.Status      = "A";
                    entity.StatusValue = "A";
                    entity.Type        = "M";
                    //entity.NeedAdditionalText = "N";

                    entity.InUser = UserAuthHelper.GetCurrentUser().UserID;
                    //entity.InUser = UserAuthHelper.GetCurrentUser().SellerName;
                    entity.InDate = DateTime.Now;

                    ProductMatchedTradingService.AddProductMatchedTradingReply(entity);

                    return(Json(entity));
                }
            }
            return(Json(1));
        }
Пример #3
0
        /// <summary>
        /// 添加产品咨询回复:添加产品咨询回复有3种方式:
        /// 1.	网友回复,需通过审核才展示。
        /// 2.	厂商回复(通过Seller Portal),需通过审核才展示。
        /// 3.	IPP系统中回复,默认直接展示。
        /// </summary>
        /// <param name="item">The item.</param>
        public static void AddProductMatchedTradingReply(ProductMatchedTradingReplyInfo item)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("ProductMatchedTrading_InsertProductMatchedTradingReply");

            dataCommand.SetParameterValue <ProductMatchedTradingReplyInfo>(item);

            dataCommand.ExecuteNonQuery();
        }
Пример #4
0
        /// <summary>
        /// 发表咨询回复
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool CreateProductMatchedTradingReply(ProductMatchedTradingReplyInfo info)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("CreateProductMatchedTradingReply");

            cmd.SetParameterValue("@MatchedTradingSysNo", info.MatchedTradingSysNo);
            cmd.SetParameterValue("@CustomerSysNo", info.CustomerSysNo);
            cmd.SetParameterValue("@Content", info.Content);

            SetCommandDefaultParameters(cmd);
            return(cmd.ExecuteNonQuery() > 0);
        }
Пример #5
0
        /// <summary>
        /// 发表撮合交易回复
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool CreateProductMatchedTradingReply(ProductMatchedTradingReplyInfo info, int productSysNo, string productName)
        {
            string   cacheKey     = CommonFacade.GenerateKey("CreateProductMatchedTradingReply", info.CustomerSysNo.ToString(), info.MatchedTradingSysNo.ToString());
            DateTime now          = DateTime.Now;
            int      nowTimePoint = now.Hour * 3600 + now.Minute * 60 + now.Second;

            if (HttpRuntime.Cache[cacheKey] != null)
            {
                int preTimePoint = (int)HttpRuntime.Cache[cacheKey];
                if (nowTimePoint - preTimePoint < 60)
                {
                    throw new BusinessException("很抱歉,您发表咨询的频率过快,请稍后再试。");
                }
            }
            else
            {
                HttpRuntime.Cache.Insert(cacheKey, 0, null, DateTime.Now.AddSeconds(CacheTime.Shortest), Cache.NoSlidingExpiration);
            }


            bool result = false;

            result = MatchedTradingDA.CreateProductMatchedTradingReply(info);
            //确认不需要发邮件
            //if (result)
            //{
            //    SendMailConsultReply(info, productSysNo, productName);
            //}
            if (result)
            {
                now          = DateTime.Now;
                nowTimePoint = now.Hour * 3600 + now.Minute * 60 + now.Second;
                HttpRuntime.Cache[cacheKey] = nowTimePoint;
            }

            return(result);
        }
 /// <summary>
 /// 添加产品评论回复
 /// </summary>
 /// <param name="item">The item.</param>
 public static void AddProductMatchedTradingReply(ProductMatchedTradingReplyInfo item)
 {
     ProductMatchedTradingDA.AddProductMatchedTradingReply(item);
 }