Exemple #1
0
 public bool InsertAward(string userId, AwardDto award)
 {
     try
     {
         //Validate user
         if (_userRepository.IsAuthenticated(userId))
         {
             //Validate Model
             ICollection <ValidationResult> results;
             if (IsValidModel(award, out results))
             {
                 //Call Repository
                 if (_awardRepository.InsertAward(award))
                 {
                     //Save
                     if (_awardRepository.Save())
                     {
                         //Success
                         return(true);
                     }
                     _loggingService.Info("Failed To Save");
                 }
                 _loggingService.Info("UserRepository Failed Insert");
             }
             _loggingService.Info("Model Validation Failed: " + award);
         }
         _loggingService.Info("UserId Authenticated Failed: " + userId);
     }
     catch (Exception ex)
     {
         //Error
         _loggingService.Error("An error has occurred", ex);
     }
     //Fail
     return(false);
 }