コード例 #1
0
        public CountryMarketOffersListViewModel(Entities.Entity entity, Entities.Country currentCountry, IList <MarketOfferModel> offers, IList <Entities.Country> countries, IList <int> allowedProductTypes, PagingParam pagingParam, int quality, int productID)
        {
            Info = new CountryInfoViewModel(currentCountry);
            var marketService = DependencyResolver.Current.GetService <IMarketService>();

            foreach (var offer in offers)
            {
                Offers.Add(new MarketOfferViewModel(entity, offer, marketService));
            }

            initSelf(currentCountry, countries, allowedProductTypes, pagingParam, quality, productID);
        }
コード例 #2
0
        public OfferMPPViewModel(Entities.Country country, IMPPService mppService, IWalletService walletService)
        {
            Info          = new CountryInfoViewModel(country);
            CountrySelect = Select2AjaxViewModel.Create <CountryController>(c => c.GetMPPAvailableCountries(null, 0), "OtherCountryID", null, "");
            CountrySelect.AddAdditionalData("countryID", country.ID);

            MinimumLength = ConfigurationHelper.Configuration.MinimumMPPLength;
            MaximumLength = ConfigurationHelper.Configuration.MaximumMPPLength;

            CountryGold = walletService.GetWalletMoney(country.Entity.WalletID, GameHelper.Gold.ID).Amount;
            GoldImage   = Images.GetCountryCurrency(GameHelper.Gold).VM;
        }
コード例 #3
0
        public async Task <ActionResult> UpdateTitle(
            [FromBody] CountryInfoViewModel countryInfoViewModel,
            CancellationToken token = default)
        {
            var dto = await _mediator
                      .Send <UpdateTitleCountryDto?>(
                new UpdateTitleCountryCommand(
                    RequestInfo.CorrelationToken,
                    countryInfoViewModel.Id,
                    countryInfoViewModel.Title),
                token);

            return(dto == null !
                ? (ActionResult)NotFound()
                : Ok(
                       new CountryInfoViewModel
            {
                Id = dto.Id,
                Title = dto.Title
            }));
        }
コード例 #4
0
 public NationalConstructionsViewModel(Entities.Country country, IEnumerable <NationalConstruction> constructions, IConstructionService constructionService)
 {
     Info = new CountryInfoViewModel(country);
     Constructions.AddRange(constructions.Select(c => new NationalConstructionItemViewModel(c, constructionService)));
 }
コード例 #5
0
 public ManageSpawnViewModel(Entities.Country country, IList <RegionSpawnInformation> spawnInformations)
 {
     Info = new CountryInfoViewModel(country);
 }