예제 #1
0
파일: StateService.cs 프로젝트: onadebi/CRA
 public int AddState(StateContract state)
 {
     try
     {
         return _stateRepository.AddState(state);
     }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return 0;
     }
 }
예제 #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;
     }
 }
예제 #3
0
파일: StateService.cs 프로젝트: onadebi/CRA
 public bool UpdateState(StateContract state)
 {
     try
     {
         return _stateRepository.UpdateState(state);
         }
     catch (Exception ex)
     {
         ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
         return false;
     }
 }