示例#1
0
        public ActionResult TreatmentPlan()
        {
            // TODO: Retrieve treatment plan from database

            // Dummy username in there to make this work for now
            TreatmentPlan plan = new TreatmentPlan { Username = "******" };
            TreatmentPlanViewModel model = new TreatmentPlanViewModel { Plan = plan };
            return View(model);
        }
示例#2
0
        public ActionResult TreatmentPlan(TreatmentPlanViewModel model)
        {
            if (ModelState.IsValid)
            {
                // TODO: Create/Update treatment plan in DB

                Response.Cookies.Add(new HttpCookie("Eye", model.Plan.WeakEye.ToString()));

                if (model.Plan.Glasses)
                {
                    Response.Cookies.Add(new HttpCookie("Glasses", model.Plan.Glasses.ToString()));
                }
                else
                {
                    Response.Cookies.Remove("Glasses");
                }

                return RedirectToAction("Index", "Home");
            }
            return View(model);
        }