// GET: /Edit
        public ActionResult Edit(int id)
        {
            //Set Access Rights
            ViewData["Access"] = "";
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            PolicyLocation policyLocation = new PolicyLocation();

            policyLocation = policyLocationRepository.GetPolicyLocation(id);
            if (policyLocation == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            TravelPortTypeRepository travelPortTypeRepository = new TravelPortTypeRepository();
            SelectList travelPortTypes = new SelectList(travelPortTypeRepository.GetAllTravelPortTypes().ToList(), "TravelPortTypeId", "TravelPortTypeDescription");

            ViewData["TravelPortTypeList"] = travelPortTypes;

            policyLocationRepository.EditForDisplay(policyLocation);
            return(View(policyLocation));
        }
        // GET: /View
        public ActionResult View(int id, string languageCode)
        {
            //Get Item
            PolicyMessageGroupItemLanguage policyMessageGroupItemLanguage = new PolicyMessageGroupItemLanguage();

            policyMessageGroupItemLanguage = policyMessageGroupItemLanguageRepository.GetItem(id, languageCode);

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

            PolicyMessageGroupItem policyMessageGroupItem = new PolicyMessageGroupItem();

            policyMessageGroupItem = policyMessageGroupItemRepository.GetPolicyMessageGroupItem(id);

            PolicyMessageGroupItemHotelLanguageVM policyMessageGroupItemLanguageVM = new PolicyMessageGroupItemHotelLanguageVM();

            policyMessageGroupItemLanguageVM.PolicyMessageGroupItemName = policyMessageGroupItem.PolicyMessageGroupItemName == null ? "[NONE]" : policyMessageGroupItem.PolicyMessageGroupItemName;
            policyMessageGroupItemLanguageVM.PolicyMessageGroupItemId   = policyMessageGroupItem.PolicyMessageGroupItemId;

            policyMessageGroupItemLanguageVM.PolicyMessageGroupItemLanguage = policyMessageGroupItemLanguage;

            PolicyGroup policyGroup = new PolicyGroup();

            policyGroup = policyGroupRepository.GetGroup(policyMessageGroupItem.PolicyGroupId);
            policyMessageGroupItemLanguageVM.PolicyGroupId   = policyGroup.PolicyGroupId;
            policyMessageGroupItemLanguageVM.PolicyGroupName = policyGroup.PolicyGroupName;

            Product product = new Product();

            product = productRepository.GetProduct((int)policyMessageGroupItem.ProductId);
            policyMessageGroupItemLanguageVM.ProductName = product.ProductName;

            PolicyLocation policyLocation = new PolicyLocation();

            policyLocation = policyLocationRepository.GetPolicyLocation((int)policyMessageGroupItem.PolicyLocationId);
            policyMessageGroupItemLanguageVM.PolicyLocationName = policyLocation.PolicyLocationName;

            return(View(policyMessageGroupItemLanguageVM));
        }