示例#1
0
        private void queryExternalOrderList(Pagination pagination)
        {
            var isPlatform = CurrentCompany.CompanyType == CompanyType.Platform;

            try
            {
                var list = OrderQueryService.QueryExternalOrders(getCondition(), pagination).Select(item =>
                {
                    var fare                = item.Flights.Sum(f => f.Fare).TrimInvaidZero();
                    var airportFee          = item.Flights.Sum(f => f.AirportFee).TrimInvaidZero();
                    var BAF                 = item.Flights.Sum(f => f.BAF).TrimInvaidZero();
                    var settleAmount        = item.SettlementForPurchaser.Amount.TrimInvaidZero();
                    var rebateAndCommission = string.Format("{0}%/{1}", (item.SettlementForPurchaser.Rebate * 100).TrimInvaidZero(),
                                                            item.SettlementForPurchaser.Commission.TrimInvaidZero());
                    return(new
                    {
                        InternalOrderId = item.OrderId,
                        PlatformType = item.PlatformType.GetDescription(),
                        PlatformTypeValue = (byte)item.PlatformType,
                        OrderId = "<a href=\"ExternalOrderDetail.aspx?id=" + item.OrderId + "\">" + item.ExternalOrderId + "(外部)</a><br />" +
                                  "<a href=\"" + (isPlatform ? "/OrderModule/Operate/OrderDetail.aspx?id=" : "OrderDetail.aspx?id=") + item.OrderId + "\">" +
                                  item.OrderId + "(内部)</a>",
                        PNR = item.ETDZPNR != null ? item.ETDZPNR.ToListString() : item.ReservationPNR == null ? string.Empty : item.ReservationPNR.ToListString(),
                        FlightInfo = string.Join("<br/>", item.Flights.Select(f => string.Format("{0}{1} {2} {3}-{4}<br/>{5}",
                                                                                                 f.Carrier, f.FlightNo, f.Bunk, f.DepartureCity, f.ArrivalCity, f.TakeoffTime.ToString("yyyy-MM-dd HH:mm")))),
                        Passengers = string.Join("<br/>", item.Passengers),
                        Price = fare + "</br>" + airportFee + "/" + BAF,
                        Commission = settleAmount + "<br/>" + rebateAndCommission,
                        ProducedTime = item.ProducedTime.ToString("yyyy-MM-dd<br />HH:mm:ss"),
                        PayStatus = item.PayStatus == PayStatus.NoPay?item.PayStatus.GetDescription() :item.PayStatus.GetDescription() + (item.IsAutoPay ? "(自动)" : "(手工)"),
                        Status = item.Status == OrderStatus.Finished ? "已出票" : "未出票",
                        InternalPayStatus = Service.Order.StatusService.GetOrderStatus(item.Status, DataTransferObject.Order.OrderRole.Provider)
                    });
                });
                this.dataList.DataSource = list;
                this.dataList.DataBind();
                if (list.Count() > 0)
                {
                    this.dataList.Visible      = true;
                    this.emptyDataInfo.Visible = false;
                    this.pager.Visible         = true;
                    if (pagination.GetRowCount)
                    {
                        this.pager.RowCount = pagination.RowCount;
                    }
                }
                else
                {
                    this.dataList.Visible      = false;
                    this.emptyDataInfo.Visible = true;
                    this.pager.Visible         = false;
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "查询");
            }
        }