// GET: calcualtors/alienweightresult?planet=xyz&weight=123
        public ActionResult AlienTravelResult(AlienTravelModel model)
        {
            AlienTravelResultViewModel alienTravelResult = new AlienTravelResultViewModel(model.SelectedPlanet, model.SelectedModeOfTransportation, model.EarthAge);

            alienTravelResult.EarthAge = model.EarthAge;

            return(View(alienTravelResult));
        }
        public ActionResult AlienTravelResult(string planet, decimal age, string mode)
        {
            AlienTravelModel model = new AlienTravelModel()
            {
                Planet = planet,
                Age    = age,
                Mode   = mode
            };

            return(View("AlienTravelResult", model));
        }
Пример #3
0
        public ActionResult AlienTravelResult(AlienTravelModel model)
        {
            //?Planet = Mercury & EarthWeight = 55
            var queryString = HttpContext.Request.QueryString;

            model.Vehicle = queryString.GetValues("vehicle")[0];

            var qs = queryString.GetValues("earthAge")[0];
            int _age;

            if (int.TryParse(qs, out _age))
            {
                model.Age = _age;
            }

            model.CalcTravelTimeAndAge();
            return(View("AlienTravelResult", model));
        }
 public ActionResult AlienTravelResult(AlienTravelModel model)
 {
     return(View("AlienTravelResult", model));
 }