예제 #1
0
        private void SetDefaults(UserSettings settings)
        {
            SelectedCountry =
                CountryList?.FirstOrDefault(
                    country => country.CountryCode == settings.ReceiveSettings.CountryCode) ??
                CountryList?.FirstOrDefault();

            SelectedCountrySubdivision =
                CountrySubdivisionList.FirstOrDefault(
                    countrySubdivision => countrySubdivision.CountrySubdivisionCode ==
                    settings.ReceiveSettings.CountrySubdivisionCode) ??
                CountrySubdivisionList.FirstOrDefault();

            SelectedCurrency =
                CurrencyList?.FirstOrDefault(curr =>
                                             curr.CurrencyCode == settings.ReceiveSettings.CurrencyCode) ?? CurrencyList?.FirstOrDefault();

            SelectedAmountRange =
                AmountRangeList?.FirstOrDefault(ar => ar.Code == settings.ReceiveSettings.AmountRange) ??
                AmountRangeList?.FirstOrDefault();

            CustomAmount = settings.ReceiveSettings.CustomAmount;

            SelectedItemChoice =
                ItemChoiceList?.FirstOrDefault(ic => ic.Code == settings.ReceiveSettings.ItemChoice) ??
                ItemChoiceList?.FirstOrDefault();

            SelectedServiceOption =
                ServiceOptionList?.FirstOrDefault(so => so.Key == settings.ReceiveSettings.ServiceOption) ??
                ServiceOptionList?.FirstOrDefault();

            SelectedThirdPartyType =
                ThirdPartyTypeList?.FirstOrDefault(tp => tp == settings.ReceiveSettings.ThirdPartyType) ??
                ThirdPartyTypeList?.FirstOrDefault();
        }
예제 #2
0
        private void SetDefaults(UserSettings settings)
        {
            SelectedRefundReason =
                RefundReasonList?.FirstOrDefault(reason => reason.Identifier == settings.SendReversalSettings.RefundReasonCode) ??
                RefundReasonList?.FirstOrDefault();

            RefundFee = settings.SendReversalSettings.RefundFee;

            SelectedCountry = CountryList?.FirstOrDefault(country => country.CountryCode == settings.SendReversalSettings.CountryCode);

            SelectedCountrySubdivision =
                CountrySubdivisionList.FirstOrDefault(countrySubdivision =>
                                                      countrySubdivision.CountrySubdivisionCode == settings.SendReversalSettings.CountrySubdivisionCode) ??
                CountrySubdivisionList.FirstOrDefault();

            SelectedCurrency =
                CurrencyList?.FirstOrDefault(curr => curr.CurrencyCode == settings.SendReversalSettings.CurrencyCode) ??
                CurrencyList?.FirstOrDefault();

            SelectedAmountRange =
                AmountRangeList?.FirstOrDefault(ar => ar.Code == settings.SendReversalSettings.AmountRange) ??
                AmountRangeList?.FirstOrDefault();

            SelectedItemChoice =
                ItemChoiceList?.FirstOrDefault(ic => ic.Code == settings.SendReversalSettings.ItemChoice) ??
                ItemChoiceList?.FirstOrDefault();

            SelectedServiceOption =
                ServiceOptionList?.FirstOrDefault(so => so.Key == settings.SendReversalSettings.ServiceOption) ??
                ServiceOptionList?.FirstOrDefault();

            SelectedThirdPartyType =
                ThirdPartyTypeList?.FirstOrDefault(tp => tp == settings.SendReversalSettings.ThirdPartyType) ??
                ThirdPartyTypeList?.FirstOrDefault();
        }
        private void SetDefaults(UserSettings settings)
        {
            SendSettings settingsSource = _transactionName == StaticTransactionNames.Send
                ? settings.SendSettings
                : settings.StagedSendSettings;

            SelectedCountry =
                CountryList?.FirstOrDefault(country => country.CountryCode == settingsSource.CountryCode) ??
                CountryList?.FirstOrDefault();

            SelectedCountrySubdivision =
                CountrySubdivisionList.FirstOrDefault(
                    countrySubdivision => countrySubdivision.CountrySubdivisionCode ==
                    settingsSource.CountrySubdivisionCode) ??
                CountrySubdivisionList.First();

            SelectedCurrency = CurrencyList?.FirstOrDefault(curr => curr.CurrencyCode == settingsSource.CurrencyCode) ??
                               CurrencyList?.FirstOrDefault();

            SelectedAmountRange =
                AmountRangeList?.FirstOrDefault(ar => ar.Code == settingsSource.AmountRange) ??
                AmountRangeList?.FirstOrDefault();

            CustomAmount = settingsSource.CustomAmount;

            SelectedItemChoice =
                ItemChoiceList?.FirstOrDefault(ic => ic.Code == settingsSource.ItemChoice) ??
                ItemChoiceList?.FirstOrDefault();

            SelectedServiceOption =
                ServiceOptionList?.FirstOrDefault(so => so.Key == settingsSource.ServiceOption) ??
                ServiceOptionList?.FirstOrDefault();

            SelectedThirdPartyType = ThirdPartyTypeList?.FirstOrDefault(tp => tp == settingsSource.ThirdPartyType) ??
                                     ThirdPartyTypeList?.FirstOrDefault();
        }