public ActionResult View(int id)
        {
            PolicyMessageGroupItemHotel policyMessageGroupItemHotel = new PolicyMessageGroupItemHotel();

            policyMessageGroupItemHotel = policyMessageGroupItemHotelRepository.GetPolicyMessageGroupItemHotel(id);;

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

            PolicyGroup policyGroup = new PolicyGroup();

            policyGroup = policyGroupRepository.GetGroup(policyMessageGroupItemHotel.PolicyGroupId);

            PolicyMessageGroupItemHotelVM policyMessageGroupItemHotelVM = new PolicyMessageGroupItemHotelVM();

            policyMessageGroupItemHotelVM.PolicyGroupName             = policyGroup.PolicyGroupName;
            policyMessageGroupItemHotelVM.PolicyGroupId               = policyGroup.PolicyGroupId;
            policyMessageGroupItemHotelVM.PolicyMessageGroupItemHotel = policyMessageGroupItemHotel;

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

            policyMessageGroupItemHotelVM.PolicyLocations = policyLocations;

            return(View(policyMessageGroupItemHotelVM));
        }
        public JsonResult IsAvailablePolicyLocationCode(string locationCode, string locationType, int policyLocationID = 0)
        {
            PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository();
            var    result      = policyLocationRepository.GetPolicyLocationByLocationCode(locationCode, locationType, policyLocationID);
            string isAvailable = result.Count == 0 ? "true" : "false";

            return(Json(isAvailable));
        }
Example #3
0
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get PolicyCarVendorGroupItem
            PolicyCarVendorGroupItem policyCarVendorGroupItem = new PolicyCarVendorGroupItem();

            policyCarVendorGroupItem = policyCarVendorGroupItemRepository.GetPolicyCarVendorGroupItem(id);

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

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

            if (!rolesRepository.HasWriteAccessToPolicyGroup(policyCarVendorGroupItem.PolicyGroupId))
            {
                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 PolicyCarStatuses
            PolicyCarStatusRepository policyCarStatusRepository = new PolicyCarStatusRepository();
            SelectList policyCarStatuses = new SelectList(policyCarStatusRepository.GetAllPolicyCarStatuses().ToList(), "PolicyCarStatusId", "PolicyCarStatusDescription");

            ViewData["PolicyCarStatusList"] = policyCarStatuses;

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

            ViewData["ProductList"] = products;

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

            policyCarVendorGroupItem.PolicyGroupName = policyGroup.PolicyGroupName;

            //return edit form
            policyCarVendorGroupItemRepository.EditItemForDisplay(policyCarVendorGroupItem);
            return(View(policyCarVendorGroupItem));
        }
Example #4
0
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get PolicyCarTypeGroupItem
            PolicyCarTypeGroupItem policyCarTypeGroupItem = new PolicyCarTypeGroupItem();

            policyCarTypeGroupItem = policyCarTypeGroupItemRepository.GetPolicyCarTypeGroupItem(id);

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

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

            if (!rolesRepository.HasWriteAccessToPolicyGroup(policyCarTypeGroupItem.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 PolicyCarStatuses
            PolicyCarStatusRepository policyCarStatusRepository = new PolicyCarStatusRepository();
            SelectList carStatuses = new SelectList(policyCarStatusRepository.GetAllPolicyCarStatuses().ToList(), "PolicyCarStatusId", "PolicyCarStatusDescription");

            ViewData["PolicyCarStatusList"] = carStatuses;

            //Populate List of CarTypeCategories
            CarTypeCategoryRepository carTypeCategoryRepository = new CarTypeCategoryRepository();
            SelectList carTypes = new SelectList(carTypeCategoryRepository.GetAllCarTypeCategories().ToList(), "CarTypeCategoryId", "CarTypeCategoryName");

            ViewData["CarTypeCategoryList"] = carTypes;

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

            policyCarTypeGroupItem.PolicyGroupName = policyGroup.PolicyGroupName;

            //Show 'Edit' Form
            policyCarTypeGroupItemRepository.EditItemForDisplay(policyCarTypeGroupItem);
            return(View(policyCarTypeGroupItem));
        }
Example #5
0
        // GET: /Create
        public ActionResult Create(int id)
        {
            PolicyGroup policyGroup = policyGroupRepository.GetGroup(id);

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

            ViewData["PolicyLocationList"] = policyLocations;

            //Populate List of PolicyCarStatuses
            PolicyCarStatusRepository policyCarStatusRepository = new PolicyCarStatusRepository();
            SelectList carStatuses = new SelectList(policyCarStatusRepository.GetAllPolicyCarStatuses().ToList(), "PolicyCarStatusId", "PolicyCarStatusDescription");

            ViewData["PolicyCarStatusList"] = carStatuses;

            //Populate List of CarTypeCategories
            CarTypeCategoryRepository carTypeCategoryRepository = new CarTypeCategoryRepository();
            SelectList carTypes = new SelectList(carTypeCategoryRepository.GetAllCarTypeCategories().ToList(), "CarTypeCategoryId", "CarTypeCategoryName");

            ViewData["CarTypeCategoryList"] = carTypes;

            //populate new PolicyCarTypeGroupItem with known PolicyGroup Information
            PolicyCarTypeGroupItem policyCarTypeGroupItem = new PolicyCarTypeGroupItem();

            policyCarTypeGroupItem.PolicyGroupId   = id;
            policyCarTypeGroupItem.PolicyGroupName = policyGroup.PolicyGroupName;

            //Show 'Create' Form
            return(View(policyCarTypeGroupItem));
        }
Example #6
0
        public ActionResult Create(int id)
        {
            PolicyGroup policyGroup = new PolicyGroup();

            policyGroup = policyGroupRepository.GetGroup(id);;

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

            RolesRepository rolesRepository = new RolesRepository();

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

            PolicyMessageGroupItemAirVM policyMessageGroupItemAirVM = new PolicyMessageGroupItemAirVM();

            policyMessageGroupItemAirVM.PolicyGroupName = policyGroup.PolicyGroupName;
            policyMessageGroupItemAirVM.PolicyGroupId   = policyGroup.PolicyGroupId;

            PolicyMessageGroupItemAir policyMessageGroupItemAir = new PolicyMessageGroupItemAir();

            policyMessageGroupItemAir.ProductId     = 1; //Air
            policyMessageGroupItemAir.PolicyGroupId = policyGroup.PolicyGroupId;
            policyMessageGroupItemAirVM.PolicyMessageGroupItemAir = policyMessageGroupItemAir;

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

            PolicyRouting policyRouting = new PolicyRouting();

            policyRouting.FromGlobalFlag            = false;
            policyRouting.ToGlobalFlag              = false;
            policyMessageGroupItemAir.PolicyRouting = policyRouting;

            return(View(policyMessageGroupItemAirVM));
        }
        // 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));
        }
Example #8
0
        public ActionResult Edit(int id)
        {
            PolicyMessageGroupItemCar policyMessageGroupItemCar = new PolicyMessageGroupItemCar();

            policyMessageGroupItemCar = policyMessageGroupItemCarRepository.GetPolicyMessageGroupItemCar(id);;

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

            PolicyGroup policyGroup = new PolicyGroup();

            policyGroup = policyGroupRepository.GetGroup(policyMessageGroupItemCar.PolicyGroupId);

            RolesRepository rolesRepository = new RolesRepository();

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

            PolicyMessageGroupItemCarVM policyMessageGroupItemCarVM = new PolicyMessageGroupItemCarVM();

            policyMessageGroupItemCarVM.PolicyGroupName           = policyGroup.PolicyGroupName;
            policyMessageGroupItemCarVM.PolicyGroupId             = policyGroup.PolicyGroupId;
            policyMessageGroupItemCarVM.PolicyMessageGroupItemCar = policyMessageGroupItemCar;

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

            policyMessageGroupItemCarVM.PolicyLocations = policyLocations;

            return(View(policyMessageGroupItemCarVM));
        }
Example #9
0
        // 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));
        }
Example #10
0
        // 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));
        }