Ejemplo n.º 1
0
 public int AddCountry(CountryContract country)
 {
     try
     {
         return _countryRepository.AddCountry(country);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Ejemplo n.º 2
0
 public int AddCountry(CountryContract country)
 {
     try
     {
         //Re-Map Object to Entity Object
         var myEntityObj = CountryContractMapper.Map<CountryContract, Country>(country);
         if(myEntityObj == null)
         {return -2;}
         var processedCountry =  _repository.Add(myEntityObj);
         _uoWork.SaveChanges();
         return  processedCountry.CountryId;
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Ejemplo n.º 3
0
 public bool UpdateCountry(CountryContract country)
 {
     try
     {
         return _countryRepository.UpdateCountry(country);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }