public JsonResult CreateByFrontEnd(ViewModel.Pacientes.PacienteViewModel entity) { if (!ModelState.IsValid) { return(new JsonResult(new { success = false, message = FriendlyErrors() }) { StatusCode = 200 }); } try { var op = _pacienteAppService.Save(entity); if (op.OK) { return(new JsonResult(new { success = true, message = "", PacienteId = op.Id }) { StatusCode = 200 }); } else { return(new JsonResult(new { success = false, message = op.ToString() }) { StatusCode = 200 }); } } catch (Exception ex) { _logger.LogError(ex, "Error Federando Paciente"); return(new JsonResult(new { message = ex.Message }) { StatusCode = 500 }); } }
private void SetupModel(ViewModel.Pacientes.PacienteViewModel model) { model.TipoDocumentoList = _selectListHelper.GetTipoDocumentoList(); model.SexoList = _selectListHelper.GetSexoList(); }