Esempio n. 1
0
 public int AddState(StateContract state)
 {
     try
     {
         return _stateRepository.AddState(state);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Esempio n. 2
0
 public int AddState(StateContract state)
 {
     try
     {
         //Re-Map Object to Entity Object
         var myEntityObj = StateContractMapper.Map<StateContract, State>(state);
         if(myEntityObj == null)
         {return -2;}
         var processedState =  _repository.Add(myEntityObj);
         _uoWork.SaveChanges();
         return  processedState.StateId;
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
Esempio n. 3
0
 public bool UpdateState(StateContract state)
 {
     try
     {
         return _stateRepository.UpdateState(state);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }