Exemple #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);
        }
Exemple #2
0
        // 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));
        }
Exemple #3
0
        // GET: /Create
        public ActionResult Create(int id)
        {
            PolicyGroup policyGroup = new 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"));
            }

            //Create ViewModel
            PolicyAirMissedSavingsThresholdGroupItemVM policyAirMissedSavingsThresholdGroupItemVM = new PolicyAirMissedSavingsThresholdGroupItemVM();

            policyAirMissedSavingsThresholdGroupItemVM.PolicyGroup = policyGroup;

            PolicyAirMissedSavingsThresholdGroupItem policyAirMissedSavingsThresholdGroupItem = new PolicyAirMissedSavingsThresholdGroupItem();

            policyAirMissedSavingsThresholdGroupItem.PolicyGroupId        = policyGroup.PolicyGroupId;
            policyAirMissedSavingsThresholdGroupItem.PolicyProhibitedFlag = false;
            policyAirMissedSavingsThresholdGroupItem.SavingsZeroedOutFlag = false;
            policyAirMissedSavingsThresholdGroupItemVM.PolicyAirMissedSavingsThresholdGroupItem = policyAirMissedSavingsThresholdGroupItem;

            //Currencies
            CurrencyRepository currencyRepository = new CurrencyRepository();

            policyAirMissedSavingsThresholdGroupItemVM.Currencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            //RoutingCodes
            PolicyAirMissedSavingsThresholdRoutingRepository routingRepository = new PolicyAirMissedSavingsThresholdRoutingRepository();

            policyAirMissedSavingsThresholdGroupItemVM.RoutingCodes = new SelectList(routingRepository.GetAllPolicyAirMissedSavingsThresholdRoutings().ToList(), "RoutingCode", "RoutingDescription");

            //Return Form to Users
            return(View(policyAirMissedSavingsThresholdGroupItemVM));
        }
Exemple #4
0
        // 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: /Edit
        public ActionResult Edit(int id)
        {
            //Get PolicyHotelCapRateGroupItem
            PolicyHotelCapRateGroupItem policyHotelCapRateGroupItem = new PolicyHotelCapRateGroupItem();

            policyHotelCapRateGroupItem = policyHotelCapRateGroupItemRepository.GetPolicyHotelCapRateGroupItem(id);

            //Check Exists
            if (policyHotelCapRateGroupItem == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check AccessRights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToPolicyGroup(policyHotelCapRateGroupItem.PolicyGroupId))
            {
                return(View("Error"));
            }

            //Populate List of PolicyLocations
            PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository();
            SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName");

            ViewData["PolicyLocationList"] = policyLocations;

            //Populate List of currencies
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencies         = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            ViewData["CurrencyList"] = currencies;

            //Populate new PolicyHotelCapRateGroupItem with known PolicyGroup Information
            PolicyGroup policyGroup = policyGroupRepository.GetGroup(policyHotelCapRateGroupItem.PolicyGroupId);

            policyHotelCapRateGroupItem.PolicyGroupName = policyGroup.PolicyGroupName;

            //Show 'Edit' Form
            policyHotelCapRateGroupItemRepository.EditItemForDisplay(policyHotelCapRateGroupItem);
            return(View(policyHotelCapRateGroupItem));
        }
        // GET: /Create
        public ActionResult Create(int id)
        {
            PolicyGroup group = new PolicyGroup();

            group = policyGroupRepository.GetGroup(id);;

            //Check Exists
            if (group == 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 PolicyLocations
            PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository();
            SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName");

            ViewData["PolicyLocationList"] = policyLocations;

            //Populate List of currencies
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencies         = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            ViewData["CurrencyList"] = currencies;

            //populate new PolicyHotelCapRateGroupItem with known PolicyGroup Information
            PolicyHotelCapRateGroupItem policyHotelCapRateGroupItem = new PolicyHotelCapRateGroupItem();

            policyHotelCapRateGroupItem.PolicyGroupId   = id;
            policyHotelCapRateGroupItem.PolicyGroupName = group.PolicyGroupName;

            //Show 'Create' Form
            return(View(policyHotelCapRateGroupItem));
        }
        // GET: /Create
        public ActionResult Create(int id)
        {
            //Get Item From Database
            PriceTrackingSetupGroup group = new PriceTrackingSetupGroup();

            group = priceTrackingSetupGroupRepository.GetPriceTrackingSetupGroup(id);

            //Check Exists
            if (group == 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"));
            }

            //Set Access Rights to Admin
            ViewData["AdminAccess"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(adminGroupName))
            {
                ViewData["AdminAccess"] = "WriteAccess";
            }

            //PriceTrackingSetupGroup
            ViewData["PriceTrackingSetupGroupId"]   = group.PriceTrackingSetupGroupId;
            ViewData["PriceTrackingSetupGroupName"] = group.PriceTrackingSetupGroupName;

            //PriceTrackingSetupGroupItemAir
            PriceTrackingSetupGroupItemAir priceTrackingSetupGroupItemAir = new PriceTrackingSetupGroupItemAir();

            priceTrackingSetupGroupItemAir.PriceTrackingSetupGroupId = id;

            //Default Flags
            priceTrackingSetupGroupItemAir.SharedSavingsFlag  = true;
            priceTrackingSetupGroupItemAir.TransactionFeeFlag = false;
            priceTrackingSetupGroupItemAir.RefundableToRefundableWithPenaltyForRefundAllowedFlag = true;
            priceTrackingSetupGroupItemAir.RefundableToNonRefundableAllowedFlag = true;
            priceTrackingSetupGroupItemAir.VoidWindowAllowedFlag = true;
            priceTrackingSetupGroupItemAir.RefundableToRefundableOutsideVoidWindowAllowedFlag       = true;
            priceTrackingSetupGroupItemAir.NonRefundableToNonRefundableOutsideVoidWindowAllowedFlag = true;
            priceTrackingSetupGroupItemAir.ExchangesAllowedFlag    = true;
            priceTrackingSetupGroupItemAir.VoidExchangeAllowedFlag = true;
            priceTrackingSetupGroupItemAir.NonRefundableToLowerNonRefundableWithDifferentChangeFeeAllowedFlag = true;
            priceTrackingSetupGroupItemAir.RefundableToLowerNonRefundableAllowedFlag = true;
            priceTrackingSetupGroupItemAir.RefundableToLowerRefundableAllowedFlag    = true;
            priceTrackingSetupGroupItemAir.NonPenaltyRefundableToLowerPenaltyRefundableAllowedFlag = true;
            priceTrackingSetupGroupItemAir.ChargeChangeFeeUpFrontForSpecificCarriersFlag           = true;
            priceTrackingSetupGroupItemAir.ChangeFeeMustBeUsedFromResidualValueFlag = true;
            priceTrackingSetupGroupItemAir.AutomaticReticketingFlag = true;

            //Pricing Model Defaults
            priceTrackingSetupGroupItemAir.SharedSavingsAmount = 30;

            //Switch Window Defaults
            priceTrackingSetupGroupItemAir.RefundableToRefundablePreDepartureDayAmount    = 5;
            priceTrackingSetupGroupItemAir.RefundableToNonRefundablePreDepartureDayAmount = 5;

            //Reason Codes
            priceTrackingSetupGroupItemAir.RealisedSavingsCode = "XX";
            priceTrackingSetupGroupItemAir.MissedSavingsCode   = "L";

            //Admin Only
            priceTrackingSetupGroupItemAir.AlphaCodeRemarkField = "Y";

            //Currency
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencysList      = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            ViewData["Currencies"] = currencysList;

            //Lists

            ViewData["ClientHasProvidedWrittenApprovalFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.ClientHasProvidedWrittenApprovalFlag);

            ViewData["SharedSavingsList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.SharedSavingsFlag);

            ViewData["TransactionFeeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.TransactionFeeFlag);

            ViewData["CentralFulfillmentTimeZoneRuleCodes"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc");

            ViewData["TimeZoneRules"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc");

            ViewData["RefundableToRefundableWithPenaltyForRefundAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.RefundableToRefundableWithPenaltyForRefundAllowedFlag);

            ViewData["RefundableToNonRefundableAllowedFlag"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.RefundableToNonRefundableAllowedFlag);

            ViewData["VoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.VoidWindowAllowedFlag);

            ViewData["RefundableToRefundableOutsideVoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.RefundableToRefundableOutsideVoidWindowAllowedFlag);

            ViewData["NonRefundableToNonRefundableOutsideVoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.NonRefundableToNonRefundableOutsideVoidWindowAllowedFlag);

            ViewData["ExchangesAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.ExchangesAllowedFlag);

            ViewData["VoidExchangeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.VoidExchangeAllowedFlag);

            ViewData["ExchangePreviousExchangeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text");

            ViewData["NonRefundableToLowerNonRefundableWithDifferentChangeFeeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                                                priceTrackingSetupGroupItemAir.NonRefundableToLowerNonRefundableWithDifferentChangeFeeAllowedFlag);

            ViewData["RefundableToLowerNonRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                       priceTrackingSetupGroupItemAir.RefundableToLowerNonRefundableAllowedFlag);

            ViewData["RefundableToLowerRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                    priceTrackingSetupGroupItemAir.RefundableToLowerRefundableAllowedFlag);

            ViewData["NonPenaltyRefundableToLowerPenaltyRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                                     priceTrackingSetupGroupItemAir.NonPenaltyRefundableToLowerPenaltyRefundableAllowedFlag);

            ViewData["ChargeChangeFeeUpFrontForSpecificCarriersFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                           priceTrackingSetupGroupItemAir.ChargeChangeFeeUpFrontForSpecificCarriersFlag);

            ViewData["ChangeFeeMustBeUsedFromResidualValueFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                      priceTrackingSetupGroupItemAir.ChangeFeeMustBeUsedFromResidualValueFlag);

            ViewData["TrackPrivateNegotiatedFareFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text");

            ViewData["AutomaticReticketingFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemAir.AutomaticReticketingFlag);

            //System User
            ViewData["SystemUser"] = "";
            string adminUserGuid = User.Identity.Name.Split(new[] { '|' })[0];
            SystemUserRepository systemUserRepository = new SystemUserRepository();
            SystemUser           systemUser           = systemUserRepository.GetUserBySystemUserGuid(adminUserGuid);

            if (systemUser != null)
            {
                string username = systemUser.FirstName + " " + systemUser.LastName;
                ViewData["SystemUser"] = string.Format("{0} - {1}", username, adminUserGuid);
            }

            return(View(priceTrackingSetupGroupItemAir));
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            PriceTrackingSetupGroupItemAir group = new PriceTrackingSetupGroupItemAir();

            group = priceTrackingSetupGroupItemAirRepository.GetPriceTrackingSetupGroupItemAir(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Get Item From Database
            PriceTrackingSetupGroup priceTrackingSetupGroup = new PriceTrackingSetupGroup();

            priceTrackingSetupGroup = priceTrackingSetupGroupRepository.GetPriceTrackingSetupGroup(group.PriceTrackingSetupGroupId);

            //Check Exists
            if (priceTrackingSetupGroup == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access to PriceTrackingSetupGroup
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToPriceTrackingSetupGroup(priceTrackingSetupGroup.PriceTrackingSetupGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            priceTrackingSetupGroupItemAirRepository.EditForDisplay(group);

            //Set Access Rights to Admin
            ViewData["AdminAccess"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(adminGroupName))
            {
                ViewData["AdminAccess"] = "WriteAccess";
            }

            //PriceTrackingSetupGroup
            ViewData["PriceTrackingSetupGroupId"]   = priceTrackingSetupGroup.PriceTrackingSetupGroupId;
            ViewData["PriceTrackingSetupGroupName"] = priceTrackingSetupGroup.PriceTrackingSetupGroupName;

            //Currency
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencysList      = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name", group.CurrencyCode);

            ViewData["Currencies"] = currencysList;

            //Lists

            ViewData["ClientHasProvidedWrittenApprovalFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.ClientHasProvidedWrittenApprovalFlag);

            ViewData["SharedSavingsList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.SharedSavingsFlag);

            ViewData["TransactionFeeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.TransactionFeeFlag);

            ViewData["CentralFulfillmentTimeZoneRuleCodes"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", group.CentralFulfillmentTimeZoneRuleCode);

            ViewData["TimeZoneRules"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", group.TimeZoneRuleCode);

            ViewData["RefundableToRefundableWithPenaltyForRefundAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.RefundableToRefundableWithPenaltyForRefundAllowedFlag);

            ViewData["RefundableToNonRefundableAllowedFlag"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.RefundableToNonRefundableAllowedFlag);

            ViewData["VoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.VoidWindowAllowedFlag);

            ViewData["RefundableToRefundableOutsideVoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.RefundableToRefundableOutsideVoidWindowAllowedFlag);

            ViewData["NonRefundableToNonRefundableOutsideVoidWindowAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.NonRefundableToNonRefundableOutsideVoidWindowAllowedFlag);

            ViewData["ExchangesAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.ExchangesAllowedFlag);

            ViewData["VoidExchangeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.VoidExchangeAllowedFlag);

            if (group.ExchangePreviousExchangeAllowedFlag == true || group.ExchangePreviousExchangeAllowedFlag == false)
            {
                ViewData["ExchangePreviousExchangeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.ExchangePreviousExchangeAllowedFlag);
            }
            else
            {
                ViewData["ExchangePreviousExchangeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text");
            }

            ViewData["NonRefundableToLowerNonRefundableWithDifferentChangeFeeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                                                group.NonRefundableToLowerNonRefundableWithDifferentChangeFeeAllowedFlag);

            ViewData["RefundableToLowerNonRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                       group.RefundableToLowerNonRefundableAllowedFlag);

            ViewData["RefundableToLowerRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                    group.RefundableToLowerRefundableAllowedFlag);

            ViewData["NonPenaltyRefundableToLowerPenaltyRefundableAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                                     group.NonPenaltyRefundableToLowerPenaltyRefundableAllowedFlag);

            ViewData["ChargeChangeFeeUpFrontForSpecificCarriersFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                           group.ChargeChangeFeeUpFrontForSpecificCarriersFlag);

            ViewData["ChangeFeeMustBeUsedFromResidualValueFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text",
                                                                                      group.ChangeFeeMustBeUsedFromResidualValueFlag);

            ViewData["TrackPrivateNegotiatedFareFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text");

            ViewData["AutomaticReticketingFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.AutomaticReticketingFlag);

            //System User
            ViewData["SystemUser"] = group.LastUpdateUserIdentifier != null ? group.LastUpdateUserIdentifier : group.CreationUserIdentifier;

            return(View(group));
        }
        // GET: /Create
        public ActionResult Create(int id)
        {
            //Get Item From Database
            PriceTrackingSetupGroup group = new PriceTrackingSetupGroup();

            group = priceTrackingSetupGroupRepository.GetPriceTrackingSetupGroup(id);

            //Check Exists
            if (group == 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"));
            }

            //Set Access Rights to Admin
            ViewData["AdminAccess"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(adminGroupName))
            {
                ViewData["AdminAccess"] = "WriteAccess";
            }

            //PriceTrackingSetupGroup
            ViewData["PriceTrackingSetupGroupId"]   = group.PriceTrackingSetupGroupId;
            ViewData["PriceTrackingSetupGroupName"] = group.PriceTrackingSetupGroupName;

            //PriceTrackingSetupGroupItemHotel
            PriceTrackingSetupGroupItemHotel priceTrackingSetupGroupItemHotel = new PriceTrackingSetupGroupItemHotel();

            priceTrackingSetupGroupItemHotel.PriceTrackingSetupGroupId = id;

            //Default Flags
            priceTrackingSetupGroupItemHotel.SharedSavingsFlag  = true;
            priceTrackingSetupGroupItemHotel.TransactionFeeFlag = false;

            //Pricing Model Defaults
            priceTrackingSetupGroupItemHotel.SharedSavingsAmount = 30;

            //Threshold Defaults
            priceTrackingSetupGroupItemHotel.EstimatedCWTRebookingFeeAmount = decimal.Parse("0.00");;
            priceTrackingSetupGroupItemHotel.CWTVoidRefundFeeAmount         = decimal.Parse("0.00");
            priceTrackingSetupGroupItemHotel.ThresholdAmount = decimal.Parse("0.00");

            priceTrackingSetupGroupItemHotel.CalculatedTotalThresholdAmount =
                priceTrackingSetupGroupItemHotel.EstimatedCWTRebookingFeeAmount +
                priceTrackingSetupGroupItemHotel.CWTVoidRefundFeeAmount +
                priceTrackingSetupGroupItemHotel.ThresholdAmount;

            //Hotel Amenity Values Defaults
            priceTrackingSetupGroupItemHotel.RoomTypeUpgradeAllowedFlag           = true;
            priceTrackingSetupGroupItemHotel.BeddingTypeUpgradeAllowedFlag        = true;
            priceTrackingSetupGroupItemHotel.HotelRateCodeUpgradeAllowedFlag      = true;
            priceTrackingSetupGroupItemHotel.NegotiatedUpgradeAllowedFlag         = true;
            priceTrackingSetupGroupItemHotel.CancellationPolicyUpgradeAllowedFlag = true;
            priceTrackingSetupGroupItemHotel.KingQueenUpgradeAllowedFlag          = true;

            //Rate Codes
            priceTrackingSetupGroupItemHotel.CWTRateTrackingCode1 = "CWT";
            priceTrackingSetupGroupItemHotel.CWTRateTrackingCode2 = "CWV";

            //Admin Only
            priceTrackingSetupGroupItemHotel.AlphaCodeRemarkField = "Y";

            //Currency
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencysList      = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            ViewData["Currencies"] = currencysList;

            //Lists

            ViewData["ClientHasProvidedWrittenApprovalFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.ClientHasProvidedWrittenApprovalFlag);

            ViewData["ClientHasHotelFeesInMSAFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.ClientHasHotelFeesInMSAFlag);

            ViewData["ClientUsesConfermaVirtualCardsFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.ClientUsesConfermaVirtualCardsFlag);

            ViewData["CentralFulfillmentTimeZoneRuleCodes"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc");

            ViewData["TimeZoneRules"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc");

            ViewData["SharedSavingsList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.SharedSavingsFlag);

            ViewData["TransactionFeeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.TransactionFeeFlag);

            ViewData["RoomTypeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.RoomTypeUpgradeAllowedFlag);

            ViewData["BeddingTypeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.BeddingTypeUpgradeAllowedFlag);

            ViewData["HotelRateCodeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.HotelRateCodeUpgradeAllowedFlag);

            ViewData["CancellationPolicyUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.CancellationPolicyUpgradeAllowedFlag);

            ViewData["KingQueenUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.KingQueenUpgradeAllowedFlag);

            ViewData["BreakfastChangesAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", priceTrackingSetupGroupItemHotel.BreakfastChangesAllowedFlag);

            ViewData["EnableValueTrackingFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text");

            //System User
            ViewData["SystemUser"] = "";
            string adminUserGuid = User.Identity.Name.Split(new[] { '|' })[0];
            SystemUserRepository systemUserRepository = new SystemUserRepository();
            SystemUser           systemUser           = systemUserRepository.GetUserBySystemUserGuid(adminUserGuid);

            if (systemUser != null)
            {
                string username = systemUser.FirstName + " " + systemUser.LastName;
                ViewData["SystemUser"] = string.Format("{0} - {1}", username, adminUserGuid);
            }

            return(View(priceTrackingSetupGroupItemHotel));
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            PriceTrackingSetupGroupItemHotel group = new PriceTrackingSetupGroupItemHotel();

            group = priceTrackingSetupGroupItemHotelRepository.GetPriceTrackingSetupGroupItemHotel(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Get Item From Database
            PriceTrackingSetupGroup priceTrackingSetupGroup = new PriceTrackingSetupGroup();

            priceTrackingSetupGroup = priceTrackingSetupGroupRepository.GetPriceTrackingSetupGroup(group.PriceTrackingSetupGroupId);

            //Check Exists
            if (priceTrackingSetupGroup == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access to PriceTrackingSetupGroup
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToPriceTrackingSetupGroup(priceTrackingSetupGroup.PriceTrackingSetupGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            priceTrackingSetupGroupItemHotelRepository.EditForDisplay(group);

            //Set Access Rights to Admin
            ViewData["AdminAccess"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(adminGroupName))
            {
                ViewData["AdminAccess"] = "WriteAccess";
            }

            //PriceTrackingSetupGroup
            ViewData["PriceTrackingSetupGroupId"]   = priceTrackingSetupGroup.PriceTrackingSetupGroupId;
            ViewData["PriceTrackingSetupGroupName"] = priceTrackingSetupGroup.PriceTrackingSetupGroupName;

            //Currency
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencysList      = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name", group.CurrencyCode);

            ViewData["Currencies"] = currencysList;

            //Lists

            ViewData["ClientHasProvidedWrittenApprovalFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.ClientHasProvidedWrittenApprovalFlag);

            ViewData["ClientHasHotelFeesInMSAFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.ClientHasHotelFeesInMSAFlag);

            ViewData["ClientUsesConfermaVirtualCardsFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.ClientUsesConfermaVirtualCardsFlag);

            ViewData["CentralFulfillmentTimeZoneRuleCodes"] = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc");

            ViewData["ClientHasHotelFeesInMSAFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.ClientHasHotelFeesInMSAFlag);

            ViewData["SharedSavingsList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.SharedSavingsFlag);

            ViewData["TransactionFeeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.TransactionFeeFlag);

            ViewData["RoomTypeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.RoomTypeUpgradeAllowedFlag);

            ViewData["BeddingTypeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.BeddingTypeUpgradeAllowedFlag);

            ViewData["HotelRateCodeUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.HotelRateCodeUpgradeAllowedFlag);

            ViewData["CancellationPolicyUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.CancellationPolicyUpgradeAllowedFlag);

            ViewData["KingQueenUpgradeAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.KingQueenUpgradeAllowedFlag);

            ViewData["BreakfastChangesAllowedFlagList"] = new SelectList(commonRepository.GetAllowedNotAllowedList().ToList(), "Value", "Text", group.BreakfastChangesAllowedFlag);

            ViewData["EnableValueTrackingFlagList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text");

            //System User
            ViewData["SystemUser"] = group.LastUpdateUserIdentifier != null ? group.LastUpdateUserIdentifier : group.CreationUserIdentifier;

            return(View(group));
        }
        // 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));
        }
Exemple #12
0
        //
        // GET: /ServiceFund/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"));
            }

            ServiceFundVM serviceFundVM = new ServiceFundVM();

            ServiceFund serviceFund = new ServiceFund();

            serviceFundVM.ServiceFund = serviceFund;

            //GDSs
            GDSRepository gdsRepository = new GDSRepository();
            SelectList    gdsList       = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName");

            serviceFundVM.GDSs = gdsList;

            //Countries
            CountryRepository countryRepository = new CountryRepository();
            SelectList        countries         = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName");

            serviceFundVM.Countries = countries;

            //Fund Use Statuses
            FundUseStatusRepository fundUseStatusRepository = new FundUseStatusRepository();
            SelectList fundUseStatusList = new SelectList(fundUseStatusRepository.GetAllFundUseStatuses().ToList(), "Key", "Value");

            serviceFundVM.FundUseStatuses = fundUseStatusList;

            //TimeZoneRules
            TimeZoneRuleRepository timeZoneRuleRepository = new TimeZoneRuleRepository();
            SelectList             timeZoneRules          = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", "CST/CDT");

            serviceFundVM.TimeZoneRules = timeZoneRules;

            //Products
            ProductRepository productRepository = new ProductRepository();
            SelectList        products          = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName");

            serviceFundVM.Products = products;

            //Suppliers
            SupplierRepository supplierRepository = new SupplierRepository();
            SelectList         suppliers          = new SelectList(supplierRepository.GetAllSuppliers().ToList(), "SupplierCode", "SupplierName");

            serviceFundVM.Suppliers = suppliers;

            //Currencies
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencies         = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            serviceFundVM.Currencies = currencies;

            //Service Fund Routings
            ServiceFundRoutingRepository serviceFundRoutingRepository = new ServiceFundRoutingRepository();
            SelectList serviceFundRoutingsList = new SelectList(serviceFundRoutingRepository.GetAllServiceFundRoutings().ToList(), "Key", "Value");

            serviceFundVM.ServiceFundRoutings = serviceFundRoutingsList;

            //ServiceFundChannelTypes
            ServiceFundChannelTypeRepository serviceFundChannelTypeRepository = new ServiceFundChannelTypeRepository();
            SelectList serviceFundChannelTypesList = new SelectList(serviceFundChannelTypeRepository.GetAllServiceFundChannelTypes().ToList(), "ServiceFundChannelTypeId", "ServiceFundChannelTypeName");

            serviceFundVM.ServiceFundChannelTypes = serviceFundChannelTypesList;

            return(View(serviceFundVM));
        }
Exemple #13
0
        // GET: /ServiceFund/Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            ServiceFund serviceFund = new ServiceFund();

            serviceFund = serviceFundRepository.GetServiceFund(id);

            //Check Exists
            if (serviceFund == 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"));
            }

            ServiceFundVM serviceFundVM = new ServiceFundVM();

            serviceFundVM.ServiceFund = serviceFund;

            //GDSs
            GDSRepository gdsRepository = new GDSRepository();
            SelectList    gdsList       = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", serviceFund.GDSCode);

            serviceFundVM.GDSs = gdsList;

            //Countries
            CountryRepository countryRepository = new CountryRepository();
            SelectList        countries         = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", serviceFund.PCCCountryCode);

            serviceFundVM.Countries = countries;

            //Fund Use Statuses
            FundUseStatusRepository fundUseStatusRepository = new FundUseStatusRepository();
            SelectList fundUseStatusList = new SelectList(fundUseStatusRepository.GetAllFundUseStatuses().ToList(), "Key", "Value", serviceFund.FundUseStatus);

            serviceFundVM.FundUseStatuses = fundUseStatusList;

            //TimeZoneRules
            TimeZoneRuleRepository timeZoneRuleRepository = new TimeZoneRuleRepository();
            SelectList             timeZoneRules          = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", serviceFund.TimeZoneRuleCode);

            serviceFundVM.TimeZoneRules = timeZoneRules;

            //Products
            ProductRepository productRepository = new ProductRepository();
            SelectList        products          = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", serviceFund.ProductId);

            serviceFundVM.Products = products;

            //Suppliers
            SupplierRepository supplierRepository = new SupplierRepository();
            SelectList         suppliers          = new SelectList(supplierRepository.GetAllSuppliers().ToList(), "SupplierCode", "SupplierName", serviceFund.SupplierName);

            serviceFundVM.Suppliers = suppliers;

            //Currencies
            CurrencyRepository currencyRepository = new CurrencyRepository();
            SelectList         currencies         = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name", serviceFund.ServiceFundCurrencyCode);

            serviceFundVM.Currencies = currencies;

            //Service Fund Routings
            ServiceFundRoutingRepository serviceFundRoutingRepository = new ServiceFundRoutingRepository();
            SelectList serviceFundRoutingsList = new SelectList(serviceFundRoutingRepository.GetAllServiceFundRoutings().ToList(), "Key", "Value", serviceFund.ServiceFundRouting);

            serviceFundVM.ServiceFundRoutings = serviceFundRoutingsList;

            //ServiceFundChannelTypes
            ServiceFundChannelTypeRepository serviceFundChannelTypeRepository = new ServiceFundChannelTypeRepository();
            SelectList serviceFundChannelTypesList = new SelectList(serviceFundChannelTypeRepository.GetAllServiceFundChannelTypes().ToList(), "ServiceFundChannelTypeId", "ServiceFundChannelTypeName", serviceFund.ServiceFundChannelTypeId);

            serviceFundVM.ServiceFundChannelTypes = serviceFundChannelTypesList;

            serviceFundRepository.EditGroupForDisplay(serviceFund);

            return(View(serviceFundVM));
        }
Exemple #14
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);
        }