Пример #1
0
        private void AddCountryToDataSet(ResultData resultData, IPublishedContent landkosten, string goalCurrency, String localizedYear)
        {
            var kostenland = new CountryCost(landkosten, goalCurrency);

            for (int i = 1; i <= 20; i++)
            {

                int jaarTakseInGoalCurrency = kostenland.GetYear(i) ?? default(int);

                if (jaarTakseInGoalCurrency > resultData.MaxTakse)
                {
                    resultData.MaxTakse = jaarTakseInGoalCurrency;
                }

                resultData.AddDataPoint(i, jaarTakseInGoalCurrency, localizedYear);
            }

            string stepWidthString = (resultData.MaxTakse / 10).ToString();
            int biggestInt = Convert.ToInt32(stepWidthString[0].ToString()) + 1;
            string nextBigNumberforStep = biggestInt.ToString();

            for (int i = 0; i < stepWidthString.Length - 1; i++)
            {
                nextBigNumberforStep += "0";
            }

            int nextBigNumberForStepInt = Convert.ToInt32(nextBigNumberforStep);
            resultData.StepWidth = nextBigNumberForStepInt;
        }
Пример #2
0
        public ActionResult Index()
        {
            var currency = Request.Params.Get("currency");

            if (String.IsNullOrEmpty(currency))
            {
                currency = "EUR";
            }

            var kostenLandId = CurrentPage.GetPropertyValue("kostenland");
            var kostenLandItem = Umbraco.TypedContent(kostenLandId);

            var kostenland = new CountryCost(kostenLandItem, currency);

            return PartialView("ExtraCost", kostenland);
        }