Beispiel #1
0
 public UserStatusObj(UserStatus status)
     : this()
 {
     if (status != null)
     {
         UserID = status.UserID;
         if (!String.IsNullOrWhiteSpace(status.Queue))
         {
             String[] queueStr = status.Queue.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
             foreach (String part in queueStr)
             {
                 int playerId = -1;
                 if (int.TryParse(part, out playerId))
                 {
                     DraftQueue.Add(playerId);
                 }
             }
         }
     }
 }
 private UserStatus GetOrCreateUserStatus(int userId)
 {
     UserStatus status = null;
     var query = from t in db.UserStatus
                 where t.UserID == userId && t.SeasonID == Settings.DraftSeasonID
                 select t;
     if (query.Count() > 0)
     {
         status = query.First();
     }
     else
     {
         status = new UserStatus()
         {
             UserID = userId,
             SeasonID = Settings.DraftSeasonID
         };
         db.UserStatus.InsertOnSubmit(status);
     }
     return status;
 }
 partial void DeleteUserStatus(UserStatus instance);
 partial void UpdateUserStatus(UserStatus instance);
 partial void InsertUserStatus(UserStatus instance);
		private void detach_UserStatus(UserStatus entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_UserStatus(UserStatus entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}