Пример #1
0
        // 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: 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));
        }
Пример #3
0
        // 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);
        }