Ejemplo n.º 1
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack && CurrentCheckInState != null)
            {
                if (!string.IsNullOrWhiteSpace(CurrentCheckInState.CheckIn.SearchValue))
                {
                    tbSearchBox.Text = CurrentCheckInState.CheckIn.SearchValue;
                }

                string script = string.Format(@"
            <script>
                $(document).ready(function (e) {{
                    if (localStorage) {{
                        localStorage.checkInKiosk = '{0}';
                        localStorage.checkInGroupTypes = '{1}';
                    }}
                }});
            </script>
            ", CurrentKioskId, CurrentGroupTypeIds.AsDelimited(","));
                phScript.Controls.Add(new LiteralControl(script));

                if (GetAttributeValue("ShowKeyPad").AsBoolean())
                {
                    pnlKeyPad.Visible = true;
                }

                tbSearchBox.Focus();
            }
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack && CurrentCheckInState != null)
            {
                string script = string.Format(@"
    <script>
        $(document).ready(function (e) {{
            if (localStorage) {{
                localStorage.theme = '{0}'
                localStorage.checkInKiosk = '{1}';
                localStorage.checkInType = '{2}';
                localStorage.checkInGroupTypes = '{3}';
            }}
        }});
    </script>
", CurrentTheme, CurrentKioskId, CurrentCheckinTypeId, CurrentGroupTypeIds.AsDelimited(","));
                phScript.Controls.Add(new LiteralControl(script));

                CurrentWorkflow             = null;
                CurrentCheckInState.CheckIn = new CheckInStatus();
                SaveState();
                RefreshView();
            }
        }
Ejemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack)
            {
                if (CurrentCheckInState != null)
                {
                    string script = string.Format(@"
    <script>
        $(document).ready(function (e) {{
            if (localStorage) {{
                localStorage.theme = '{0}'
                localStorage.checkInKiosk = '{1}';
                localStorage.checkInType = '{2}';
                localStorage.checkInGroupTypes = '{3}';
            }}
        }});
    </script>
", CurrentTheme, CurrentKioskId, CurrentCheckinTypeId, CurrentGroupTypeIds.AsDelimited(","));
                    phScript.Controls.Add(new LiteralControl(script));

                    CurrentWorkflow             = null;
                    CurrentCheckInState.CheckIn = new CheckInStatus();
                    SaveState();
                    RefreshView();

                    lNotActiveTitle.Text      = GetAttributeValue("NotActiveTitle");
                    lNotActiveCaption.Text    = GetAttributeValue("NotActiveCaption");
                    lNotActiveYetTitle.Text   = GetAttributeValue("NotActiveYetTitle");
                    lNotActiveYetCaption.Text = string.Format(GetAttributeValue("NotActiveYetCaption"), "<span class='countdown-timer'></span>");
                    lClosedTitle.Text         = GetAttributeValue("ClosedTitle");
                    lClosedCaption.Text       = GetAttributeValue("ClosedCaption");

                    string btnText = GetAttributeValue("CheckinButtonText");
                    if (string.IsNullOrWhiteSpace(btnText))
                    {
                        btnText = CurrentCheckInState.CheckInType.AllowCheckout ? "Start" : "Check In";
                    }
                    lbSearch.Text = string.Format("<span>{0}</span>", btnText);
                }
            }
            else
            {
                if (Request.Form["__EVENTARGUMENT"] != null)
                {
                    if (Request.Form["__EVENTARGUMENT"] == "Wedge_Entry")
                    {
                        var dv = DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_SCANNED_ID);
                        DoFamilySearch(dv, hfSearchEntry.Value);
                    }
                    else if (Request.Form["__EVENTARGUMENT"] == "Family_Id_Search")
                    {
                        var dv = DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_FAMILY_ID);
                        DoFamilySearch(dv, hfSearchEntry.Value);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Redirects to the new theme page.
        /// </summary>
        /// <param name="theme">The theme.</param>
        private void RedirectToNewTheme(string theme)
        {
            var pageRef = RockPage.PageReference;

            pageRef.QueryString = new System.Collections.Specialized.NameValueCollection();
            pageRef.Parameters  = new Dictionary <string, string>();
            pageRef.Parameters.Add("theme", theme);
            pageRef.Parameters.Add("KioskId", CurrentKioskId.ToStringSafe());
            pageRef.Parameters.Add("CheckinTypeId", CurrentCheckinTypeId.ToStringSafe());
            pageRef.Parameters.Add("GroupTypeIds", CurrentGroupTypeIds.AsDelimited(","));
            pageRef.Parameters.Add("ThemeRedirect", "True");

            Response.Redirect(pageRef.BuildUrl(), false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (CurrentKioskId == null || CurrentGroupTypeIds == null || CurrentCheckInState.Kiosk == null)
                {
                    var queryParams = new Dictionary <string, string>();
                    queryParams.Add("back", "true");
                    NavigateToLinkedPage("AdminPage");
                }
                else
                {
                    if (!CurrentCheckInState.Kiosk.HasLocations(CurrentGroupTypeIds) || !CurrentCheckInState.Kiosk.HasActiveLocations(CurrentGroupTypeIds))
                    {
                        DateTimeOffset activeAt = CurrentCheckInState.Kiosk.FilteredGroupTypes(CurrentGroupTypeIds).Select(g => g.NextActiveTime).Min();
                        // not active yet, display next active time
                        return;
                    }
                    else if (CurrentCheckInState.CheckIn.SearchType != null || CurrentCheckInState.CheckIn.Families.Count > 0)
                    {
                        if (!string.IsNullOrWhiteSpace(CurrentCheckInState.CheckIn.SearchValue))
                        {
                            tbSearchBox.Text = CurrentCheckInState.CheckIn.SearchValue;
                        }
                        lbAdmin.Visible = false;
                        lbBack.Visible  = true;
                    }

                    string script = string.Format(@"
                    <script>
                        $(document).ready(function (e) {{
                            if (localStorage) {{
                                localStorage.checkInKiosk = '{0}';
                                localStorage.checkInGroupTypes = '{1}';
                            }}
                        }});
                    </script>
                    ", CurrentKioskId, CurrentGroupTypeIds.AsDelimited(","));
                    phScript.Controls.Add(new LiteralControl(script));

                    if (bool.Parse(GetAttributeValue("ShowKeyPad")) == true)
                    {
                        pnlKeyPad.Visible = true;
                    }

                    tbSearchBox.Focus();
                    SaveState();
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack && CurrentCheckInState != null)
            {
                if (CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_PHONE_NUMBER.AsGuid()))
                {
                    pnlKeyPad.Visible       = true;
                    tbSearchBox.Placeholder = "Search By Phone";
                }
                else if (CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_NAME.AsGuid()))
                {
                    pnlKeyPad.Visible       = false;
                    tbSearchBox.Placeholder = "Search By Last Name, First Name";
                }
                else
                {
                    pnlKeyPad.Visible       = false;
                    tbSearchBox.Placeholder = "Enter Last Name, First Name or Phone";
                }

                if (!string.IsNullOrWhiteSpace(CurrentCheckInState.CheckIn.SearchValue))
                {
                    tbSearchBox.Text = CurrentCheckInState.CheckIn.SearchValue;
                }

                string script = string.Format(@"
            <script>
                $(document).ready(function (e) {{
                    if (localStorage) {{
                        localStorage.theme = '{0}';
                        localStorage.checkInKiosk = '{1}';
                        localStorage.checkInType = '{2}';
                        localStorage.checkInGroupTypes = '{3}';
                    }}
                }});
            </script>
            ", CurrentTheme, CurrentKioskId, CurrentCheckinTypeId, CurrentGroupTypeIds.AsDelimited(","));
                phScript.Controls.Add(new LiteralControl(script));

                // make sure the checkin type isn't set to name only
                if (GetAttributeValue("ShowKeyPad").AsBoolean() && !CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_NAME.AsGuid()))
                {
                    pnlKeyPad.Visible = true;
                }

                tbSearchBox.Focus();
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack)
            {
                if (CurrentCheckInState != null)
                {
                    string script = string.Format(@"
    <script>
        $(document).ready(function (e) {{
            if (localStorage) {{
                localStorage.theme = '{0}'
                localStorage.checkInKiosk = '{1}';
                localStorage.checkInType = '{2}';
                localStorage.checkInGroupTypes = '{3}';
            }}
        }});
    </script>
", CurrentTheme, CurrentKioskId, CurrentCheckinTypeId, CurrentGroupTypeIds.AsDelimited(","));
                    phScript.Controls.Add(new LiteralControl(script));

                    CurrentWorkflow              = null;
                    CurrentCheckInState.CheckIn  = new CheckInStatus();
                    CurrentCheckInState.Messages = new List <CheckInMessage>();
                    SaveState();

                    string familyId = PageParameter("FamilyId");
                    if (familyId.IsNotNullOrWhiteSpace())
                    {
                        var dv = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_FAMILY_ID);
                        DoFamilySearch(dv, familyId);
                    }
                    else
                    {
                        RefreshView();

                        lNotActiveTitle.Text      = GetAttributeValue("NotActiveTitle");
                        lNotActiveCaption.Text    = GetAttributeValue("NotActiveCaption");
                        lNotActiveYetTitle.Text   = GetAttributeValue("NotActiveYetTitle");
                        lNotActiveYetCaption.Text = string.Format(GetAttributeValue("NotActiveYetCaption"), "<span class='countdown-timer'></span>");
                        lClosedTitle.Text         = GetAttributeValue("ClosedTitle");
                        lClosedCaption.Text       = GetAttributeValue("ClosedCaption");

                        string checkinButtonText = GetAttributeValue("CheckinButtonText").IfEmpty("Start");

                        var mergeFields = Rock.Lava.LavaHelper.GetCommonMergeFields(this.RockPage, null, new Rock.Lava.CommonMergeFieldsOptions {
                            GetLegacyGlobalMergeFields = false
                        });
                        mergeFields.Add("CheckinButtonText", checkinButtonText);
                        mergeFields.Add("Kiosk", CurrentCheckInState.Kiosk);
                        mergeFields.Add("RegistrationModeEnabled", CurrentCheckInState.Kiosk.RegistrationModeEnabled);

                        if (CurrentGroupTypeIds != null)
                        {
                            var checkInAreas = CurrentGroupTypeIds.Select(a => GroupTypeCache.Get(a));
                            mergeFields.Add("CheckinAreas", checkInAreas);
                        }

                        lStartButtonHtml.Text = CurrentCheckInState.CheckInType.StartLavaTemplate.ResolveMergeFields(mergeFields);
                    }
                }
            }
            else
            {
                if (Request.Form["__EVENTARGUMENT"] != null)
                {
                    if (Request.Form["__EVENTARGUMENT"] == "Wedge_Entry")
                    {
                        var dv = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_SCANNED_ID);
                        DoFamilySearch(dv, hfSearchEntry.Value);
                    }
                    else if (Request.Form["__EVENTARGUMENT"] == "Family_Id_Search")
                    {
                        var dv = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_FAMILY_ID);
                        DoFamilySearch(dv, hfSearchEntry.Value);
                    }
                    else if (Request.Form["__EVENTARGUMENT"] == "StartClick")
                    {
                        HandleStartClick();
                    }
                }
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!Page.IsPostBack && CurrentCheckInState != null)
            {
                if (CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_PHONE_NUMBER.AsGuid()))
                {
                    pnlKeyPad.Visible       = true;
                    tbSearchBox.Placeholder = "Search By Phone";
                }
                else if (CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_NAME.AsGuid()))
                {
                    pnlKeyPad.Visible       = false;
                    tbSearchBox.Placeholder = "Search By Last Name, First Name";
                }
                else
                {
                    pnlKeyPad.Visible       = false;
                    tbSearchBox.Placeholder = "Enter Last Name, First Name or Phone";
                }

                if (!string.IsNullOrWhiteSpace(CurrentCheckInState.CheckIn.SearchValue))
                {
                    tbSearchBox.Text = CurrentCheckInState.CheckIn.SearchValue;
                }

                var script = string.Format(@"
            <script>
                $(document).ready(function (e) {{
                    if (localStorage) {{
                        localStorage.theme = '{0}';
                        localStorage.checkInKiosk = '{1}';
                        localStorage.checkInType = '{2}';
                        localStorage.checkInGroupTypes = '{3}';
                    }}
                }});
            </script>
            ", CurrentTheme, CurrentKioskId, CurrentCheckinTypeId, CurrentGroupTypeIds.AsDelimited(","));
                using (var literalControl = new LiteralControl(script))
                {
                    phScript.Controls.Add(literalControl);
                }

                // make sure the checkin type isn't set to name only
                if (GetAttributeValue("ShowKeyPad").AsBoolean() && !CurrentCheckInType.SearchType.Guid.Equals(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_NAME.AsGuid()))
                {
                    pnlKeyPad.Visible = true;
                }

                tbSearchBox.Focus();
            }
            else
            {
                if (Request.Form["__EVENTARGUMENT"] != null)
                {
                    if (Request.Form["__EVENTARGUMENT"] == "Wedge_Entry")
                    {
                        var dv = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_SCANNED_ID);
                        SearchFamilyById(dv, hfSearchEntry.Value);
                    }
                    else if (Request.Form["__EVENTARGUMENT"] == "Family_Id_Search")
                    {
                        var dv = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.CHECKIN_SEARCH_TYPE_FAMILY_ID);
                        SearchFamilyById(dv, hfSearchEntry.Value);
                    }
                }
            }
        }