コード例 #1
0
        public SplitFltOrderResponseViewModel SplitFltOrder(SplitFltOrderRequestViewModel request)
        {
            SplitFltOrderResponseViewModel responseViewModel = new SplitFltOrderResponseViewModel();

            using (var transaction = this.Context.Database.BeginTransaction())
            {
                try
                {
                    responseViewModel.OrderIdList = _splitFltOrderServiceBll.SplitFltOrderByPassenger(request.OrderId,
                                                                                                      request.Oid);
                    if (responseViewModel.OrderIdList == null || responseViewModel.OrderIdList.Count == 0)
                    {
                        throw new Exception("拆分异常");
                    }

                    foreach (var orderid in responseViewModel.OrderIdList)
                    {
                        _corpAduitOrderServiceBll.Copy(request.OrderId, orderid);
                    }

                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw;
                }
            }

            return(responseViewModel);
        }
コード例 #2
0
        /// <summary>
        /// 复制国内机票订单
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public CopyFltDomesticOrderResponseViewModel CopyFltDomesticOrder(CopyFltDomesticOrderRequestViewModel request)
        {
            if (request.CopyFromOrderId == 0)
            {
                throw new Exception("请传入复制来源订单号");
            }

            //1.获取原始订单详情
            //2.新增新订单(订单主体信息,行程信息,乘机人信息,保险信息,票号信息,审批信息),并关联原始订单号
            //3.如果是虚退复制,则将原订单设置线上隐藏
            CopyFltOrderModel copyFltOrderModel = Mapper.Map <CopyFltDomesticOrderRequestViewModel, CopyFltOrderModel>(request);
            int orderid = 0;

            using (var transaction = this.Context.Database.BeginTransaction())
            {
                try
                {
                    orderid = _copyFltDomesticOrderServiceBll.CopyOrder(copyFltOrderModel);
                    _corpAduitOrderServiceBll.Copy(copyFltOrderModel.CopyFromOrderId, orderid);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw;
                }
            }

            return(new CopyFltDomesticOrderResponseViewModel()
            {
                OrderId = orderid
            });
        }
コード例 #3
0
        public CopyTraOrderResponseViewModel CopyTraOrder(CopyTraOrderRequestViewModel request)
        {
            //1.获取原始订单详情
            //2.新增新订单(订单主体信息,订单状态,行程信息,乘车人信息,审批信息),并关联原始订单号
            //3.如果是虚退复制,则将原订单设置线上隐藏
            int orderid = 0;
            CopyTraOrderModel copyTraOrderModel = Mapper.Map <CopyTraOrderRequestViewModel, CopyTraOrderModel>(request);

            using (var transaction = this.Context.Database.BeginTransaction())
            {
                try
                {
                    //新增复制订单
                    orderid = _copyTraOrderServiceBll.CopyOrder(copyTraOrderModel);
                    _corpAduitOrderServiceBll.Copy(request.CopyFromOrderId, orderid);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw;
                }
            }

            return(new CopyTraOrderResponseViewModel()
            {
                OrderId = orderid
            });
        }