Ejemplo n.º 1
0
        public ActionResult Edit(Experiment editedExperiment)
        {
            string pageAction = "Edit";

            try
            {
                if (ModelState.IsValid)
                {
                    _eRepository.Edit(editedExperiment);
                    return(RedirectToAction(pageAction, new { id = editedExperiment.Id, fromSave = "Saved" }));
                }
                returnModelToEdit(pageAction, ref editedExperiment);
                return(View(pageAction, editedExperiment));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                returnModelToEdit(pageAction, ref editedExperiment);
                return(View(pageAction, editedExperiment));
            }
        }