Example #1
1
 public long AddRentalService(RentalServiceContract rentalService)
 {
     try
     {
         return _rentalServiceRepository.AddRentalService(rentalService);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Example #2
1
 public long AddRentalService(RentalServiceContract rentalService)
 {
     try
     {
         //Re-Map Object to Entity Object
         var myEntityObj = RentalServiceContractMapper.Map<RentalServiceContract, RentalService>(rentalService);
         if(myEntityObj == null)
         {return -2;}
         var processedRentalService =  _repository.Add(myEntityObj);
         _uoWork.SaveChanges();
         return  processedRentalService.RentalServiceId;
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Example #3
1
 public bool UpdateRentalService(RentalServiceContract rentalService)
 {
     try
     {
         return _rentalServiceRepository.UpdateRentalService(rentalService);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }