private void loadCountryList(int countryID) { Functions = ProductTypeEnumUtils.GetFunctionsList(); var regionRepository = DependencyResolver.Current.GetService <IRegionRepository>(); var regions = regionRepository.Where(r => r.CountryID == countryID) .Select(r => new { ID = r.ID, Name = r.Name }).ToList(); Regions = CreateSelectList(regions, r => r.Name, r => r.ID, false); }
public ConstructCompanyViewModel(Entities.Country country, IRegionRepository regionRepository, IWalletService walletService, ICountryTreasureService countryTreasuryService) { Info = new CountryInfoViewModel(country); CountryID = country.ID; var regions = regionRepository.Where(r => r.CountryID == country.ID). Select(r => new { Name = r.Name, ID = r.ID }).ToList(); Regions = CreateSelectList(regions, r => r.Name, r => r.ID, true); Functions = ProductTypeEnumUtils.GetFunctionsList(); GoldNeeded = new MoneyViewModel(GameHelper.Gold, ConfigurationHelper.Configuration.CompanyCountryFee); var walletID = Persistent.Countries.GetById(country.ID).Entity.WalletID; TreasureGold = new MoneyViewModel(walletService.GetWalletMoney(walletID, GameHelper.Gold.ID)); CanSeeTreasury = countryTreasuryService.CanSeeCountryTreasure(country, SessionHelper.CurrentEntity).isSuccess; }