Exemple #1
0
        public async Task <ResultDto <Guid, MedicationCreateStatus> > Create(MedicationFollowupCreateRequest request)
        {
            try
            {
                var medicationfollowup = new MedicationFollowUp
                {
                    Id           = Guid.NewGuid(),
                    MedicationId = request.MedicationId,
                    Status       = (int)request.StatusType,
                    TakenDate    = request.TakenDate,
                    TakenTime    = request.TakenTime
                };

                var result = await _repository.Create(medicationfollowup);

                return(result);
            }
            catch (DbUpdateConcurrencyException)
            {
                return(new ResultDto <Guid, MedicationCreateStatus>(MedicationCreateStatus.InternalServerError));
            }
            catch (Exception ex)
            {
                return(new ResultDto <Guid, MedicationCreateStatus>(MedicationCreateStatus.InternalServerError));
            }
        }
        public async Task <ResultDto <Guid, MedicationCreateStatus> > Create(MedicationFollowUp medicationFollowup)
        {
            _repository.Insert(medicationFollowup);
            await _unitOfWork.SaveChangesAsync();

            return(new ResultDto <Guid, MedicationCreateStatus>(MedicationCreateStatus.Success, medicationFollowup.Id));
        }
Exemple #3
0
        public async Task <ResultDto <Guid, MedicationCreateStatus> > Create(MedicationFollowupCreateRequest request, string externalId, Guid MedicationId)
        {
            MedicationFollowUp medicationFollowup = new MedicationFollowUp
            {
                Id           = Guid.NewGuid(),
                MedicationId = MedicationId,
                Status       = (int)request.StatusType,
                TakenDate    = request.TakenDate,
                TakenTime    = request.TakenTime
            };
            var result = await _repository.Create(medicationFollowup);

            return(result);
        }