Ejemplo n.º 1
0
        public async Task <AppResponse <long> > CreateMedicalVisitProcedureAsync(CreateMedicalVisitProcedureInput input)
        {
            bool isSurgeryExist = await _systemtLookupsManager.IsMedicalVisitProcedureExistAsync(input.Name);

            if (isSurgeryExist)
            {
                return new AppResponse <long>
                       {
                           IsSuccessful      = false,
                           StatusCode        = StatusCodes.ENTITY_ALREADY_EXIST,
                           StatusDescription = L("MedicalVisitProcedureExist")
                       }
            }
            ;

            long id = await _systemtLookupsManager.CreateMedicalVisitProcedureAsync(input);

            return(new AppResponse <long>
            {
                Data = id,
                IsSuccessful = true,
                StatusCode = StatusCodes.SUCCESS,
                StatusDescription = L("Created")
            });
        }
        public async Task <long> CreateMedicalVisitProcedureAsync(CreateMedicalVisitProcedureInput input)
        {
            var record = _mapper.Map <SystemMedicalVisitProcedure>(input);

            record.CreatorUserId = GetCurrentUser();

            await _medicalVisitProcedureRepository.InsertAsync(record);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(record.Id);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> CreateMedicalVisitProcedureAsync([FromBody] CreateMedicalVisitProcedureInput input)
        {
            AppResponse <long> response = await _systemLookupsService.CreateMedicalVisitProcedureAsync(input);

            return(Ok(response));
        }