public async Task <ActionResult <Login> > Put(ActualizaIG a) { Login l = new Login(); Paciente p = _pacienteService.Get(a.mail); VoluntarioBasico vb = _voluntarioBasicoService.Get(a.mail); VoluntarioMedico vm = _voluntarioMedicoService.Get(a.mail); VoluntarioAsociacion va = _voluntarioAsociacionService.Get(a.mail); if (p != null) { if (p.IdGoogle == null || p.IdGoogle.Equals("0")) { p.IdGoogle = a.idGoogle; _pacienteService.Update(p); } l.inicio = 1; } else if (vb != null) { if (vb.IdGoogle == null || vb.IdGoogle.Equals("0")) { vb.IdGoogle = a.idGoogle; _voluntarioBasicoService.Update(vb); } l.inicio = 1; } else if (vm != null) { if (vm.IdGoogle == null || vm.IdGoogle.Equals("0")) { vm.IdGoogle = a.idGoogle; _voluntarioMedicoService.Update(vm); } l.inicio = 1; } else if (va != null) { if (va.IdGoogle == null || va.IdGoogle.Equals("0")) { va.IdGoogle = a.idGoogle; _voluntarioAsociacionService.Update(va); } l.inicio = 1; } else { l.inicio = 0; } return(Ok(l)); }
public async Task <ActionResult <VoluntarioMedico> > Update(VoluntarioMedico vm) { var vmUpdateado = await _voluntarioService.Update(vm); return(Ok(vmUpdateado)); }