// GET: /Edit public ActionResult Edit(int id) { //Get Item FormOfPaymentAdviceMessageGroupItem formOfPaymentAdviceMessageGroupItem = new FormOfPaymentAdviceMessageGroupItem(); formOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageItemRepository.GetItem(id); //Check Exists if (formOfPaymentAdviceMessageGroupItem == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Parent Exists FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup(); formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(formOfPaymentAdviceMessageGroupItem.FormOfPaymentAdviceMessageGroupID); //Check Exists if (formOfPaymentAdviceMessageGroup == null) { ViewData["ActionMethod"] = "CreatePost"; return(View("RecordDoesNotExistError")); } //Check AccessRights if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } FormOfPaymentAdviceMessageGroupItemVM formOfPaymentAdviceMessageGroupItemVM = new FormOfPaymentAdviceMessageGroupItemVM(); formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroup; formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageGroupItem; CountryRepository countryRepository = new CountryRepository(); formOfPaymentAdviceMessageGroupItemVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", formOfPaymentAdviceMessageGroupItem.CountryCode); ProductRepository productRepository = new ProductRepository(); formOfPaymentAdviceMessageGroupItemVM.Products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", formOfPaymentAdviceMessageGroupItem.ProductId); TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); formOfPaymentAdviceMessageGroupItemVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription", formOfPaymentAdviceMessageGroupItem.TravelIndicator); FormOfPaymentTypeRepository formOfPaymentTypeRepository = new FormOfPaymentTypeRepository(); formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentTypes = new SelectList(formOfPaymentTypeRepository.GetAllFormOfPaymentTypes().ToList(), "FormOfPaymentTypeId", "FormOfPaymentTypeDescription", formOfPaymentAdviceMessageGroupItem.FormofPaymentTypeID); formOfPaymentAdviceMessageItemRepository.EditItemForDisplay(formOfPaymentAdviceMessageGroupItem); return(View(formOfPaymentAdviceMessageGroupItemVM)); }
// GET: Create A Single ClientFee public ActionResult Create() { int productId = 1; //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return View("Error"); } ProductRepository productRepository = new ProductRepository(); Product product = new Product(); product = productRepository.GetProduct(productId); TransactionFeeAirVM transactionFeeVM = new TransactionFeeAirVM(); TransactionFeeAir transactionFee = new TransactionFeeAir(); transactionFee.ProductName = product.ProductName; transactionFee.ProductId = product.ProductId; transactionFee.IncursGSTFlagNonNullable = false; transactionFeeVM.TransactionFee = transactionFee; TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); transactionFeeVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription"); BookingSourceRepository bookingSourceRepository = new BookingSourceRepository(); transactionFeeVM.BookingSources = new SelectList(bookingSourceRepository.GetAllBookingSources().ToList(), "BookingSourceCode", "BookingSourceCode"); BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository(); transactionFeeVM.BookingOriginations = new SelectList(bookingOriginationRepository.GetAllBookingOriginations().ToList(), "BookingOriginationCode", "BookingOriginationCode"); ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository(); transactionFeeVM.ChargeTypes = new SelectList(chargeTypeRepository.GetAllChargeTypes().ToList(), "ChargeTypeCode", "ChargeTypeDescription"); TransactionTypeRepository transactionTypeRepository = new TransactionTypeRepository(); transactionFeeVM.TransactionTypes = new SelectList(transactionTypeRepository.GetAllTransactionTypes().ToList(), "TransactionTypeCode", "TransactionTypeCode"); FeeCategoryRepository feeCategoryRepository = new FeeCategoryRepository(); transactionFeeVM.FeeCategories = new SelectList(feeCategoryRepository.GetAllFeeCategories().ToList(), "FeeCategory1", "FeeCategory1"); TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository(); transactionFeeVM.TravelerBackOfficeTypes = new SelectList(travelerBackOfficeTypeRepository.GetAllTravelerBackOfficeTypes().ToList(), "TravelerBackOfficeTypeCode", "TravelerBackOfficeTypeDescription"); TripTypeClassificationRepository tripTypeClassificationRepository = new TripTypeClassificationRepository(); transactionFeeVM.TripTypeClassifications = new SelectList(tripTypeClassificationRepository.GetAllTripTypeClassifications().ToList(), "TripTypeClassificationId", "TripTypeClassificationDescription"); CurrencyRepository currencyRepository = new CurrencyRepository(); transactionFeeVM.TicketPriceCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); transactionFeeVM.FeeCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); PolicyRouting policyRouting = new PolicyRouting(); policyRouting.FromGlobalFlag = false; policyRouting.ToGlobalFlag = false; transactionFeeVM.PolicyRouting = policyRouting; return View(transactionFeeVM); }
// GET: /Edit public ActionResult Edit(int id) { //Get Item From Database PointOfSaleFeeLoad pointOfSaleFeeLoad = new PointOfSaleFeeLoad(); pointOfSaleFeeLoad = pointOfSaleFeeLoadRepository.GetGroup(id); //Check Exists if (pointOfSaleFeeLoad == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } PointOfSaleFeeLoadVM pointOfSaleFeeLoadVM = new PointOfSaleFeeLoadVM(); pointOfSaleFeeLoadRepository.EditGroupForDisplay(pointOfSaleFeeLoad); pointOfSaleFeeLoadVM.PointOfSaleFeeLoad = pointOfSaleFeeLoad; //FeeLoadDescriptionTypeCodes FeeLoadDescriptionTypeCodeRepository feeLoadDescriptionTypeCodeRepository = new FeeLoadDescriptionTypeCodeRepository(); SelectList feeLoadDescriptionTypeCodes = new SelectList(feeLoadDescriptionTypeCodeRepository.GetAllFeeLoadDescriptionTypeCodes().ToList(), "FeeLoadDescriptionTypeCode", "FeeLoadDescriptionTypeCode", pointOfSaleFeeLoad.FeeLoadDescriptionTypeCode); pointOfSaleFeeLoadVM.FeeLoadDescriptionTypeCodes = feeLoadDescriptionTypeCodes; //Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", pointOfSaleFeeLoad.ProductId); pointOfSaleFeeLoadVM.Products = products; //TravelIndicators TravelIndicatorRepository TravelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(TravelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription", pointOfSaleFeeLoad.TravelIndicator); pointOfSaleFeeLoadVM.TravelIndicators = travelIndicators; //Currencies CurrencyRepository currencyRepository = new CurrencyRepository(); SelectList currencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name", pointOfSaleFeeLoad.FeeLoadCurrencyCode); pointOfSaleFeeLoadVM.Currencies = currencies; return(View(pointOfSaleFeeLoadVM)); }
// GET: /Create public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } PointOfSaleFeeLoadVM pointOfSaleFeeLoadVM = new PointOfSaleFeeLoadVM(); //AgentInitiatedFlag Default Checked PointOfSaleFeeLoad pointOfSaleFeeLoad = new PointOfSaleFeeLoad(); pointOfSaleFeeLoad.AgentInitiatedFlag = true; pointOfSaleFeeLoadVM.PointOfSaleFeeLoad = pointOfSaleFeeLoad; //FeeLoadDescriptionTypeCodes FeeLoadDescriptionTypeCodeRepository feeLoadDescriptionTypeCodeRepository = new FeeLoadDescriptionTypeCodeRepository(); SelectList feeLoadDescriptionTypeCodes = new SelectList(feeLoadDescriptionTypeCodeRepository.GetAllFeeLoadDescriptionTypeCodes().ToList(), "FeeLoadDescriptionTypeCode", "FeeLoadDescriptionTypeCode"); pointOfSaleFeeLoadVM.FeeLoadDescriptionTypeCodes = feeLoadDescriptionTypeCodes; //Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); pointOfSaleFeeLoadVM.Products = products; //TravelIndicators TravelIndicatorRepository TravelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(TravelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription"); pointOfSaleFeeLoadVM.TravelIndicators = travelIndicators; //Currencies CurrencyRepository currencyRepository = new CurrencyRepository(); SelectList currencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); pointOfSaleFeeLoadVM.Currencies = currencies; return(View(pointOfSaleFeeLoadVM)); }
// GET: /Create public ActionResult Create(int id) { PolicyGroup policyGroup = policyGroupRepository.GetGroup(id); //Check Exists if (policyGroup == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } //Check AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPolicyGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Populate List of GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdss = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSList"] = gdss; //Populate List of PolicySupplierDealCodeTypes PolicySupplierDealCodeTypeRepository policySupplierDealCodeType = new PolicySupplierDealCodeTypeRepository(); SelectList policySupplierDealCodeTypes = new SelectList(policySupplierDealCodeType.GetAllPolicySupplierDealCodeTypes().ToList(), "PolicySupplierDealCodeTypeId", "PolicySupplierDealCodeTypeDescription"); ViewData["PolicySupplierDealCodeTypeList"] = policySupplierDealCodeTypes; //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); ViewData["ProductList"] = products; //Populate List of Policy Locations PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName"); ViewData["PolicyLocationList"] = policyLocations; //Populate List of Travel Indicators TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription"); ViewData["TravelIndicatorList"] = travelIndicators; //Populate Blank List of Tour Code Types (Chosen with GDS Selection) TourCodeTypeRepository tourCodeTypeRepository = new TourCodeTypeRepository(); List <TourCodeType> defaultList = new List <TourCodeType>(); SelectList tourCodeTypes = new SelectList(defaultList, "TourCodeTypeId", "TourCodeTypeDescription"); ViewData["TourCodeTypeList"] = tourCodeTypes; //populate new item with known PolicyGroup Information PolicySupplierDealCode policySupplierDealCode = new PolicySupplierDealCode(); policySupplierDealCode.PolicyGroupId = id; policySupplierDealCode.PolicyGroupName = policyGroup.PolicyGroupName; policySupplierDealCode.EnabledFlagNonNullable = true; //Show 'Create' Form return(View(policySupplierDealCode)); }
// GET: /Edit public ActionResult Edit(int id) { //Get PolicySupplierDealCode PolicySupplierDealCode policySupplierDealCode = new PolicySupplierDealCode(); policySupplierDealCode = policySupplierDealCodeRepository.GetPolicySupplierDealCode(id); //Check Exists if (policySupplierDealCode == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPolicyGroup(policySupplierDealCode.PolicyGroupId)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Populate List of GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdss = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSList"] = gdss; //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); ViewData["ProductList"] = products; //Populate List of PolicySupplierDealCodeTypes PolicySupplierDealCodeTypeRepository policySupplierDealCodeType = new PolicySupplierDealCodeTypeRepository(); SelectList policySupplierDealCodeTypes = new SelectList(policySupplierDealCodeType.GetAllPolicySupplierDealCodeTypes().ToList(), "PolicySupplierDealCodeTypeId", "PolicySupplierDealCodeTypeDescription"); ViewData["PolicySupplierDealCodeTypeList"] = policySupplierDealCodeTypes; //Populate List of Policy Locations PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName"); ViewData["PolicyLocationList"] = policyLocations; //Populate List of Travel Indicators TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription", policySupplierDealCode.TravelIndicator); ViewData["TravelIndicatorList"] = travelIndicators; //Populate List of Tour Code Types TourCodeTypeRepository tourCodeTypeRepository = new TourCodeTypeRepository(); SelectList tourCodeTypes = new SelectList(tourCodeTypeRepository.GetTourCodeTypesForGDS(policySupplierDealCode.GDSCode).ToList(), "TourCodeTypeId", "TourCodeTypeDescription", policySupplierDealCode.TourCodeTypeId); ViewData["TourCodeTypeList"] = tourCodeTypes; //return edit form policySupplierDealCodeRepository.EditItemForDisplay(policySupplierDealCode); return(View(policySupplierDealCode)); }
// GET: Create A Single Transaction Fee public ActionResult Create(int productId) { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ProductRepository productRepository = new ProductRepository(); Product product = new Product(); product = productRepository.GetProduct(productId); if (product == null || productId < 2 || productId > 3) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } TransactionFeeCarHotelVM transactionFeeVM = new TransactionFeeCarHotelVM(); TransactionFeeCarHotel transactionFeeCarHotel = new TransactionFeeCarHotel(); transactionFeeCarHotel.ProductName = product.ProductName; transactionFeeCarHotel.ProductId = product.ProductId; transactionFeeCarHotel.IncursGSTFlagNonNullable = false; transactionFeeVM.TransactionFee = transactionFeeCarHotel; TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); transactionFeeVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription"); BookingSourceRepository bookingSourceRepository = new BookingSourceRepository(); transactionFeeVM.BookingSources = new SelectList(bookingSourceRepository.GetAllBookingSources().ToList(), "BookingSourceCode", "BookingSourceCode"); BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository(); transactionFeeVM.BookingOriginations = new SelectList(bookingOriginationRepository.GetAllBookingOriginations().ToList(), "BookingOriginationCode", "BookingOriginationCode"); ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository(); transactionFeeVM.ChargeTypes = new SelectList(chargeTypeRepository.GetAllChargeTypes().ToList(), "ChargeTypeCode", "ChargeTypeDescription"); TransactionTypeRepository transactionTypeRepository = new TransactionTypeRepository(); transactionFeeVM.TransactionTypes = new SelectList(transactionTypeRepository.GetAllTransactionTypes().ToList(), "TransactionTypeCode", "TransactionTypeCode"); FeeCategoryRepository feeCategoryRepository = new FeeCategoryRepository(); transactionFeeVM.FeeCategories = new SelectList(feeCategoryRepository.GetAllFeeCategories().ToList(), "FeeCategory1", "FeeCategory1"); TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository(); transactionFeeVM.TravelerBackOfficeTypes = new SelectList(travelerBackOfficeTypeRepository.GetAllTravelerBackOfficeTypes().ToList(), "TravelerBackOfficeTypeCode", "TravelerBackOfficeTypeDescription"); TripTypeClassificationRepository tripTypeClassificationRepository = new TripTypeClassificationRepository(); transactionFeeVM.TripTypeClassifications = new SelectList(tripTypeClassificationRepository.GetAllTripTypeClassifications().ToList(), "TripTypeClassificationId", "TripTypeClassificationDescription"); CurrencyRepository currencyRepository = new CurrencyRepository(); transactionFeeVM.TicketPriceCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); transactionFeeVM.FeeCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); //Location is used in CarHotel only PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); transactionFeeVM.PolicyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName"); return(View(transactionFeeVM)); }
// GET: Create TransactionFeeAir public ActionResult Edit(int id) { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return View("Error"); } TransactionFeeAir transactionFeeAir = new TransactionFeeAir(); transactionFeeAir = transactionFeeAirRepository.GetItem(id); if (transactionFeeAir == null || transactionFeeAir.ProductId != 1) { ViewData["ActionMethod"] = "EditAirGet"; return View("RecordDoesNotExistError"); } transactionFeeAir.IncursGSTFlagNonNullable = ((bool)transactionFeeAir.IncursGSTFlag == true) ? true : false; TransactionFeeAirVM transactionFeeVM = new TransactionFeeAirVM(); transactionFeeVM.TransactionFee = transactionFeeAir; TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); transactionFeeVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription"); BookingSourceRepository bookingSourceRepository = new BookingSourceRepository(); transactionFeeVM.BookingSources = new SelectList(bookingSourceRepository.GetAllBookingSources().ToList(), "BookingSourceCode", "BookingSourceCode"); BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository(); transactionFeeVM.BookingOriginations = new SelectList(bookingOriginationRepository.GetAllBookingOriginations().ToList(), "BookingOriginationCode", "BookingOriginationCode"); ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository(); transactionFeeVM.ChargeTypes = new SelectList(chargeTypeRepository.GetAllChargeTypes().ToList(), "ChargeTypeCode", "ChargeTypeDescription"); TransactionTypeRepository transactionTypeRepository = new TransactionTypeRepository(); transactionFeeVM.TransactionTypes = new SelectList(transactionTypeRepository.GetAllTransactionTypes().ToList(), "TransactionTypeCode", "TransactionTypeCode"); FeeCategoryRepository feeCategoryRepository = new FeeCategoryRepository(); transactionFeeVM.FeeCategories = new SelectList(feeCategoryRepository.GetAllFeeCategories().ToList(), "FeeCategory1", "FeeCategory1"); TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository(); transactionFeeVM.TravelerBackOfficeTypes = new SelectList(travelerBackOfficeTypeRepository.GetAllTravelerBackOfficeTypes().ToList(), "TravelerBackOfficeTypeCode", "TravelerBackOfficeTypeDescription"); TripTypeClassificationRepository tripTypeClassificationRepository = new TripTypeClassificationRepository(); transactionFeeVM.TripTypeClassifications = new SelectList(tripTypeClassificationRepository.GetAllTripTypeClassifications().ToList(), "TripTypeClassificationId", "TripTypeClassificationDescription"); CurrencyRepository currencyRepository = new CurrencyRepository(); transactionFeeVM.TicketPriceCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); transactionFeeVM.FeeCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); PolicyRouting policyRouting = new PolicyRouting(); if (transactionFeeAir.PolicyRoutingId != null) { policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFeeAir.PolicyRoutingId); policyRoutingRepository.EditPolicyRouting(policyRouting); } // transactionFeeVM.PolicyRouting = policyRouting; return View(transactionFeeVM); }
// GET: /Create public ActionResult Create(int id) { //Check Parent Exists FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup(); formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(id); //Check Exists if (formOfPaymentAdviceMessageGroup == null) { ViewData["ActionMethod"] = "CreatePost"; return(View("RecordDoesNotExistError")); } //Check Access if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } FormOfPaymentAdviceMessageGroupItemVM formOfPaymentAdviceMessageGroupItemVM = new FormOfPaymentAdviceMessageGroupItemVM(); FormOfPaymentAdviceMessageGroupItem formOfPaymentAdviceMessageItem = new FormOfPaymentAdviceMessageGroupItem(); formOfPaymentAdviceMessageItem.FormOfPaymentAdviceMessageGroupName = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupName; formOfPaymentAdviceMessageItem.FormOfPaymentAdviceMessageGroupID = id; formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroup; //Language is a read only field defaulting to English (United Kingdom) LanguageRepository languageRepository = new LanguageRepository(); Language language = languageRepository.GetLanguage("en-GB"); if (language != null) { formOfPaymentAdviceMessageItem.LanguageCode = language.LanguageCode; formOfPaymentAdviceMessageItem.LanguageName = language.LanguageName; } formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageItem; CountryRepository countryRepository = new CountryRepository(); formOfPaymentAdviceMessageGroupItemVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName"); ProductRepository productRepository = new ProductRepository(); formOfPaymentAdviceMessageGroupItemVM.Products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); formOfPaymentAdviceMessageGroupItemVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription"); FormOfPaymentTypeRepository formOfPaymentTypeRepository = new FormOfPaymentTypeRepository(); formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentTypes = new SelectList(formOfPaymentTypeRepository.GetAllFormOfPaymentTypes().ToList(), "FormOfPaymentTypeId", "FormOfPaymentTypeDescription"); formOfPaymentAdviceMessageItemRepository.EditItemForDisplay(formOfPaymentAdviceMessageItem); return(View(formOfPaymentAdviceMessageGroupItemVM)); }