public ActionResult Index()
        {
            var model = new TariffCalculatorModel()
            {
                LocalPeakPercent    = 50,
                NationalPeakPercent = 50,
                TariffList          = tariffCalculator.GetAllTariffs()
                                      .Select(tariff => new SelectListItem()
                {
                    Value    = tariff.Id,
                    Text     = tariff.Name,
                    Selected = false
                })
            };

            return(View(model));
        }
示例#2
0
        // GET: TariffCalculator
        public ActionResult Index()
        {
            var model = new TariffCalculatorModel
            {
                LocalPeakPercent    = 50,
                NationalDuration    = 50,
                LocalDuration       = 30,
                NationalPeakPercent = 40,
                TariffList          = tariffCalculator.GetAllTariffs().Select(x =>
                                                                              new SelectListItem
                {
                    Text  = x.Name,
                    Value = x.Id
                })
            };

            return(View(model));
        }
示例#3
0
 public List <Tariff> GetAllTariffs()
 {
     return(new List <Tariff>(TariffCalculator.GetAllTariffs()));
 }