示例#1
0
        public ActionResult Parametrage()
        {
            var model = new ParametrageModel
            {
                Duration = _parametrageService.LoadDuration(),
            };

            return(View(model));
        }
示例#2
0
        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));
        }