private void AddFlightConfirmation() { var itinerary = Reservation.Itinerary; if (itinerary.Type == ItineraryType.RoundTrip) { var returningConfirmationControl = new ucVolarisPreviousFlightPricing { ShowOnlySegments = true }; returningConfirmationControl.Title = "Regreso"; returningConfirmationControl.SetFlight(itinerary.Return); int arrivalRowIndex = AddRowToTable(); _table.Controls.Add(returningConfirmationControl, 0, arrivalRowIndex); } var departureConfirmationControl = new ucVolarisPreviousFlightPricing { ShowOnlySegments = true }; departureConfirmationControl.SetFlight(itinerary.Departure); int departureRowIndex = AddRowToTable(); _table.Controls.Add(departureConfirmationControl, 0, departureRowIndex); }
/// <summary> /// Builds this instance. /// </summary> /// <returns></returns> public Control Build() { var table = new TableLayoutPanel { AutoSize = true }; if (Reservation.Itinerary.Type == ItineraryType.RoundTrip) { var returningFlightControl = new ucVolarisPreviousFlightPricing(); returningFlightControl.Title = "Regreso"; returningFlightControl.SetFlight(Reservation.Itinerary.Return); table.Controls.Add(returningFlightControl, 0, 0); } var departureFlightControl = new ucVolarisPreviousFlightPricing(); departureFlightControl.SetFlight(Reservation.Itinerary.Departure); table.Controls.Add(departureFlightControl, 0, 0); var pricingControl = new ucTotalPricing { Dock = DockStyle.Right, TotalToPay = Reservation.Itinerary.TotalPrice }; table.Controls.Add(pricingControl); return(table); }