public Reserve GetById(Guid idOfReserve) { try { Reserve reserve = reserveRepository.Get(idOfReserve); return(reserve); } catch (ClientException e) { throw new ClientBusinessLogicException(MessageExceptionBusinessLogic.ErrorNotFindReserve, e); } catch (ServerException e) { throw new ServerBusinessLogicException(MessageExceptionBusinessLogic.ErrorObteinedReserve, e); } }
public Reserve Update(Guid id, Reserve aReserve) { try { Reserve reserveOfDb = reserveRepository.Get(id); reserveOfDb.UpdateAttributes(aReserve); reserveOfDb.VerifyFormat(); reserveRepository.Update(reserveOfDb); return(reserveOfDb); } catch (ReserveException e) { throw new DomainBusinessLogicException(e.Message); } catch (ClientException e) { throw new ClientBusinessLogicException(MessageExceptionBusinessLogic.ErrorUpdatingReserveNotFound, e); } catch (ServerException e) { throw new ServerBusinessLogicException(MessageExceptionBusinessLogic.ErrorUpdatingReserve, e); } }