Exemplo n.º 1
0
 public bool AddAwardToUser(int userID, int awardID)
 {
     if (userID < 1 || awardID < 1)
     {
         throw new ArgumentException("ID can't be less than 1");
     }
     if (!userDao.Contains(userID))
     {
         throw new ArgumentException("Can't find user with such ID");
     }
     if (!awardDao.Contains(awardID))
     {
         throw new ArgumentException("Can't find award with such ID");
     }
     if (userDao.AddUserAward(userID, awardID))
     {
         return(true);
     }
     throw new InvalidOperationException("on user's award saving");
 }