Пример #1
0
        /// <summary>
        /// Refreshes the checkin status information.
        /// </summary>
        /// <param name="checkinStatus">The checkin status.</param>
        private void RefreshCheckinStatusInformation(Rock.CheckIn.CheckinConfigurationHelper.CheckinStatus checkinStatus)
        {
            if (checkinStatus != CheckinConfigurationHelper.CheckinStatus.Active)
            {
                bbtnTryAgain.Visible       = true;
                bbtnCheckin.Visible        = false;
                lCheckinQRCodeHtml.Visible = false;
            }

            switch (checkinStatus)
            {
            case CheckinConfigurationHelper.CheckinStatus.Inactive:
            {
                lMessage.Text = GetMessageText(AttributeKey.NoScheduledDevicesAvailableTemplate);
                break;
            }

            case CheckinConfigurationHelper.CheckinStatus.TemporarilyClosed:
            {
                DateTime activeAt = DateTime.MaxValue;
                if (CurrentCheckInState != null && CurrentCheckInState.Kiosk != null)
                {
                    activeAt = CurrentCheckInState.Kiosk.FilteredGroupTypes(CurrentCheckInState.ConfiguredGroupTypes).Select(g => g.NextActiveTime).Min();
                }

                if (activeAt == DateTime.MaxValue)
                {
                    lMessage.Text = GetMessageText(AttributeKey.NoScheduledDevicesAvailableTemplate);
                }
                else
                {
                    lMessage.Text = GetMessageText(AttributeKey.NoScheduledDevicesAvailableTemplate);
                }

                break;
            }

            case CheckinConfigurationHelper.CheckinStatus.Closed:
            {
                lMessage.Text = GetMessageText(AttributeKey.NoScheduledDevicesAvailableTemplate);
                break;
            }

            case CheckinConfigurationHelper.CheckinStatus.Active:
            default:
            {
                lMessage.Text = GetMessageText(AttributeKey.WelcomeBackTemplate);
                var attendanceSessionGuidCookie = RockPage.GetCookie(CheckInCookieKey.AttendanceSessionGuids);
                var qrCodeImageUrl = GetAttendanceSessionsQrCodeImageUrl(attendanceSessionGuidCookie);
                if (qrCodeImageUrl.IsNotNullOrWhiteSpace())
                {
                    lCheckinQRCodeHtml.Text    = string.Format("<h6 class='text-center mt-4 mb-1'>Scan Code For Labels</h6><div class='qr-code-container'><img class='img-responsive qr-code' src='{0}' alt='Check-in QR Code' width='500' height='500'></div>", qrCodeImageUrl);
                    lCheckinQRCodeHtml.Visible = true;
                    bbtnCheckin.Text           = "Check-in Additional Individuals";
                }
                else
                {
                    lCheckinQRCodeHtml.Visible = false;
                }

                bbtnCheckin.Visible  = true;
                bbtnTryAgain.Visible = false;
                break;
            }
            }
        }