Пример #1
0
 public int AddCarColor(CarColorContract carColor)
 {
     try
     {
         return _carColorRepository.AddCarColor(carColor);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Пример #2
0
 public int AddCarColor(CarColorContract carColor)
 {
     try
     {
         //Re-Map Object to Entity Object
         var myEntityObj = CarColorContractMapper.Map<CarColorContract, CarColor>(carColor);
         if(myEntityObj == null)
         {return -2;}
         var processedCarColor =  _repository.Add(myEntityObj);
         _uoWork.SaveChanges();
         return  processedCarColor.CarColorId;
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Пример #3
0
 public bool UpdateCarColor(CarColorContract carColor)
 {
     try
     {
         return _carColorRepository.UpdateCarColor(carColor);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }