Beispiel #1
0
        /// <summary>
        /// 获取申请单的业务模式
        /// </summary>
        /// <param name="request">申请单信息</param>
        /// <returns>业务模式描述信息,比如:(泰隆优选销售,泰隆优选仓储,泰隆优选配送,商家:泰隆优选网)</returns>
        public virtual string GetBusinessModel(RMARequestInfo request)
        {
            string businessType = string.Empty;

            if (!string.IsNullOrEmpty(GetBusinessTypeString(request.InvoiceType)))
            {
                //{0}销售
                businessType += string.Format(ResouceManager.GetMessageString("RMA.Request", "InvoiceTypeFormat"), GetBusinessTypeString(request.InvoiceType));
            }
            if (!string.IsNullOrEmpty(GetBusinessTypeString(request.StockType)))
            {
                //{0}仓储
                businessType += string.Format(ResouceManager.GetMessageString("RMA.Request", "StockTypeFormat"), GetBusinessTypeString(request.StockType));
            }

            if (!string.IsNullOrEmpty(GetBusinessTypeString(request.ShippingType)))
            {
                //{0}配送
                businessType += string.Format(ResouceManager.GetMessageString("RMA.Request", "ShippingTypeFormat"), GetBusinessTypeString(request.ShippingType));
            }

            string vendorName = string.Empty;

            ///为符合IPP逻辑而改
            ///ipp中 NEG订单时MerchantSysNo=0, 不用加载商家信息
            ///改之前代码:if (request.MerchantSysNo.HasValue)
            ///改之后代码如下:
            if (request.MerchantSysNo.HasValue && request.MerchantSysNo != 0)
            {
                //获取Merchant的信息
                var merchantInfo = ExternalDomainBroker.GetVendorFinanceInfoByVendorSysNo(request.MerchantSysNo.Value);
                if (!string.IsNullOrEmpty(merchantInfo.VendorBasicInfo.VendorBriefName))
                {
                    //商家:{0}
                    vendorName = string.Format(ResouceManager.GetMessageString("RMA.Request", "SellerTypeFormat"), merchantInfo.VendorBasicInfo.VendorBriefName);
                }
            }
            if (request.InvoiceType.HasValue && request.StockType.HasValue && request.ShippingType.HasValue)
            {
                if (request.InvoiceType == InvoiceType.SELF && request.StockType == BizEntity.Invoice.StockType.SELF && request.ShippingType == BizEntity.Invoice.DeliveryType.SELF)
                {
                    //商家:{0}
                    vendorName = string.Format(ResouceManager.GetMessageString("RMA.Request", "SellerTypeFormat"), ResouceManager.GetMessageString("RMA.Request", "SellerType_Self"));
                }
            }
            return(businessType + vendorName);
        }
Beispiel #2
0
        public virtual void SendDunEmail(int OutboundSysNo, int RegisterSysNo, int SendMailCount, int SOSysNo)
        {
            if (outBoundDA.UpdateOutboundItemSendEmailCount(OutboundSysNo, RegisterSysNo, SendMailCount))
            {
                #region 构建邮件模板,调用EmailService发送邮件

                RMARegisterInfo registerInfo = ObjectFactory <IRegisterDA> .Instance.LoadBySysNo(RegisterSysNo);

                int productSysNo = registerInfo.BasicInfo.ProductSysNo.Value;

                ProductManagerInfo pmInfo  = ExternalDomainBroker.GetPMInfoByProductSysNo(productSysNo);
                ProductInfo        product = ExternalDomainBroker.GetProductInfo(productSysNo);

                DataRow  dr         = outBoundDA.GetOutboundBySysNo(OutboundSysNo);
                string   vendorName = string.Empty;
                DateTime outTime    = DateTime.Now;
                if (dr != null)
                {
                    vendorName = dr["VendorName"].ToString();
                    outTime    = Convert.ToDateTime(dr["OutTime"]);
                }
                int        vendorSysNo = Convert.ToInt32(dr["VendorSysNo"]);
                VendorInfo vendorInfo  = ExternalDomainBroker.GetVendorFinanceInfoByVendorSysNo(vendorSysNo);

                SOInfo soInfo   = ExternalDomainBroker.GetSOInfo(SOSysNo);
                string SODate   = soInfo.BaseInfo.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
                string Warranty = soInfo.Items.Where(p => p.ProductSysNo == productSysNo).FirstOrDefault().Warranty;

                //填充邮件模板
                KeyValueVariables vars = new KeyValueVariables();
                vars.Add("CurrentYear", DateTime.Now.Year);
                vars.Add("CurrentMonth", DateTime.Now.Month);
                vars.Add("CurrentDay", DateTime.Now.Day);
                vars.Add("CurrentTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                ///Load单件填充的数据
                vars.Add("RegisterSysNo", registerInfo.SysNo.Value);
                vars.Add("ProductID", product.ProductID);
                vars.Add("ProductName", product.ProductName);
                vars.Add("Memo", registerInfo.BasicInfo.Memo);
                vars.Add("RefundStatus", registerInfo.BasicInfo.RefundStatus);
                vars.Add("RevertStatus", registerInfo.RevertInfo.RevertStatus);
                vars.Add("ProductCost", registerInfo.BasicInfo.Cost);

                vars.Add("PMName", pmInfo.UserInfo.UserDisplayName);

                vars.Add("Day", GetTimeSpan(outTime).Days);
                vars.Add("Hour", GetTimeSpan(outTime).Hours);
                vars.Add("Secend", GetTimeSpan(outTime).Minutes);
                vars.Add("VendorName", vendorName);
                vars.Add("OutTime", outTime.ToString("yyyy-MM-dd HH:mm:ss"));

                vars.Add("SOSysNo", SOSysNo);
                vars.Add("SODate", SODate);
                vars.Add("Warranty", Warranty);

                vars.Add("IsContact", IsContactDesc(vendorInfo));
                vars.Add("PayPeriodType", vendorInfo.VendorFinanceInfo.PayPeriodType.PayTermsName);

                string ccAddress = AppSettingManager.GetSetting("RMA", "OutBoundNotReturnEmails");
                EmailHelper.SendEmailByTemplate(pmInfo.UserInfo.EmailAddress, ccAddress, "", "SendDunMailForOutBoundNotReturn", vars, null, true, true);
                #endregion
            }
        }