private void bindHeader(RefundOrScrapApplyform applyform) { RefundApplyform refundForm = applyform as RefundApplyform; var orderRole = OrderRole.Platform; lblApplyformId.Text = applyform.Id.ToString(); linkOrderId.HRef = "OrderDetail.aspx?id=" + applyform.OrderId.ToString() + "&returnUrl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery); linkOrderId.InnerText = applyform.OrderId.ToString(); this.lblApplyType.Text = string.Format("{0} {1}", applyform, refundForm != null ? (string.Format("({0})", refundForm.RefundType.GetDescription())) : string.Empty); var product = applyform.Order.IsThirdRelation ? applyform.Order.Supplier.Product : applyform.Order.Provider.Product; if (product is SpeicalProductInfo) { var specialProductInfo = product as SpeicalProductInfo; this.lblProductType.Text = applyform.Order.Product.ProductType.GetDescription() + "(" + specialProductInfo.SpeicalProductType.GetDescription() + ")"; } else { this.lblProductType.Text = applyform.Order.Product.ProductType.GetDescription(); } lblStatus.Text = StatusService.GetRefundApplyformStatus(applyform.Status, orderRole); if (applyform.Order.Provider != null && applyform.Order.Provider.Product is Service.Order.Domain.CommonProductInfo) { this.lblTicketType.Text = (applyform.Order.Provider.Product as Service.Order.Domain.CommonProductInfo).TicketType.ToString(); } else { this.lblTicketType.Text = "-"; } lblPNR.Text = AppendPNR(applyform.NewPNR, string.Empty); lblPNR.Text += AppendPNR(applyform.OriginalPNR, string.IsNullOrWhiteSpace(lblPNR.Text) ? string.Empty : "原编码:"); }
private void bindHeader(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { RefundApplyform refundForm = applyform as RefundApplyform; var orderRole = BasePage.GetOrderRole(applyform.Order); this.lblApplyformId.Text = applyform.Id.ToString(); this.linkOrderId.HRef = "OrderDetail.aspx?id=" + applyform.OrderId.ToString() + "&returnUrl=" + System.Web.HttpUtility.UrlEncode(Request.Url.PathAndQuery); this.linkOrderId.InnerText = applyform.OrderId.ToString(); this.lblApplyType.Text = string.Format("{0} {1}", applyform, refundForm != null ? (string.Format("({0})", refundForm.RefundType.GetDescription())) : string.Empty); var product = applyform.Order.IsThirdRelation && orderRole != OrderRole.Provider ? applyform.Order.Supplier.Product : applyform.Order.Provider.Product; if (product is SpeicalProductInfo) { var specialProductInfo = product as SpeicalProductInfo; this.lblProductType.Text = applyform.Order.Product.ProductType.GetDescription() + "(" + specialProductInfo.SpeicalProductType.GetDescription() + ")"; } else { this.lblProductType.Text = product.ProductType.GetDescription(); } this.lblStatus.Text = Service.Order.StatusService.GetRefundApplyformStatus(applyform.Status, orderRole); if (applyform.Order.Provider != null && applyform.Order.Provider.Product is Service.Order.Domain.CommonProductInfo) { this.lblTicketType.Text = (applyform.Order.Provider.Product as Service.Order.Domain.CommonProductInfo).TicketType.ToString(); } else { this.lblTicketType.Text = "-"; } lblPNR.Text = AppendPNR(applyform.NewPNR, string.Empty); lblPNR.Text += AppendPNR(applyform.OriginalPNR, string.IsNullOrWhiteSpace(lblPNR.Text) ? string.Empty : "原编码:"); if (applyform.Order.Provider != null && applyform.Order.Provider.PurchaserRelationType != Common.Enums.RelationType.Brother) { lblRelation.Text = applyform.Order.Provider.PurchaserRelationType.GetDescription() + "-"; hrefPurchaseName.InnerHtml = applyform.Order.Purchaser.Company.UserName + "(" + applyform.Order.Purchaser.Name + ")"; this.hrefPurchaseName.HRef = "/OrganizationModule/RoleModule/ExtendCompanyManage/LowerComapnyInfoUpdate/LowerCompanyDetailInfo.aspx?CompanyId=" + applyform.Order.Purchaser.CompanyId.ToString() + "&Type=" + (applyform.Order.Provider.PurchaserRelationType == Common.Enums.RelationType.Interior ? "Organization" : "Junion"); } else { lblRelation.Text = "平台采购"; hrefPurchaseName.Visible = false; } }
private void bindHeader(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { RefundApplyform refundForm = applyform as RefundApplyform; this.lblApplyformId.Text = applyform.Id.ToString(); this.linkOrderId.HRef = "OrderDetail.aspx?id=" + applyform.OrderId.ToString() + "&returnUrl=" + System.Web.HttpUtility.UrlEncode(Request.Url.PathAndQuery); this.linkOrderId.InnerText = applyform.OrderId.ToString(); this.lblApplyType.Text = string.Format("{0} {1}", applyform, refundForm != null ? (string.Format("({0})", refundForm.RefundType.GetDescription())) : string.Empty); var product = applyform.Order.IsThirdRelation ? applyform.Order.Supplier.Product : applyform.Order.Provider.Product; if (product is SpeicalProductInfo) { var specialProductInfo = product as SpeicalProductInfo; this.lblProductType.Text = applyform.Order.Product.ProductType.GetDescription() + "(" + specialProductInfo.SpeicalProductType.GetDescription() + ")"; } else { this.lblProductType.Text = applyform.Order.Product.ProductType.GetDescription(); } this.lblStatus.Text = Service.Order.StatusService.GetRefundApplyformStatus(applyform.Status, DataTransferObject.Order.OrderRole.Platform); if (applyform.Order.Provider != null && applyform.Order.Provider.Product is Service.Order.Domain.CommonProductInfo) { this.lblTicketType.Text = (applyform.Order.Provider.Product as Service.Order.Domain.CommonProductInfo).TicketType.ToString(); } else { this.lblTicketType.Text = "-"; } lblPNR.Text = AppendPNR(applyform.NewPNR, string.Empty); lblPNR.Text += AppendPNR(applyform.OriginalPNR, string.IsNullOrWhiteSpace(lblPNR.Text) ? string.Empty : "原编码:"); //lblPNR.Text = string.Format("{0} {1} 原编码:{2} {3}", // string.IsNullOrWhiteSpace(applyform.NewPNR.PNR) ? "" : string.Format(PNRFORMAT, applyform.NewPNR.PNR,"小"), // string.IsNullOrWhiteSpace(applyform.NewPNR.BPNR) ? "" : string.Format(PNRFORMAT, applyform.NewPNR.PNR,"大"), // string.IsNullOrWhiteSpace(applyform.OriginalPNR.PNR) ? "" : string.Format(PNRFORMAT, applyform.NewPNR.PNR, "小"), // string.IsNullOrWhiteSpace(applyform.OriginalPNR.BPNR) ? "" : string.Format(PNRFORMAT, applyform.NewPNR.PNR,"大") // ); this.linkPurchaser.InnerText = applyform.PurchaserName; this.linkPurchaser.HRef = "/OrganizationModule/TerraceModule/CompanyInfoManage/LookUpCompanyInfo.aspx?CompanyId=" + applyform.PurchaserId.ToString(); this.linkProvider.InnerText = applyform.ProviderName; this.linkProvider.HRef = "/OrganizationModule/TerraceModule/CompanyInfoManage/LookUpCompanyInfo.aspx?CompanyId=" + applyform.ProviderId.ToString(); }
private void bindAttachment(RefundOrScrapApplyform applyform) { RefundApplyform refundApplyform = applyform as RefundApplyform; if (refundApplyform != null && (refundApplyform.RefundType == RefundType.Involuntary || refundApplyform.RefundType == RefundType.SpecialReason)) { var attachment = ApplyformQueryService.QueryApplyAttachmentView(refundApplyform.Id); UserControl.OutPutImage outPutImage = LoadControl(ResolveUrl("~/UserControl/OutPutImage.ascx")) as UserControl.OutPutImage; outPutImage.ApplyAttachment = attachment; outPutImage.IsPlatform = refundApplyform.Status != RefundApplyformStatus.Refunded && refundApplyform.Status != RefundApplyformStatus.DeniedByProviderTreasurer && refundApplyform.Status != RefundApplyformStatus.Denied; outPutImage.ClientIDMode = System.Web.UI.ClientIDMode.Static; outPutImage.EnableTheming = false; outPutImage.ApplyformId = refundApplyform.Id; string content = outPutImage.Binddata(); divApplyAttachment.InnerHtml = string.IsNullOrEmpty(content) ? string.Empty : string.Format("<h3 class=\"titleBg\">附件</h3><div id=\"divOutPutImage\" class=\"clearfix\">{0}</div>", outPutImage.Binddata()); } }
protected void Page_Load(object sender, EventArgs e) { RegisterOEMSkins("form.css"); if (!IsPostBack) { setBackButton(); decimal applyformId; if (decimal.TryParse(Request.QueryString["id"], out applyformId)) { RefundOrScrapApplyform applyform = ApplyformQueryService.QueryRefundOrScrapApplyform(applyformId); string lockErrorMsg; if (Lock(applyformId, LockRole.Platform, "退/废票处理", out lockErrorMsg)) { if (applyform == null) { showErrorMessage("退/废票申请单不存在"); } else { RefundApplyform refundApplyform = applyform as RefundApplyform; if (refundApplyform != null && (refundApplyform.RefundType == RefundType.Involuntary || refundApplyform.RefundType == RefundType.SpecialReason)) { bindAttachment(applyform.Id); } bindData(applyform); } } else { showErrorMessage("锁定申请单失败。原因:" + lockErrorMsg); } } else { showErrorMessage("参数错误"); } } }
private void bindPassengers(RefundApplyform applyform) { int passenagerCount = applyform.Passengers.Count(); Order order = applyform.Order; bool returnServiceCharge = IsSpeical && !order.IsThirdRelation && (applyform.RefundType == RefundType.Involuntary || (order.IsSpecial && applyform.RefundType == RefundType.SpecialReason)); MutilFlightTip.Visible = order.TripType != ItineraryType.OneWay; //多段航程显示价格修改提示 decimal CommissionRate = applyform.Order.Bill.PayBill.Provider.Source.Fare == 0 ? 0 : Math.Abs(applyform.Order.Bill.PayBill.Provider.Source.Commission) / applyform.Order.Bill.PayBill.Provider.Source.Fare; var flightsPassengerRelation = applyform.Flights.OrderBy(f => f.OriginalFlight.Serial) .Select(flightInfo => { var bill = applyform.Order.Bill.PayBill.Provider.Source.Details.First(f => f.Flight.Id == flightInfo.OriginalFlight.ReservateFlight); var maxRufundFee = bill != null?bill.Anticipation:short.MaxValue; return (new { Flight = flightInfo, Departure = flightInfo.OriginalFlight.Departure.Name, Arrival = flightInfo.OriginalFlight.Arrival.Name, Carrier = flightInfo.OriginalFlight.Carrier.Code, flightInfo.OriginalFlight.FlightNo, TicketPrice = flightInfo.OriginalFlight.Price.Fare, flightInfo.OriginalFlight.Id, Bunk = flightInfo.OriginalFlight.Bunk.Code, TakeoffTime = flightInfo.OriginalFlight.TakeoffTime.ToString("yyyy-MM-dd"), Rate = string.Empty, RefundFee = string.Empty, Fee = string.Empty, Total = string.Empty, PassengerCount = passenagerCount, EI = getEI(flightInfo.OriginalFlight, applyform.Order), TripType = order.TripType.GetDescription(), RenderServiceCharge = IsSpeical && !order.IsThirdRelation, Seaial = CNIndex[flightInfo.OriginalFlight.Serial], Passengers = from p in applyform.Passengers let serviceCharge = getServiceCharge(p) let ticket = p.Tickets.First( t => t.Flights .Any(f => f.ReservateFlight == flightInfo.OriginalFlight.ReservateFlight)) select new { p.Name, No = ticket == null?string.Empty:ticket.SettleCode + "-" + ticket.No, PassengerType = p.PassengerType.GetDescription(), flightInfo.OriginalFlight.Price.AirportFee, flightInfo.OriginalFlight.Price.BAF, TicketPrice = flightInfo.OriginalFlight.Price.Fare, YingShou = flightInfo.OriginalFlight.Price.Total - (CommissionRate * flightInfo.OriginalFlight.Price.Fare), Rate = string.Empty, Fee = string.Empty, AirportPair = string.Format("{0}-{1}", flightInfo.OriginalFlight.Departure.Code, flightInfo.OriginalFlight.Arrival.Code), TotalRefund = string.Empty, RenderServiceCharge = IsSpeical && !order.IsThirdRelation, p.CredentialsType, RefundServiceCharge = flightInfo.RefundServiceCharge == 0 ? string.Format("{0}(不退)", serviceCharge) : serviceCharge == flightInfo.RefundServiceCharge ? string.Format("{0}(全退)", flightInfo.RefundServiceCharge ?? 0) : string.Format("{0}(退{1})", serviceCharge, flightInfo. RefundServiceCharge ?? 0), Commission = IsSpeical ? "0" : (CommissionRate * flightInfo.OriginalFlight.Price.Fare). TrimInvaidZero(), returnServiceCharge, //是否是特殊票,民航基金,燃油,佣金 StrFee = string.Format( "parameters={{IsSpeical:{0},AirportFee:{1},BAF:{2},Commission:{3},Price:{4},ServiceCharge:{5},maxRufundFee:{6}}}", IsSpeical ? 1 : 0, flightInfo.OriginalFlight.Price.AirportFee, flightInfo.OriginalFlight.Price.BAF, (IsSpeical ? 0 : CommissionRate * flightInfo.OriginalFlight.Price.Fare). TrimInvaidZero(), flightInfo.OriginalFlight.Price.Fare, returnServiceCharge ? flightInfo.RefundServiceCharge ?? 0 : 0, maxRufundFee) } }); } ); RefundInfos.DataSource = flightsPassengerRelation; RefundInfos.DataBind(); FeeInputEnabled = applyform.RefundType != RefundType.Involuntary && applyform.RefundType != RefundType.Upgrade; this.hfdTradeFee.Value = order.Bill.PayBill.Provider.Owner.Rate.ToString(); }