Esempio n. 1
0
        public ActionResult Create(FormDiagnosticoTratamiento form)
        {
            try
            {
                //Generates a list of objects{DiagnosticoDto, MaterialSoportePlantarDto} and passes to the service
                var objects = form.FormToDto(true);
                _diagnosticoTratamientoService.Insert((DiagnosticoDto)objects[0], (MaterialSoportePlantarDto)objects[1]);
                return(Redirect("~/ListaPacientes/ListaPacientes/"));
            }
            catch (Exception ex)
            {
                _log.Error($"[Method: Create(FormDiagnosticoTratamiento form)] -> {ex}");

                return(Redirect("~/Error/Error"));
            }
        }
Esempio n. 2
0
        public ActionResult Edit(FormDiagnosticoTratamiento form)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var objects = form.FormToDto();
                    _diagnosticoTratamientoService.Update((DiagnosticoDto)objects[0], (MaterialSoportePlantarDto)objects[1]);
                    return(Redirect("~/ListaPacientes/ListaPacientes/"));
                }

                return(View(form));
            }
            catch (Exception ex)
            {
                _log.Error($"[Method: Edit(FormDiagnosticoTratamiento form)] -> {ex}");

                return(Redirect("~/Error/Error"));
            }
        }