public BookingWS(string bookingId, DateTime bookingDate, string userName, int journeyId, string journeyName, PaymentWS payment) { this.BookingId = bookingId; this.BookingDate = bookingDate; this.UserName = userName; this.JourneyId = journeyId; this.JourneyName = journeyName; this.Payment = payment; }
public BookingWSPage getBookingPage(string tenantName, int fromIdx, int count) { FinanceServiceDefault.BookingWSPage wsPage = client.getBookingPage(tenantName, fromIdx, count); List<BookingWS> bookings = new List<BookingWS>(); foreach (FinanceServiceDefault.BookingWS bkg in wsPage.Bookings) { PaymentWS payment = null; if (bkg.Payment != null) { FinanceServiceDefault.PaymentWS pay = bkg.Payment; CreditCardWS creditCard = new CreditCardWS(pay.CreditCard.CCNumber, pay.CreditCard.User, pay.CreditCard.ValidThrough); payment = new PaymentWS(pay.BookingId, creditCard, pay.Amount, bkg.Payment.Date); } bookings.Add(new BookingWS(bkg.BookingId, bkg.BookingDate, bkg.UserName, bkg.JourneyId, bkg.JourneyName, payment)); } BookingWSPage retPage = new BookingWSPage(bookings, wsPage.FromIdx, wsPage.Count, wsPage.Total); return retPage; }