Beispiel #1
0
 /// <summary>
 /// validates the name of the game
 /// </summary>
 public void ValidateName(string name)
 {
     if (BLL_Helper.IsGameWithNameStarting(name))
     {
         throw new Exception("A game with that name already exists");
     }
     if (string.IsNullOrWhiteSpace(name))
     {
         throw new Exception("game needs to have a name");
     }
 }
Beispiel #2
0
 /// <summary>
 /// user constructor which inserts a new user into user table using details
 /// </summary>
 public User(string username, UserType type, string email, DateTime BirthDate, string fName, string lName, string password)
 {
     _level         = 1;
     _xp            = 0;
     this.BirthDate = BirthDate;
     this.fName     = fName;
     this.lName     = lName;
     this.type      = type;
     this.username  = username;
     if (BLL_Helper.UserExists(username))
     {
         throw new Exception("A user with that username already exists");
     }
     DAL.UserDal.AddUser(email, password, (int)type, fName, lName, BirthDate, username);
     RankingHistoryDal.InsertRankHistory(username, BLL_Helper.GetCurrentSeason().SeasonID, InitailElo);
 }