Exemplo n.º 1
0
        public void Checkout(int occurrenceId, int personId)
        {
            var kiosk = new Arena.CheckIn.Kiosk();

            kiosk.CheckOut(occurrenceId, personId);

            /// If we checked out a leader, check to see if we need to close the occurrence
            var occurrence = new Arena.Core.Occurrence(occurrenceId);
            var occtype    = occurrence.OccurrenceType;

            if (occtype.MinLeaders != 0 || occtype.PeoplePerLeader != 0)
            {
                occurrence.PerformRoomRatioActions(Arena.Enums.CheckInAction.CheckOut, "ArenaOz");
            }
        }
Exemplo n.º 2
0
        public void Checkin(int personId, int occurrenceId, string securityCode, Arena.Enums.OccurrenceAttendanceType occurrenceAttendanceType)
        {
            var kiosk = new Arena.CheckIn.Kiosk();

            kiosk.CheckIn(
                new Arena.Core.Person(personId),
                new Arena.Core.Occurrence(occurrenceId),
                string.Empty,
                -1,
                securityCode,
                occurrenceAttendanceType);

            var occurrence = new Arena.Core.Occurrence(occurrenceId);
            var occtype    = occurrence.OccurrenceType;

            if (occtype.MinLeaders != 0 || occtype.PeoplePerLeader != 0)
            {
                occurrence.PerformRoomRatioActions(Arena.Enums.CheckInAction.CheckIn, "ArenaOz");
            }
        }
Exemplo n.º 3
0
        public void SetRoomCap(int locationId, int occurrenceId, int roomCap, bool includeLeaders)
        {
            /// save room cap
            var l = new Arena.Organization.Location(locationId);

            l.MaxPeople = roomCap;
            l.IncludeLeadersForMaxPeople = includeLeaders;
            l.Save("ArenaOz");

            /// Check if we need to close/open the locations occurrences
            ///
            List <Occurrence> locationOccurences = new List <Occurrence>();

            locationOccurences.AddRange(Occurrences.Where(x => x.LocationId == locationId));

            foreach (Occurrence o in locationOccurences)
            {
                var occurrence = new Arena.Core.Occurrence(o.Id);
                var occtype    = occurrence.OccurrenceType;

                if (occtype.UseRoomRatios)
                {
                    if (occtype.MinLeaders != 0 || occtype.PeoplePerLeader != 0)
                    {
                        occurrence.PerformRoomRatioActions(Arena.Enums.CheckInAction.CheckIn, "ArenaOz");
                    }
                    else
                    {
                        if (OccurrenceShouldBeClosed(roomCap, includeLeaders, occurrence.GetCurrentCount(Enums.OccurrenceAttendanceType.Person), occurrence.GetCurrentCount(Enums.OccurrenceAttendanceType.Leader)))
                        {
                            occurrence.OccurrenceClosed = true;
                        }
                        else
                        {
                            occurrence.OccurrenceClosed = false;
                        }
                        occurrence.Save("ArenaOz", false);
                    }
                }
            }
        }