internal IEnumerable <CurrencyDTO> GetSupportedCurrencies(string id, CurrencyRepository currencyRepository) { return(Connector.ExecuteReader(getSupportedCurrenciesQuery, new Dictionary <string, object>() { { "Id", id } }, reader => { string currencyId = reader["Id"] as string; return new CurrencyDTO() { Id = currencyId, DisplayName = new LocalizationDictionary(currencyRepository.GetDisplayName(currencyId)) }; })); }
private PartnerInvoiceDTO ReadFromDataReader(IDataReader reader, CurrencyRepository currencyRepository, PartnerInvoiceDetailRepository invoiceDetailRepository) { string currencyId = reader["CurrencyId"] as string; Guid invoiceId = (Guid)reader["Id"]; return(new PartnerInvoiceDTO() { Id = invoiceId, Partner = new PartnerDTO() { Id = (Guid)reader["Partner"] }, TimeStamp = (DateTime)reader["TimeStamp"], Currency = new CurrencyDTO() { Id = currencyId, DisplayName = new LocalizationDictionary(currencyRepository.GetDisplayName(currencyId)), Symbol = reader["CurrencySymbol"] as string }, StripeId = reader["StripeId"] as string, Details = invoiceDetailRepository.SelectByInvoice(invoiceId) }); }
private PartnerDTO ReadFromDataReader(IDataReader reader, PartnerCardRepository cardRepository, CountryRepository countryRepository, CurrencyRepository currencyRepository, CustomerQuestionRepository customerQuestionRepository, DistrictRepository districtRepository, GenderRepository genderRepository, PartnerInvoiceRepository invoiceRepository, LanguageRepository languageRepository, PropertyRepository propertyRepository, ProvinceRepository provinceRepository, RegionRepository regionRepository) { string countryId = reader["Country"] as string, districtId = reader["District"] as string, genderId = reader["Gender"] as string, preferredCurrencyId = reader["PreferredCurrencyId"] as string, preferredLanguageId = reader["PreferredLanguage"] as string, provinceId = reader["Province"] as string, regionId = reader["Region"] as string; CountryDTO country = new CountryDTO() { Id = countryId, DisplayName = new LocalizationDictionary(countryRepository.GetDisplayName(countryId)), Regions = regionRepository.ReadByCountry(countryId), SupportedCurrencies = countryRepository.GetSupportedCurrencies(countryId), SupportedLanguages = countryRepository.GetSupportedLanguages(countryId) }; Guid id = (Guid)reader["Id"]; return(new PartnerDTO() { Id = id, Username = reader["Username"] as string, Password = reader["Password"] as byte[], FirstName = reader["FirstName"] as string, MiddleName = reader["MiddleName"] as string, LastName = reader["LastName"] as string, Gender = new GenderDTO() { Id = genderId, DisplayName = new LocalizationDictionary(genderRepository.GetDisplayName(genderId)) }, EmailAddress = reader["EmailAddress"] as string, MobileNumber = reader["MobileNumber"] as string, CompanyName = reader["CompanyName"] as string, Address = reader["Address"] as string, District = new DistrictDTO() { Country = country, Code = districtId, DisplayName = new LocalizationDictionary(districtRepository.GetDisplayName(country.Id, districtId)) }, Province = new ProvinceDTO() { Country = country, Code = provinceId, DisplayName = new LocalizationDictionary(provinceRepository.GetDisplayName(country.Id, provinceId)), Districts = districtRepository.ReadByCountryAndRegionAndProvince(countryId, regionId, provinceId) }, Region = new RegionDTO() { Country = country, Code = regionId, DisplayName = new LocalizationDictionary(regionRepository.GetDisplayName(country.Id, regionId)), Provinces = provinceRepository.ReadByCountryAndRegion(countryId, regionId) }, Country = country, PhoneNumber = reader["PhoneNumber"] as string, Website = reader["Website"] as string, PreferredCurrency = new CurrencyDTO() { Id = preferredCurrencyId, DisplayName = new LocalizationDictionary(currencyRepository.GetDisplayName(preferredCurrencyId)), Symbol = reader["PreferredCurrencySymbol"] as string }, PreferredLanguage = new LanguageDTO() { Id = preferredLanguageId, DisplayName = new LocalizationDictionary(languageRepository.GetDisplayName(preferredLanguageId)) }, StripeId = reader["StripeId"] as string, HasEmailAddressBeenVerified = (bool)reader["HasEmailAddressBeenVerified"], IsLocked = (bool)reader["IsLocked"], IsActive = (bool)reader["IsActive"], Cards = cardRepository.SelectByPartner(id), CustomerQuestions = customerQuestionRepository.SelectByPartner(id), Invoices = invoiceRepository.SelectByPartner(id), Properties = propertyRepository.SelectByPartner(id) }); }