public async Task <IActionResult> Post(DiagnosisDto dto) { var userId = User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value; var newDiag = await _service.AddAsync(dto, userId); return(Ok(newDiag)); }
public IActionResult Put([FromRoute] int id, [FromBody] DiagnosisDto diagnosis) { return(new JsonVoidResult { Errors = null, StatusCode = HttpStatusCode.OK, Message = null }); }
public IActionResult Post([FromBody] DiagnosisDto diagnosis) { return(new JsonResult <int> { Errors = null, StatusCode = HttpStatusCode.Created, Data = DiagnosisId++, Message = null }); }
public async Task <Diagnosis> AddAsync(DiagnosisDto dto, string vetUserId) { var vetUser = await _unitOfWork.UserRepository.GetByIdAsync(vetUserId); // TO DO: convert with automapper dto to diagnosis //var newDiag = new Diagnosis //{ // Notes = dto.Notes, // VeterinarianId = vetUser.VeterinarianId.Value, // PatientId = dto.PatientId, // Date = DateTime.Now //}; var newDiag = _mapper.Map <Diagnosis>(dto); newDiag.VeterinarianId = vetUser.VeterinarianId.Value; newDiag.Date = DateTime.Now; await _unitOfWork.DiagnosisRepository.InsertAsync(newDiag); await _unitOfWork.CommitAsync(); return(newDiag); }
public bool HasDiagnosisToProcedureHintList(DiagnosisDto diagnosis) { throw new NotImplementedException(); }
public void AddDiagnosisToLocalStorage(DiagnosisDto diag) { throw new NotImplementedException(); }
public async Task <IActionResult> Put([FromBody] DiagnosisDto diagnosis) { return(Success(await _diagnosisService.CreateAsync(diagnosis))); }
public async Task <IActionResult> Post([FromBody] DiagnosisDto diagnosis) { await _diagnosisService.UpdateAsync(diagnosis); return(Success()); }