public async Task <AppResponse <bool> > EditDiagnosisAsync(long id, EditDiagnosisInput input) { try { bool isSurgeryExist = await _systemtLookupsManager.IsDiagnosisExistAsync(input.Name); if (isSurgeryExist) { return new AppResponse <bool> { IsSuccessful = false, StatusCode = StatusCodes.ENTITY_ALREADY_EXIST, StatusDescription = string.Format(L("NameExist"), L("Diagnosis")) } } ; return(new AppResponse <bool> { Data = await _systemtLookupsManager.EditDiagnosisAsync(id, input), IsSuccessful = true, StatusCode = StatusCodes.SUCCESS, StatusDescription = L("Updated") }); } catch (System.Exception ex) { throw; } }
public async Task <bool> EditDiagnosisAsync(long id, EditDiagnosisInput input) { var record = await _diagnosisRepository.FirstOrDefaultAsync(x => x.Id == id); if (record == null) { return(false); } _mapper.Map(input, record); record.LastModifierUserId = GetCurrentUser(); await CurrentUnitOfWork.SaveChangesAsync(); return(true); }
public async Task <IActionResult> EditDiagnosisAsync(long id, [FromBody] EditDiagnosisInput input) { AppResponse <bool> response = await _systemLookupsService.EditDiagnosisAsync(id, input); return(Ok(response)); }