コード例 #1
0
        protected void gKioskType_Delete(object sender, RowEventArgs e)
        {
            var checkinContext = new RockContext();
            KioskTypeService KioskTypeService = new KioskTypeService(checkinContext);
            KioskType        KioskType        = KioskTypeService.Get(e.RowKeyId);

            if (KioskType != null)
            {
                int kosktypeId = KioskType.Id;

                string errorMessage;
                if (!KioskTypeService.CanDelete(KioskType, out errorMessage))
                {
                    mdGridWarning.Show(errorMessage, ModalAlertType.Information);
                    return;
                }

                KioskTypeService.Delete(KioskType);
                checkinContext.SaveChanges();

                Rock.CheckIn.KioskDevice.FlushAll();
            }

            BindGrid();
        }
コード例 #2
0
        private void BindDropDownList(KioskType kioskType = null)
        {
            RockContext      rockContext      = new RockContext();
            GroupTypeService groupTypeService = new GroupTypeService(rockContext);
            Guid             templateTypeGuid = Rock.SystemGuid.DefinedValue.GROUPTYPE_PURPOSE_CHECKIN_TEMPLATE.AsGuid();

            ddlTemplates.DataSource = groupTypeService
                                      .Queryable().AsNoTracking()
                                      .Where(t =>
                                             t.GroupTypePurposeValue != null &&
                                             t.GroupTypePurposeValue.Guid == templateTypeGuid)
                                      .OrderBy(t => t.Name)
                                      .Select(t => new
            {
                t.Name,
                t.Id
            })
                                      .ToList();
            ddlTemplates.DataBind();
            if (kioskType != null)
            {
                ddlTemplates.SetValue(kioskType.CheckinTemplateId);
            }
            BindGroupTypes(kioskType);
        }
コード例 #3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (CurrentCheckInState == null)
            {
                LogException(new CheckInStateLost("Lost check-in state on init"));
                NavigateToPreviousPage();
                return;
            }

            if (Session["KioskTypeId"] != null)
            {
                int kioskTypeId = ( int )Session["KioskTypeId"];
                KioskType = new KioskTypeService(new RockContext()).Get(kioskTypeId);
                if (KioskType == null)
                {
                    NavigateToPreviousPage();
                    return;
                }
            }
            else
            {
                NavigateToPreviousPage();
                return;
            }

            RockPage.AddScriptLink("~/scripts/jquery.plugin.min.js");
            RockPage.AddScriptLink("~/scripts/jquery.countdown.min.js");

            RegisterScript();
        }
コード例 #4
0
        private void BindGroupTypes(KioskType kioskType = null)
        {
            var groupTypeIds = new List <string>();

            if (kioskType != null)
            {
                groupTypeIds.AddRange(kioskType.GroupTypes.Select(gt => gt.Id.ToString()).ToList());
            }
            else
            {
                foreach (ListItem item in cblPrimaryGroupTypes.Items)
                {
                    if (item.Selected)
                    {
                        groupTypeIds.Add(item.Value);
                    }
                }
            }

            BindGroupTypes(groupTypeIds.AsDelimited(","));
        }
コード例 #5
0
        private void VerifyStatusInAttendeeReport(KioskType type)
        {
            ManagerSiteMgr.SelectManagerWindow();
            this.eventSessionId = ManagerSiteMgr.Login();
            ManagerSiteMgr.OpenEventDashboardUrl(this.eventId, this.eventSessionId);
            ManagerSiteMgr.DashboardMgr.OpenAttendeeReportFromEventDashboard();

            switch (type)
            {
                case KioskType.SearchReg:

                    for (int index = 0; index < this.regs.Count; index++)
                    {
                        if (index == 2)
                        {
                            ReportMgr.VerifyRegistrationStatusOnAttendeeReport(
                                this.regs[index].regId,
                                ReportManager.AttendeeStatus.Confirmed);
                        }
                        else
                        {
                            ReportMgr.VerifyRegistrationStatusOnAttendeeReport(
                                this.regs[index].regId,
                                ReportManager.AttendeeStatus.Attended);
                        }
                    }

                    break;

                case KioskType.RequirePassword:
                case KioskType.UpdateProfile:
                case KioskType.RequirePaidInFull:
                case KioskType.AllowOnSiteReg:

                    ReportMgr.VerifyRegistrationStatusOnAttendeeReport(
                        this.regs[0].regId,
                        ReportManager.AttendeeStatus.Attended);

                    break;

                case KioskType.AllowGroupCheckin:

                    for (int index = 0; index < this.regs.Count; index++)
                    {
                        ReportMgr.VerifyRegistrationStatusOnAttendeeReport(
                            this.regs[index].regId,
                            ReportManager.AttendeeStatus.Attended);
                    }

                    break;

                default:
                    break;
            }

            ReportMgr.CloseReportPopupWindow();
            ManagerSiteMgr.SelectManagerWindow();
            ManagerSiteMgr.DashboardMgr.ReturnToList();
        }
コード例 #6
0
        private void KioskTest(KioskType type)
        {
            this.eventSessionId = this.helper.Login();
            ManagerSiteMgr.OpenEventDashboardUrl(this.eventId, this.eventSessionId);
            ManagerSiteMgr.DashboardMgr.ChangeStatusIfNecessary(DashboardManager.EventStatus.OnSite);

            switch (type)
            {
                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : false
                /// Require paid in full - AllowCC/DisplayMessage            : false
                /// Require authentication                                   : false
                /// Allow on-site registrations                              : false
                /// Allow registrations to update profile                    : false
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                ///
                /// We're not able to handle badge for the moment, so do not allow to print badge
                /// </summary>
                case KioskType.SearchReg:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, false, false, null, false, false, false, true, false);

                    RegisterMgr.KioskSearch(this.regs[0].emailAddress);
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    // If searched with registration id, the registrant will be checked in immediately,
                    // you don't have to call 'RegisterMgr.KioskClickCheckinReg();'
                    RegisterMgr.KioskSearch(this.regs[1].regId.ToString());

                    RegisterMgr.FinishCheckin();
                    RegisterMgr.KioskSearch(this.regs[2].fullName);
                    RegisterMgr.KioskClickNewSearch();
                    RegisterMgr.KioskSearch(this.regs[3].fullName);
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : false
                /// Require paid in full - AllowCC/DisplayMessage            : false
                /// Require authentication                                   : true
                /// Allow on-site registrations                              : false
                /// Allow registrations to update profile                    : false
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                /// </summary>
                case KioskType.RequirePassword:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, false, false, null, true, false, false, true, false);

                    RegisterMgr.KioskSearch(this.regs[0].emailAddress);
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskClickNewSearch();
                    RegisterMgr.KioskSearch(this.regs[0].emailAddress);
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : false
                /// Require paid in full - AllowCC/DisplayMessage            : false
                /// Require authentication                                   : true
                /// Allow on-site registrations                              : false
                /// Allow registrations to update profile                    : true
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                /// </summary>
                case KioskType.UpdateProfile:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, false, false, null, true, false, true, true, false);

                    RegisterMgr.KioskSearch(this.regs[0].regId.ToString());
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskClickChangeIndividualRegistrationInfo(this.regs[0].emailAddress);
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.FirstName, "First Name");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.LastName, "Last Name");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.Address1, "Address1");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.City, "City");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.State, "Idaho");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.Zip, "83712");
                    RegisterMgr.KioskUpdateRegistrationInfo(RegisterManager.KioskPersonalInfo.Company, "Company");
                    RegisterMgr.KioskSaveUpdate();
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : true
                /// Require paid in full - AllowCC/DisplayMessage            : false/true
                /// Require authentication                                   : true
                /// Allow on-site registrations                              : false
                /// Allow registrations to update profile                    : true
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                /// </summary>
                case KioskType.RequirePaidInFull:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, true, false, PaidInFullMessage, true, false, true, true, false);

                    RegisterMgr.KioskSearch(this.regs[0].fullName);
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.GetPaidInFullMessage();

                    UIUtil.DefaultProvider.ClosePopUpWindow();

                    this.eventSessionId = this.helper.Login();
                    ManagerSiteMgr.OpenEventDashboardUrl(this.eventId, this.eventSessionId);

                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, true, true, null, true, true, true, true, false);
                    RegisterMgr.KioskSearch(this.regs[0].fullName);
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskEnterCCInfoToPayInFull();
                    RegisterMgr.KioskClickMakePaymentButton();
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : true
                /// Require paid in full - AllowCC/DisplayMessage            : true
                /// Require authentication                                   : true
                /// Allow on-site registrations                              : true
                /// Allow registrations to update profile                    : true
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                /// </summary>
                case KioskType.AllowOnSiteReg:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, true, true, PaidInFullMessage, true, true, true, true, false);

                    RegisterMgr.KioskStartOnsiteRegistration();
                    this.KioskUpdateWithStartOver();
                    RegisterMgr.KioskStartOnsiteRegistration();
                    this.KioskUpdateReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                /// <summary>
                /// Enable barcode scanning / search by Registration ID      : true
                /// Require registrants to be paid in full prior to check-in : true
                /// Require paid in full - AllowCC/DisplayMessage            : true
                /// Require authentication                                   : true
                /// Allow on-site registrations                              : true
                /// Allow registrations to update profile                    : true
                /// Allow group check-in                                     : true
                /// Allow on-site badge printing                             : false
                /// </summary>
                case KioskType.AllowGroupCheckin:
                    ManagerSiteMgr.DashboardMgr.LaunchKiosk(true, true, true, PaidInFullMessage, true, true, true, true, false);

                    RegisterMgr.KioskSearch(this.regs[0].regId.ToString());
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskUnselectGroupMemberToCheckin(this.regs[2].emailAddress);
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    RegisterMgr.KioskSearch(this.regs[2].regId.ToString());
                    RegisterMgr.KioskEnterPassword();
                    RegisterMgr.KioskClickCheckinReg();
                    RegisterMgr.FinishCheckin();

                    UIUtil.DefaultProvider.ClosePopUpWindow();
                    break;

                default:
                    break;
            }
        }
コード例 #7
0
        private void CreateRegistrations(KioskType type)
        {
            this.regs = new List<OnSiteFixtureHelper.RegistrationInfo>();

            switch (type)
            {
                case KioskType.SearchReg:

                    for (int i = 0; i < 4; i++)
                    {
                        this.SingleRegistration(RegisterManager.PaymentMethod.CreditCard, 20.00);
                    }

                    break;

                case KioskType.RequirePassword:
                    this.SingleRegistration(RegisterManager.PaymentMethod.CreditCard, 20.00);
                    break;

                case KioskType.UpdateProfile:
                    this.SingleRegistration(RegisterManager.PaymentMethod.CreditCard, 20.00);
                    break;

                case KioskType.RequirePaidInFull:
                    this.SingleRegistration(RegisterManager.PaymentMethod.Check, 20.00);
                    break;

                case KioskType.AllowOnSiteReg:
                    this.SingleRegistration(RegisterManager.PaymentMethod.CreditCard, 20.00);
                    break;

                case KioskType.AllowGroupCheckin:
                    this.GroupRegistration();
                    break;

                default:
                    break;
            }
        }
コード例 #8
0
        /// <summary>
        /// Shows the edit.
        /// </summary>
        /// <param name="DeviceId">The device identifier.</param>
        public void ShowDetail(int KioskTypeId)
        {
            pnlDetails.Visible = true;
            KioskType KioskType = null;

            var checkinContext = new RockContext();

            if (!KioskTypeId.Equals(0))
            {
                KioskType         = new KioskTypeService(checkinContext).Get(KioskTypeId);
                lActionTitle.Text = ActionTitle.Edit(KioskType.FriendlyTypeName).FormatAsHtmlTitle();
            }

            if (KioskType == null)
            {
                KioskType = new KioskType {
                    Id = 0
                };
                lActionTitle.Text = ActionTitle.Add(KioskType.FriendlyTypeName).FormatAsHtmlTitle();
            }

            hfKioskTypeId.Value = KioskType.Id.ToString();

            tbName.Text        = KioskType.Name;
            tbDescription.Text = KioskType.Description;
            tbMessage.Text     = KioskType.Message;

            Locations = new Dictionary <int, string>();
            foreach (var location in KioskType.Locations)
            {
                string path           = location.Name;
                var    parentLocation = location.ParentLocation;
                while (parentLocation != null)
                {
                    path           = parentLocation.Name + " > " + path;
                    parentLocation = parentLocation.ParentLocation;
                }
                Locations.Add(location.Id, path);
            }

            Schedules = new Dictionary <int, string>();
            foreach (var schedule in KioskType.Schedules)
            {
                Schedules.Add(schedule.Id, schedule.Name);
            }

            BindDropDownList(KioskType);
            BindLocations();
            BindSchedules();

            // render UI based on Authorized and IsSystem
            bool readOnly = false;

            nbEditModeMessage.Text = string.Empty;
            if (!IsUserAuthorized(Authorization.EDIT))
            {
                readOnly = true;
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed(KioskType.FriendlyTypeName);
            }

            if (readOnly)
            {
                lActionTitle.Text = ActionTitle.View(KioskType.FriendlyTypeName);
                btnCancel.Text    = "Close";
            }

            tbName.ReadOnly        = readOnly;
            tbDescription.ReadOnly = readOnly;

            btnSave.Visible = !readOnly;
        }
コード例 #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            KioskType KioskType = null;

            var rockContext      = new RockContext();
            var kioskTypeService = new KioskTypeService(rockContext);
            var attributeService = new AttributeService(rockContext);
            var locationService  = new LocationService(rockContext);
            var scheduleService  = new ScheduleService(rockContext);
            var groupTypeService = new GroupTypeService(rockContext);

            int KioskTypeId = int.Parse(hfKioskTypeId.Value);

            if (KioskTypeId != 0)
            {
                KioskType = kioskTypeService.Get(KioskTypeId);
            }

            if (KioskType == null)
            {
                KioskType = new KioskType();
                kioskTypeService.Add(KioskType);
            }

            if (KioskType != null)
            {
                KioskType.Name        = tbName.Text;
                KioskType.Description = tbDescription.Text;
                KioskType.Message     = tbMessage.Text;

                if (!KioskType.IsValid || !Page.IsValid)
                {
                    // Controls will render the error messages
                    return;
                }

                // Remove any deleted locations
                foreach (var location in KioskType.Locations
                         .Where(l =>
                                !Locations.Keys.Contains(l.Id))
                         .ToList())
                {
                    KioskType.Locations.Remove(location);
                }

                // Remove any deleted schedules
                foreach (var schedule in KioskType.Schedules
                         .Where(s =>
                                !Schedules.Keys.Contains(s.Id))
                         .ToList())
                {
                    KioskType.Schedules.Remove(schedule);
                }

                // Add any new locations
                var existingLocationIDs = KioskType.Locations.Select(l => l.Id).ToList();
                foreach (var location in locationService.Queryable()
                         .Where(l =>
                                Locations.Keys.Contains(l.Id) &&
                                !existingLocationIDs.Contains(l.Id)))
                {
                    KioskType.Locations.Add(location);
                }

                // Add any new schedules
                var existingScheduleIDs = KioskType.Schedules.Select(s => s.Id).ToList();
                foreach (var schedule in scheduleService.Queryable()
                         .Where(s =>
                                Schedules.Keys.Contains(s.Id) &&
                                !existingScheduleIDs.Contains(s.Id)))
                {
                    KioskType.Schedules.Add(schedule);
                }

                //Save checkin template
                KioskType.CheckinTemplateId = ddlTemplates.SelectedValue.AsInteger();


                var GroupTypes = KioskType.GroupTypes;
                GroupTypes.Clear();

                foreach (ListItem item in cblPrimaryGroupTypes.Items)
                {
                    if (item.Selected)
                    {
                        GroupTypes.Add(groupTypeService.Get(item.Value.AsInteger()));
                    }
                }

                rockContext.SaveChanges();

                Rock.CheckIn.KioskDevice.FlushAll();

                NavigateToParentPage();
            }
        }