Exemplo n.º 1
0
        protected void btnCancelReseration_Click(object sender, EventArgs e)
        {
            var mobileCheckinRecord = MobileCheckinRecordCache.GetActiveByFamilyGroupId(currentPerson.PrimaryFamilyId ?? 0);

            if (mobileCheckinRecord == null)
            {
                string kioskName = currentUser.UserName;
                mobileCheckinRecord = MobileCheckinRecordCache.GetActiveByUserName(kioskName);
            }

            if (mobileCheckinRecord != null)
            {
                MobileCheckinRecordCache.CancelReservation(mobileCheckinRecord, true);
            }
            NavigateToCurrentPage();
        }
Exemplo n.º 2
0
        private void UpdateView()
        {
            pnlQr.Visible           = false;
            pnlLoading.Visible      = false;
            pnlPostCheckin.Visible  = false;
            pnlSelectCampus.Visible = false;

            if (currentUser == null)
            {
                ltError.Text     = GetAttributeValue(AttributeKeys.NotLoggedInMessage);
                pnlError.Visible = true;
                return;
            }

            string kioskName = currentUser.UserName;

            var mobileCheckinRecord = MobileCheckinRecordCache.GetActiveByFamilyGroupId(currentPerson.PrimaryFamilyId ?? 0);

            if (mobileCheckinRecord == null)
            {
                mobileCheckinRecord = MobileCheckinRecordCache.GetActiveByUserName(kioskName);
            }

            if (mobileCheckinRecord != null)
            {
                ShowQRCode(mobileCheckinRecord);
                return;
            }
            else
            {
                var completeMobileCheckins = MobileCheckinRecordCache.All()
                                             .Where(r => r.FamilyGroupId == currentPerson.PrimaryFamilyId && r.Status == MobileCheckinStatus.Complete)
                                             .SelectMany(r => r.AttendanceIds)
                                             .Select(i => AttendanceCache.Get(i))
                                             .Where(a => a.AttendanceState != AttendanceState.CheckedOut)
                                             .Any();
                if (completeMobileCheckins)
                {
                    ShowCheckinCompletion();
                    return;
                }
            }

            ConfigureForUser(kioskName);

            pnlSelectCampus.Visible = true;
        }