public async Task <AppResponse <long> > CreateAllergicAsync(CreateAllergicInput input) { bool isSurgeryExist = await _systemtLookupsManager.IsAllergicExistAsync(input.Name); if (isSurgeryExist) { return new AppResponse <long> { IsSuccessful = false, StatusCode = StatusCodes.ENTITY_ALREADY_EXIST, StatusDescription = L("AllergicExist") } } ; long id = await _systemtLookupsManager.CreateAllergicAsync(input); return(new AppResponse <long> { Data = id, IsSuccessful = true, StatusCode = StatusCodes.SUCCESS, StatusDescription = L("Created") }); }
public async Task <long> CreateAllergicAsync(CreateAllergicInput input) { var record = _mapper.Map <SystemAllergic>(input); record.CreatorUserId = GetCurrentUser(); await _allergicRepository.InsertAsync(record); await CurrentUnitOfWork.SaveChangesAsync(); return(record.Id); }
public async Task <IActionResult> CreateAllergicAsync([FromBody] CreateAllergicInput input) { AppResponse <long> response = await _systemLookupsService.CreateAllergicAsync(input); return(Ok(response)); }