コード例 #1
0
        public ViewMonetaryMarketViewModel()
        {
            Info = new MonetaryInfoViewModel();

            foreach (var currency in Persistent.Currencies.GetAll())
            {
                Currencies.Add(new SelectListItem()
                {
                    Value = currency.ID.ToString(),
                    Text  = currency.Symbol
                });
            }

            foreach (MonetaryOfferTypeEnum offerType in Enum.GetValues(typeof(MonetaryOfferTypeEnum)))
            {
                OfferTypes.Add(new SelectListItem()
                {
                    Text  = offerType.ToString(),
                    Value = ((int)offerType).ToString()
                });
            }
        }
コード例 #2
0
        public JobMarketViewModel(int countryID, IEnumerable <Entities.Country> countries, CountryBestJobOffers bestJobs)
        {
            CountryID = countryID;

            foreach (var country in countries)
            {
                Countries.Add(new SelectListItem()
                {
                    Value = country.ID.ToString(),
                    Text  = country.Entity.Name
                });

                if (country.ID == CountryID)
                {
                    MinMax = new JobMarketBestViewModel(country, bestJobs);
                }
            }
            foreach (WorkTypeEnum workType in Enum.GetValues(typeof(WorkTypeEnum)))
            {
                WorkTypes.Add(new SelectListItem()
                {
                    Value    = ((int)workType).ToString(),
                    Text     = workType.ToString(),
                    Selected = (workType == WorkTypeEnum.Any)
                });
            }

            foreach (JobOfferTypeEnum offerType in Enum.GetValues(typeof(JobOfferTypeEnum)))
            {
                OfferTypes.Add(new SelectListItem()
                {
                    Text  = offerType.ToString(),
                    Value = ((int)offerType).ToString()
                });
            }
        }