Ejemplo n.º 1
0
        public IActionResult Lighting(LightingResponse data, string nextBtn)
        {
            if (nextBtn != null && ModelState.IsValid && data.Satisfied.HasValue)
            {
                TempData["Satisfied"] = data.Satisfied == true ? "yes" : "no";
                TempData.Keep();
                return(Redirect("Brightness"));
            }

            TempData.Keep();
            return(View());
        }
Ejemplo n.º 2
0
        public IActionResult Lighting()
        {
            var satisfied = TempData["Satisfied"] as string;

            if (!string.IsNullOrWhiteSpace(satisfied))
            {
                var respondentAddress = new LightingResponse
                {
                    Satisfied = satisfied == "yes" ? true : false
                };
                TempData.Keep();
                return(View(respondentAddress));
            }

            TempData.Keep();
            return(View());
        }