Exemplo n.º 1
0
 public int AddCarModel(CarModelContract carModel)
 {
     try
     {
         return _carModelRepository.AddCarModel(carModel);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Exemplo n.º 2
0
 public int AddCarModel(CarModelContract carModel)
 {
     try
     {
         //Re-Map Object to Entity Object
         var myEntityObj = CarModelContractMapper.Map<CarModelContract, CarModel>(carModel);
         if(myEntityObj == null)
         {return -2;}
         var processedCarModel =  _repository.Add(myEntityObj);
         _uoWork.SaveChanges();
         return  processedCarModel.CarModelId;
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Exemplo n.º 3
0
 public bool UpdateCarModel(CarModelContract carModel)
 {
     try
     {
         return _carModelRepository.UpdateCarModel(carModel);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }