public async Task <PartialViewResult> _ApCardiovascular(int PacienteId) { var items = await _apCardioService.ListApCardiovascularAsync(PacienteId); List <ApCardiovascularFormModel> model = new List <ApCardiovascularFormModel>(); foreach (var item in items) { var new_item = new ApCardiovascularFormModel() { Id = item.Id, Estado = EstadoApCardiovascular(item.EstadoId), EvaluacionCardiologica = item.EvaluacionCardiologica, Eventos = item.Eventos, Planes = item.Planes, UserName = item.UserAdd, DateAdd = item.DateAdd }; var inotropicos = await _apCardioService.ListInotropicosAsync(item.Id, true); new_item.Inotropicos = inotropicos.Select(c => new InotropicosModel() { Id = c.Id, Nombre = c.Nombre, Valor = c.Valor }); var enzimas = await _apCardioService.ListEnzimasCardiacasAsync(item.Id); new_item.EnzimasCardiacas = enzimas.Select(c => new EnzimasCardiacasModel() { Id = c.Id, Nombre = c.Nombre, Valor = c.Valor, Curva = CurvaEnzimas(c.Curva) }); model.Add(new_item); } ViewBag.ListInotropicos = await SelectListInotropicosAsync(0); ViewBag.ListEnzimas = await SelectListEnzimasAsync(0); return(PartialView(model)); }
public async Task <JsonResult> AddApCardiovascular(ApCardiovascularFormModel model) { await _apCardioService.AddApCardiovascularAsync(model.PacienteId, model.Estado, model.EvaluacionCardiologica, model.InotropicosJSON, model.EnzimasCardiacasJSON, model.Eventos, model.Planes, User.Identity.Name); return(Json(new { Success = true })); }