//Add Data From Linked Tables for Display
        public void EditItemForDisplay(ReasonCodeAlternativeDescription reasonCodeAlternativeDescription)
        {
            //Add LanguageName
            if (reasonCodeAlternativeDescription.LanguageCode != null)
            {
                LanguageRepository languageRepository = new LanguageRepository();
                Language           language           = new Language();
                language = languageRepository.GetLanguage(reasonCodeAlternativeDescription.LanguageCode);
                if (language != null)
                {
                    reasonCodeAlternativeDescription.LanguageName = language.LanguageName;
                }
            }

            //Add PolicyGroupName
            ReasonCodeItemRepository reasonCodeItemRepository = new ReasonCodeItemRepository();
            ReasonCodeItem           reasonCodeItem           = new ReasonCodeItem();

            reasonCodeItem = reasonCodeItemRepository.GetItem(reasonCodeAlternativeDescription.ReasonCodeItemId);
            if (reasonCodeItem != null)
            {
                reasonCodeItemRepository.EditItemForDisplay(reasonCodeItem);
                reasonCodeAlternativeDescription.ReasonCodeItemDisplayOrder = reasonCodeItem.DisplayOrder;
            }
        }
Example #2
0
        //Add Data From Linked Tables for Display
        public void EditItemForDisplay(ReasonCodeTravelerDescription reasonCodeTravelerDescription)
        {
            //Add LanguageName
            if (reasonCodeTravelerDescription.LanguageCode != null)
            {
                LanguageRepository languageRepository = new LanguageRepository();
                Language           language           = new Language();
                language = languageRepository.GetLanguage(reasonCodeTravelerDescription.LanguageCode);
                if (language != null)
                {
                    reasonCodeTravelerDescription.LanguageName = language.LanguageName;
                }
            }

            //Add PolicyGroupName
            ReasonCodeItemRepository reasonCodeItemRepository = new ReasonCodeItemRepository();
            ReasonCodeItem           reasonCodeItem           = new ReasonCodeItem();

            reasonCodeItem = reasonCodeItemRepository.GetItem(reasonCodeTravelerDescription.ReasonCodeItemId);
            if (reasonCodeItem != null)
            {
                reasonCodeItemRepository.EditItemForDisplay(reasonCodeItem);
                reasonCodeTravelerDescription.ReasonCodeItemDisplayOrder = reasonCodeItem.DisplayOrder;

                //ReasonCodeProductTypeTravelerDescription
                ReasonCodeProductTypeTravelerDescriptionRepository reasonCodeProductTypeTravelerDescriptionRepository = new ReasonCodeProductTypeTravelerDescriptionRepository();
                ReasonCodeProductTypeTravelerDescription           reasonCodeProductTypeTravelerDescription           = new ReasonCodeProductTypeTravelerDescription();
                reasonCodeProductTypeTravelerDescription = reasonCodeProductTypeTravelerDescriptionRepository.GetItem(
                    "en-GB",
                    reasonCodeItem.ReasonCode,
                    reasonCodeItem.ProductId,
                    reasonCodeItem.ReasonCodeTypeId
                    );

                if (reasonCodeProductTypeTravelerDescription != null)
                {
                    reasonCodeTravelerDescription.ReasonCodeProductTypeTravelerDescription = reasonCodeProductTypeTravelerDescription;
                }
                else
                {
                    reasonCodeTravelerDescription.ReasonCodeProductTypeTravelerDescription = new ReasonCodeProductTypeTravelerDescription();
                }
            }
        }