public void SchedulingRepository_Delete_ShouldBeOk()
        {
            Scheduling scheduling = _repository.Get(1);

            _repository.Delete(scheduling);
            Scheduling result = _repository.Get(1);

            result.Should().BeNull();
        }
Beispiel #2
0
        public void SchedulingSqlRepository_Delete_ShouldBeOk()
        {
            //Cenário
            Scheduling scheduling = _repository.Get(1);

            //Ação
            _repository.Delete(scheduling);

            //Verifica
            Scheduling result = _repository.Get(1);

            result.Should().BeNull();
        }
Beispiel #3
0
        public DeleteToDoByPatientIdDataResponse DeleteToDoByPatientId(DeleteToDoByPatientIdDataRequest request)
        {
            DeleteToDoByPatientIdDataResponse response = new DeleteToDoByPatientIdDataResponse();

            try
            {
                ISchedulingRepository repo = Factory.GetRepository(request, RepositoryType.ToDo);
                GetToDosDataRequest   getToDosDataRequest = new GetToDosDataRequest
                {
                    PatientId      = request.PatientId,
                    Context        = request.Context,
                    ContractNumber = request.ContractNumber,
                    UserId         = request.UserId,
                    Version        = request.Version
                };
                GetToDosDataResponse toDosResponse = repo.FindToDos(getToDosDataRequest);
                List <ToDoData>      patientToDos  = (List <ToDoData>)toDosResponse.ToDos; //repo.FindToDos(getToDosDataRequest);
                List <string>        deletedIds    = null;
                if (patientToDos != null)
                {
                    deletedIds = new List <string>();
                    patientToDos.ForEach(u =>
                    {
                        request.Id = u.Id;
                        repo.Delete(request);
                        deletedIds.Add(request.Id);
                    });
                    response.DeletedIds = deletedIds;
                }
                response.Success = true;
                return(response);
            }
            catch (Exception ex) { throw ex; }
        }
Beispiel #4
0
 public void Delete(Scheduling scheduling)
 {
     if (scheduling.Id < 1)
     {
         throw new IdentifierUndefinedException();
     }
     _repository.Delete(scheduling);
 }
Beispiel #5
0
        public bool Delete(Guid key)
        {
            if (Get(key) == null)
            {
                throw new NotFoundException("Scheduling not found");
            }

            try
            {
                return(_schedulingRepository.Delete(key));
            }
            catch (Exception ex)
            {
                throw new InternalServerErrorException($"Not was possible delete the Scheduling: {ex.Message}");
            }
        }
 public void Delete(long id)
 {
     _schedulingRepository.Delete(id);
 }
 public void DeleteScheduling(Scheduling Scheduling)
 {
     _schedulingRepository.Delete(Scheduling);
 }