Пример #1
0
        public static void SaveAgreePostponeLog(PostponeApplyform postponeApplyform, PostponeView postponeView, string operatorAccount)
        {
            var log = new Log.Domain.OrderLog()
            {
                OrderId     = postponeApplyform.OrderId,
                ApplyformId = postponeApplyform.Id,
                Keyword     = "改期处理",
                Content     = "同意改期",
                Company     = Organization.Domain.Platform.Instance.Id,
                Account     = operatorAccount,
                Role        = OperatorRole.Platform,
                VisibleRole = OrderRole.Platform | OrderRole.Purchaser | OrderRole.Supplier | OrderRole.Provider | OrderRole.OEMOwner
            };

            LogService.SaveOrderLog(log);
        }
Пример #2
0
        /// <summary>
        /// 同意改期
        /// </summary>
        internal void Agree(PostponeView postponeView, string operatorAccount, string @operator)
        {
            if (this.Status == PostponeApplyformStatus.Applied || this.Status == PostponeApplyformStatus.Paid)
            {
                if (postponeView == null || postponeView.Items == null || !postponeView.Items.Any())
                {
                    throw new CustomException("改期信息不能为空");
                }
                foreach (var flight in this.Flights)
                {
                    var postponeVoyageView = postponeView.Items.FirstOrDefault(item => flight.OriginalFlight.IsSameVoyage(item.AirportPair));
                    if (postponeVoyageView == null)
                    {
                        throw new NotFoundException("缺少航段【" + flight.OriginalFlight.Departure.Code + "-" + flight.OriginalFlight.Arrival.Code + "】的改期信息");
                    }
                    flight.NewFlight.FlightNo    = postponeVoyageView.FlightNo;
                    flight.NewFlight.AirCraft    = postponeVoyageView.AirCraft;
                    flight.NewFlight.TakeoffTime = postponeVoyageView.TakeoffTime;
                    flight.NewFlight.LandingTime = postponeVoyageView.LandingTime;

                    flight.OriginalFlight.Ticket.RemoveFlight(flight.OriginalFlight);
                    flight.OriginalFlight.Ticket.AddFlight(flight.NewFlight);
                }
                if (!PNRPair.IsNullOrEmpty(postponeView.NewPNR))
                {
                    this.NewPNR = postponeView.NewPNR;
                }
                this.Status          = PostponeApplyformStatus.Postponed;
                this.Operator        = @operator;
                this.OperatorAccount = operatorAccount;
                Processed();
                this.Order.Update(this);
            }
            else
            {
                throw new StatusException(this.Id.ToString());
            }
        }
Пример #3
0
 /// <summary>
 /// 同意改期
 /// </summary>
 public void AgreePostponeWithoutFee(decimal applyformId, PostponeView postponeView)
 {
     Service.ApplyformProcessService.AgreePostpone(applyformId, postponeView, CurrentUser.UserName, CurrentUser.Name);
     BasePage.ReleaseLock(applyformId);
 }