public EmployeeDto[] GetAll()
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var employeeDtos = new EmployeeDtoMapper().Map(_employeeRepository.GetCurrent().ToArray());
             transactionScope.Complete();
             return(employeeDtos);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }
 public ClientDto GetById(Guid id)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var clientDto = new ClientDtoMapper().Map(_clientRepository.GetById(id));
             transactionScope.Complete();
             return(clientDto);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }
Ejemplo n.º 3
0
 public LeadDto[] GetByIds(Guid[] ids)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var employeeDtos = new LeadDtoMapper().Map(_leadRepository.GetByIds(ids.ToList()).ToArray());
             transactionScope.Complete();
             return(employeeDtos);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }
 public AppointmentDto[] GetByEmployeeId(Guid employeeId)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var appointmentDtos = new AppointmentDtoMapper().Map(_appointmentRepository.GetByEmployeeId(employeeId).ToArray());
             transactionScope.Complete();
             return(appointmentDtos);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }
 public InstallmentDto GetById(Guid id)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var installmentDto = new InstallmentDtoMapper().MapWithAccount(_installmentRepository.GetById(id));
             transactionScope.Complete();
             return(installmentDto);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }
Ejemplo n.º 6
0
 public DepartmentDto GetByIdWithManager(Guid id)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var depatrtmentDto = new DepartmentDtoMapper().MapWithManager(_departmentRepository.GetById(id));
             transactionScope.Complete();
             return(depatrtmentDto);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }