示例#1
0
        public AddModApplyResponseViewModel AddModApply(AddModApplyRequestViewModel request)
        {
            int rmid = 0;

            AddRetModApplyModel modApplyModel = Mapper.Map <AddModApplyRequestViewModel, AddRetModApplyModel>(request);

            //1.获取改签乘客
            CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid);

            modApplyModel.Customer       = customerModel;
            modApplyModel.IsOnlineRefund = request.IsOnline;
            modApplyModel.OrderType      = "M";
            modApplyModel.CorpId         = customerModel.CorpID;

            CorporationModel corporationModel = _getCorpServiceBll.GetCorp(customerModel.CorpID);

            if (corporationModel.IsAmplitudeCorp == "T")
            {
                modApplyModel.OrderStatus = "T";
            }


            using (var transaction = this.Context.Database.BeginTransaction())
            {
                try
                {
                    rmid = _addFltDomesticModApplyServiceBll.AddModApply(modApplyModel);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw;
                }
            }
            new TaskFactory().StartNew(() =>
            {
                //2.发送提醒邮件
                OperatorModel operatorModel = _getOperatorServiceBll.GetOperatorByOid(corporationModel.ResponsibleOid);
                string mail            = operatorModel.Email;
                string corporationName = corporationModel.CorpName;

                StringBuilder mailContent = new StringBuilder();
                mailContent.Append("<b>客户改签提醒:<b/>");
                mailContent.Append("<br/>");
                mailContent.Append("[" + corporationName + "] 已经申请了改签,订单编号:" + request.OrderId.ToString() + ",请差旅顾问及时处理!");
                mailContent.Append("<br/>");
                mailContent.Append("<b>下单时间:" + DateTime.Now + ",请及时关注~<b/>");
                if (!string.IsNullOrEmpty(mail))
                {
                    bool flag = EmailHelper.SendEmail("", "客户改签提醒", null, null, mailContent.ToString(), mail);
                }
            });

            return(new AddModApplyResponseViewModel()
            {
                Rmid = rmid
            });
        }
示例#2
0
        public ResponseBaseViewModel <AddModApplyResponseViewModel> AddModApply([FromBody] AddModApplyRequestViewModel request)
        {
            request.Cid         = this.GetCid();
            request.OrderSource = this.GetOrderSource();
            AddModApplyResponseViewModel responseViewModel = _addFltDomesticModApplyViewApplication.AddModApply(request);

            ResponseBaseViewModel <AddModApplyResponseViewModel> v = new ResponseBaseViewModel <AddModApplyResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }