public ActionResult Parametrage() { var model = new ParametrageModel { Duration = _parametrageService.LoadDuration(), }; return View(model); }
public ActionResult Parametrage(ParametrageModel model) { if (!ModelState.IsValid) { return View(new ParametrageModel { Duration = model.Duration, Result = "La durée n'est pas valide" }); } _parametrageService.SaveDuration(model.Duration); model.Result = "Paramétrage sauvegardé"; return View(model); }