void UCGiftCardUsageDetail_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCGiftCardUsageDetail_Loaded); facade = new GiftCardFacade(CPApplication.Current.CurrentPage); comGiftCardStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.GiftCardStatus>(); comGiftCardCategory.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.GiftCardType>(); customerInfo = new BizEntity.Customer.CustomerInfo(); this.btnSave.Visibility = System.Windows.Visibility.Collapsed; this.btnVoid.Visibility = System.Windows.Visibility.Collapsed; if (VM != null) { VM.ChannelID = "1"; oldEndDate = VM.EndDate; BaseInfo.DataContext = VM; customerInfo.BasicInfo.CustomerID = VM.CustomerID; customerInfo.BasicInfo.CustomerSysNo = int.Parse(string.IsNullOrEmpty(VM.CustomerSysNo)?"0":VM.CustomerSysNo); facade.GetGiftCardOperateLogByCode(VM.CardCode, (obj, args) => { if (args.FaultsHandle()) { return; } List <ECCentral.BizEntity.IM.GiftCardOperateLog> logs = args.Result; if (logs != null && logs.Count > 0) { StringBuilder str = new StringBuilder(); logs = logs.OrderByDescending(p => p.InDate).ToList(); foreach (ECCentral.BizEntity.IM.GiftCardOperateLog log in logs) { str.AppendFormat("{0} {1} by {2} {3}", log.InDate.Value.ToString("yyyy-MM-dd HH:mm"), log.ActionType.ToDescription(), log.InUser, log.Memo); str.AppendLine(); } tbLog.Text = str.ToString().TrimEnd(); } }); facade.GetGiftCardRedeemLogJoinSOMaster(VM.CardCode, (obj, args) => { if (args.FaultsHandle()) { return; } DataGrid.ItemsSource = args.Result; }); if ((VM.Status == GiftCardStatus.Valid || VM.Status == GiftCardStatus.ManualActive) && VM.AvailAmount.HasValue && VM.AvailAmount > 0) { this.btnSave.Visibility = System.Windows.Visibility.Visible; //this.btnVoid.Visibility = System.Windows.Visibility.Visible; } else { this.dpEndDate.IsEnabled = false; } } }
/// <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); }
/// <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 }
/// <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 }