Exemplo n.º 1
0
        public bool ReserveDropinSpot(Pool pool, Game game, Player player)
        {
            Pickup dropin = game.Dropins.FindByPlayerId(player.Id);

            //Add pickup if it is not regular dropin player
            if (dropin == null)
            {
                dropin        = new Pickup(player.Id);
                dropin.Status = InOutNoshow.Out;
                dropin.IsCoop = true;
                game.Dropins.Add(dropin);
            }
            if (dropin != null && dropin.Status == InOutNoshow.Out)
            {
                dropin.Status = InOutNoshow.In;
                //Create fee
                CostReference reference = CreateDropinFee(pool, game.Date, player.Id);
                dropin.CostReference = reference;
                if (CurrentUser != null)
                {
                    dropin.OperatorId = CurrentUser.Id;
                }
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public void CancelPromarySpot(Pool pool, Game game, Player player)
        {
            Attendee attendee = game.Members.FindByPlayerId(player.Id);

            //Cancel spots for members
            if (attendee != null && attendee.Status != InOutNoshow.Out)
            {
                attendee.Status = InOutNoshow.Out;
                if (!Manager.ClubMemberMode)
                {
                    Transfer transfer = new Transfer(game.Date);
                    player.Transfers.Add(transfer);
                    CostReference costRef = new CostReference(CostType.TRANSFER, transfer.TransferId);
                    attendee.CostReference = costRef;
                }
                //Log and save
                //LogHistory log = CreateLog(Manager.EastDateTimeNow, game.Date, GetUserIP(), pool.Name, player.Name, "Cancel member");
                //Manager.Logs.Add(log);
                //Assgin a spot to the first one on waiting list
                if (!IsReservationLocked(game.Date) && game.WaitingList.Count > 0 && IsSpotAvailable(pool, game.Date))
                {
                    //AssignDropinSpotToWaiting(pool, game);
                }
                DataAccess.Save(Manager);
                return;
            }
        }
Exemplo n.º 3
0
 public Pickup(String playerId, CostReference costReference)
 {
     this.playerId      = playerId;
     this.costReference = costReference;
 }