Esempio n. 1
0
 public void AddAwardToUser(int id, IEnumerable <string> titles)
 {
     try
     {
         _userDao.AddAwardToUser(id, titles);
     }
     catch (ArgumentException ar)
     {
         Console.WriteLine("No user found with this ID.");
     }
 }
Esempio n. 2
0
        public bool SaveAwardToUser(int userID, int awardID)
        {
            var user  = userDao.GetUserByID(userID);
            var award = awardDao.GetAwardByID(awardID);

            if (user == null || award == null)
            {
                return(false);
            }
            else if (user.Awards != null && user.Awards.Contains(award))
            {
                return(false);
            }
            else
            {
                return(userDao.AddAwardToUser(userID, awardID));
            }
        }