Exemplo n.º 1
0
        public PoolViewModel CreatePool(PoolViewModel poolViewModel)
        {
            try
            {
                // TODO seems like redundant conversions here
                var entity = poolViewModel.ToPoolModel();
                _poolRepository.UpdateAndCommit(entity);

                _activityHelperService.CreateAddedPoolActivity(entity);

                return entity.ToPoolViewModel();
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
                return null;
            }
        }
Exemplo n.º 2
0
 // TODO think of join add and edit methods
 public void UpdatePool(PoolViewModel poolViewModel)
 {
     try
     {
         _poolRepository.UpdateAndCommit(poolViewModel.ToPoolModel());
     }
     catch (Exception ex)
     {
         _logger.Log(ex);
     }
 }
Exemplo n.º 3
0
 public bool IsPoolNameExistExceptCurrentPool(PoolViewModel pool)
 {
     try
     {
         return _poolRepository.Query().Any(p => (p.Name.ToLower() == pool.Name.ToLower() && p.Id != pool.Id));
     }
     catch (Exception ex)
     {
         _logger.Log(ex);
         return false;
     }
 }