Ejemplo n.º 1
0
        public ActionResult Edit(int id, ClinicEdit model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (model.ClinicId != id)
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(model));
            }
            var service = new ClinicService();

            if (service.UpdateClinic(model))
            {
                TempData["SaveResult"] = "Clinic information successfully updated.";
                return(RedirectToAction("Index"));
            }
            ModelState.AddModelError("", "Clinic could not be updated.");
            return(View(model));
        }