示例#1
0
        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));
        }
示例#2
0
 public IActionResult Put([FromRoute] int id, [FromBody] DiagnosisDto diagnosis)
 {
     return(new JsonVoidResult
     {
         Errors = null,
         StatusCode = HttpStatusCode.OK,
         Message = null
     });
 }
示例#3
0
 public IActionResult Post([FromBody] DiagnosisDto diagnosis)
 {
     return(new JsonResult <int>
     {
         Errors = null,
         StatusCode = HttpStatusCode.Created,
         Data = DiagnosisId++,
         Message = null
     });
 }
示例#4
0
        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);
        }
示例#5
0
 public bool HasDiagnosisToProcedureHintList(DiagnosisDto diagnosis)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public void AddDiagnosisToLocalStorage(DiagnosisDto diag)
 {
     throw new NotImplementedException();
 }
示例#7
0
 public async Task <IActionResult> Put([FromBody] DiagnosisDto diagnosis)
 {
     return(Success(await _diagnosisService.CreateAsync(diagnosis)));
 }
示例#8
0
        public async Task <IActionResult> Post([FromBody] DiagnosisDto diagnosis)
        {
            await _diagnosisService.UpdateAsync(diagnosis);

            return(Success());
        }