//Add Data From Linked Tables for Display public void EditForDisplay(TravelerType travelerType) { TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository(); TravelerBackOfficeType travelerBackOfficeType = new TravelerBackOfficeType(); travelerBackOfficeType = travelerBackOfficeTypeRepository.GetTravelerBackOfficeType(travelerType.TravelerBackOfficeTypeCode); if (travelerBackOfficeType != null) { travelerType.TravelerBackOfficeTypeDescription = travelerBackOfficeType.TravelerBackOfficeTypeDescription; } TravelerTypeSponsorRepository travelerTypeSponsorRepository = new TravelerTypeSponsorRepository(); TravelerTypeSponsor travelerTypeSponsor = travelerTypeSponsorRepository.GetTravelerTypeSponsor(travelerType.TravelerTypeGuid); if (travelerTypeSponsor != null) { travelerType.TravelerTypeSponsor = travelerTypeSponsor; } }
public void EditForDisplay(TransactionFeeCarHotel transactionFee) { TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); TravelIndicator travelIndicator = new TravelIndicator(); travelIndicator = travelIndicatorRepository.GetTravelIndicator(transactionFee.TravelIndicator); if (travelIndicator != null) { transactionFee.TravelIndicatorDescription = travelIndicator.TravelIndicatorDescription; } CurrencyRepository currencyRepository = new CurrencyRepository(); Currency currency = new Currency(); currency = currencyRepository.GetCurrency(transactionFee.FeeCurrencyCode); if (currency != null) { transactionFee.FeeCurrencyName = currency.Name; } currency = currencyRepository.GetCurrency(transactionFee.TicketPriceCurrencyCode); if (currency != null) { transactionFee.TicketPriceCurrencyName = currency.Name; } BookingSourceRepository bookingSourceRepository = new BookingSourceRepository(); BookingSource bookingSource = new BookingSource(); bookingSource = bookingSourceRepository.GetBookingSource(transactionFee.BookingSourceCode); if (bookingSource != null) { transactionFee.BookingSourceDescription = bookingSource.BookingSourceDescription; } BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository(); BookingOrigination bookingOrigination = new BookingOrigination(); bookingOrigination = bookingOriginationRepository.GetBookingOrigination(transactionFee.BookingOriginationCode); if (bookingOrigination != null) { transactionFee.BookingOriginationCode = bookingOrigination.BookingOriginationCode; } ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository(); ChargeType chargeType = new ChargeType(); chargeType = chargeTypeRepository.GetChargeType(transactionFee.ChargeTypeCode); if (bookingOrigination != null) { transactionFee.ChargeTypeDescription = chargeType.ChargeTypeDescription; } TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository(); TravelerBackOfficeType travelerBackOfficeType = new TravelerBackOfficeType(); travelerBackOfficeType = travelerBackOfficeTypeRepository.GetTravelerBackOfficeType(transactionFee.TravelerClassCode); if (travelerBackOfficeType != null) { transactionFee.TravelerBackOfficeTypeDescription = travelerBackOfficeType.TravelerBackOfficeTypeDescription; } if (transactionFee.ProductId != null) { ProductRepository productRepository = new ProductRepository(); Product product = new Product(); product = productRepository.GetProduct((int)transactionFee.ProductId); if (product != null) { transactionFee.ProductName = product.ProductName; //Supplier if (!String.IsNullOrEmpty(transactionFee.SupplierCode)) { SupplierRepository supplierRepository = new SupplierRepository(); Supplier supplier = new Supplier(); supplier = supplierRepository.GetSupplier(transactionFee.SupplierCode, (int)transactionFee.ProductId); if (supplier != null) { transactionFee.SupplierName = supplier.SupplierName; } } } } if (transactionFee.PolicyLocationId != null) { PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); PolicyLocation policyLocation = new PolicyLocation(); policyLocation = policyLocationRepository.GetPolicyLocation((int)transactionFee.PolicyLocationId); if (policyLocation != null) { transactionFee.PolicyLocationName = policyLocation.PolicyLocationName; } } //IncursGSTFlag is nullable if (transactionFee.IncursGSTFlag != true) { transactionFee.IncursGSTFlag = false; } transactionFee.IncursGSTFlagNonNullable = (bool)transactionFee.IncursGSTFlag; }