private void bindApplyAndProcessInfo(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { this.lblAppliedTime.Text = applyform.AppliedTime.ToString("yyyy-MM-dd HH:mm"); this.lblAppliedReason.Text = applyform.ApplyRemark; if (applyform.ProcessedTime.HasValue) { this.lblProcessedTime.Text = applyform.ProcessedTime.Value.ToString("yyyy-MM-dd HH:mm"); this.lblProcessedResult.Text = StatusService.GetRefundApplyformStatus(applyform.Status, GetOrderRole(applyform.Order)) + " " + applyform.ProcessedFailedReason; } if (CurrentCompany.CompanyType == CompanyType.Provider && applyform.Status == DataTransferObject.Order.RefundApplyformStatus.Refunded) { var refundInfoHTML = new StringBuilder(); refundInfoHTML.Append("<table><tr><th>航段</th><th>手续费率</th><th>手续费</th><th>退款金额</th></tr>"); var index = 0; NormalRefundRoleBill bill = getUserRoleBill(applyform.RefundBill); var flightRefundFees = applyform.OriginalFlights.Join(bill.Source.Details, f => f.ReservateFlight, f => f.Flight.Id, (f1, f2) => new { flight = f1, fee = f2 }); foreach (var item in flightRefundFees) { refundInfoHTML.Append("<tr>"); refundInfoHTML.AppendFormat("<td>{0} - {1}</td>", item.flight.Departure.City, item.flight.Arrival.City); refundInfoHTML.AppendFormat("<td>{0}%</td>", (item.fee.RefundRate * 100).TrimInvaidZero()); refundInfoHTML.AppendFormat("<td>{0}</td>", Math.Abs(item.fee.RefundFee).TrimInvaidZero()); if (index == 0) { refundInfoHTML.AppendFormat("<td rowspan='{0}'>{1}</td>", flightRefundFees.Count(), bill.Source.Anticipation.TrimInvaidZero()); } refundInfoHTML.Append("</tr>"); index++; } refundInfoHTML.Append("</table>"); this.divRefundFeeInfo.InnerHtml = refundInfoHTML.ToString(); } }
private void bindPolicyRemark(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { this.divPolicyRemark.Visible = true; var product = BasePage.GetOrderRole(applyform.Order) == OrderRole.Supplier ? applyform.Order.Supplier.Product : applyform.Order.Provider.Product; this.divPolicyRemarkContent.InnerHtml = string.Format("{0} <span class='systemEndFix'>{1}</span>", product.Remark, SystemParamService.PolicyRemark); }
private void bindData(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { bindHeader(applyform); bindVoyages(applyform); bindPassengers(applyform); bindApplyAndProcessInfo(applyform); bindBill(applyform); }
private void bindBill(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { if (applyform.Status == ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.Refunded) { this.bill.InitData(applyform.RefundBill); } else { this.bill.Visible = false; } }
private void setButtons(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { if (CurrentCompany.CompanyType == Common.Enums.CompanyType.Provider) { switch (applyform.Status) { case ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.AppliedForProvider: case ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.DeniedByProviderTreasurer: this.btnProcess.Visible = !applyform.RequireRevisePrice; this.btnProcess.Attributes.Add("onclick", string.Format("window.location.href='{0}?id={1}&returnUrl={2}';return false;", applyform is Service.Order.Domain.Applyform.ScrapApplyform ? "Abolish.aspx" : "ProcessRefund.aspx", applyform.Id.ToString(), HttpUtility.UrlEncode(Request.Url.PathAndQuery))); break; } } }
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 bindBill(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { OrderRole orderRole = GetOrderRole(applyform.Order); if (orderRole == OrderRole.Supplier && applyform.Status == RefundApplyformStatus.Refunded || (orderRole == OrderRole.Provider && (applyform.Status == RefundApplyformStatus.Refunded || applyform.Status == RefundApplyformStatus.AgreedByProviderBusiness)) ) { this.bill.Visible = true; this.bill.InitData(applyform.RefundBill); } else { this.bill.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 setButtons(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { switch (applyform.Status) { case ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.AppliedForPlatform: case ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.AppliedForCancelReservation: case ChinaPay.B3B.DataTransferObject.Order.RefundApplyformStatus.DeniedByProviderBusiness: this.btnProcess.Visible = true; var processPage = applyform.RequireRevisePrice ? "ProcessRevisePrice.aspx" : "ProcessRefund.aspx"; this.btnProcess.Attributes.Add("onclick", "window.location.href='" + processPage + "?id=" + applyform.Id + "&returnUrl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery) + "';return false;"); break; default: this.btnProcess.Visible = false; break; } }
private void bindPassengers(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { this.passengers.InitData(applyform.Order, applyform.Passengers, applyform.Flights.Select(f => f.OriginalFlight)); }
private void bindVoyages(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform) { this.voyages.InitData(applyform.Order, applyform.Flights.Select(item => item.OriginalFlight)); }