コード例 #1
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "group-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupGuid    = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";
            Controls.Add(_hfGroupGuid);

            _lblGroupRowName = new Label();
            _lblGroupRowName.ClientIDMode = ClientIDMode.Static;
            _lblGroupRowName.ID           = this.ID + "_lblGroupRowName";
            Controls.Add(_lblGroupRowName);

            if (EnableAddGroups)
            {
                _lbAddGroup                  = new LinkButton();
                _lbAddGroup.ID               = this.ID + "_lbAddGroup";
                _lbAddGroup.CssClass         = "btn btn-xs btn-default resource-group-add-group";
                _lbAddGroup.Click           += lbAddGroup_Click;
                _lbAddGroup.CausesValidation = false;
                _lbAddGroup.ToolTip          = "Add New Group";
                _lbAddGroup.Controls.Add(new LiteralControl {
                    Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>"
                });
                Controls.Add(_lbAddGroup);
            }
        }
コード例 #2
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "group-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupGuid    = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";

            _lblGroupRowName = new Label();
            _lblGroupRowName.ClientIDMode = ClientIDMode.Static;
            _lblGroupRowName.ID           = this.ID + "_lblGroupRowName";

            _lbAddGroup                  = new LinkButton();
            _lbAddGroup.ID               = this.ID + "_lbAddGroup";
            _lbAddGroup.CssClass         = "btn btn-xs btn-default checkin-group-add-group";
            _lbAddGroup.Click           += lbAddGroup_Click;
            _lbAddGroup.CausesValidation = false;
            _lbAddGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>"
            });

            _lblArchiveGroup = new LinkButton();
            _lblArchiveGroup.CausesValidation = false;
            _lblArchiveGroup.ID       = this.ID + "_lblArchiveGroup";
            _lblArchiveGroup.CssClass = "btn btn-xs btn-warning";
            _lblArchiveGroup.Click   += lblArchiveGroup_Click;
            _lblArchiveGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-archive'></i>"
            });
            _lblArchiveGroup.Attributes["onclick"] = string.Format("javascript: return confirmArchive(event, '{0}', '{1}');", "check-in group", "After archiving you will no longer be able to use this check-in group.");

            _lblDeleteGroup = new LinkButton();
            _lblDeleteGroup.CausesValidation = false;
            _lblDeleteGroup.ID       = this.ID + "_lblDeleteGroup";
            _lblDeleteGroup.CssClass = "btn btn-xs btn-danger";
            _lblDeleteGroup.Click   += lblDeleteGroup_Click;
            _lblDeleteGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });
            _lblDeleteGroup.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in group", "Once saved, you will lose all attendance data.");

            Controls.Add(_hfGroupGuid);
            Controls.Add(_lblGroupRowName);

            Controls.Add(_lblArchiveGroup);
            Controls.Add(_lbAddGroup);
            Controls.Add(_lblDeleteGroup);
        }
コード例 #3
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();
            _hfPaymentInfoToken = new HiddenFieldWithClass()
            {
                ID = "_hfPaymentInfoToken", CssClass = "js-response-token"
            };
            Controls.Add(_hfPaymentInfoToken);

            _hfTokenizerRawResponse = new HiddenFieldWithClass()
            {
                ID = "_hfTokenizerRawResponse", CssClass = "js-tokenizer-raw-response"
            };
            Controls.Add(_hfTokenizerRawResponse);

            _hfEnabledPaymentTypesJSON = new HiddenFieldWithClass()
            {
                ID = "_hfEnabledPaymentTypesJSON", CssClass = "js-enabled-payment-types"
            };
            Controls.Add(_hfEnabledPaymentTypesJSON);

            _hfSelectedPaymentType = new HiddenFieldWithClass()
            {
                ID = "_hfSelectedPaymentType", CssClass = "js-selected-payment-type"
            };
            Controls.Add(_hfSelectedPaymentType);

            _hfPublicApiKey = new HiddenFieldWithClass()
            {
                ID = "_hfPublicApiKey", CssClass = "js-public-api-key"
            };
            Controls.Add(_hfPublicApiKey);

            _hiddenInputStyleHook = new TextBox();
            _hiddenInputStyleHook.Attributes["class"] = "js-input-style-hook form-control";
            _hiddenInputStyleHook.Style["display"]    = "none";
            Controls.Add(_hiddenInputStyleHook);

            _hfGatewayUrl = new HiddenFieldWithClass()
            {
                ID = "_hfGatewayUrl", CssClass = "js-gateway-url"
            };
            Controls.Add(_hfGatewayUrl);

            _paymentTypeSelector = new Panel()
            {
                ID = "_paymentTypeSelector", CssClass = "js-gateway-paymenttype-selector gateway-paymenttype-selector"
            };
            Controls.Add(_paymentTypeSelector);

            Literal lPaymentSelectorHTML = new Literal()
            {
                ID = "lPaymentSelectorHTML"
            };

            lPaymentSelectorHTML.Text = $@"
<div class='gateway-type-selector btn-group btn-group-justified' role='group'>
    <a class='btn btn-default active js-payment-creditcard payment-creditcard' runat='server'>
        Card
    </a>
    <a class='btn btn-default js-payment-ach payment-ach' runat='server'>
        Bank Account
    </a>
</div>
";

            _paymentTypeSelector.Controls.Add(lPaymentSelectorHTML);

            _gatewayCreditCardIFrameContainer = new Panel()
            {
                ID = "_gatewayCreditCardIFrameContainer", CssClass = "gateway-iframe-container js-gateway-creditcard-iframe-container"
            };
            Controls.Add(_gatewayCreditCardIFrameContainer);

            _gatewayACHIFrameContainer = new Panel()
            {
                ID = "_gatewayACHIFrameContainer", CssClass = "gateway-iframe-container js-gateway-ach-iframe-container"
            };
            Controls.Add(_gatewayACHIFrameContainer);
        }
コード例 #4
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();
            _hfPaymentInfoToken = new HiddenFieldWithClass()
            {
                ID = "_hfPaymentInfoToken", CssClass = "js-response-token"
            };
            Controls.Add(_hfPaymentInfoToken);

            _hfCollectJSRawResponse = new HiddenFieldWithClass()
            {
                ID = "_hfTokenizerRawResponse", CssClass = "js-tokenizer-raw-response"
            };
            Controls.Add(_hfCollectJSRawResponse);

            _hfEnabledPaymentTypesJSON = new HiddenFieldWithClass()
            {
                ID = "_hfEnabledPaymentTypesJSON", CssClass = "js-enabled-payment-types"
            };
            Controls.Add(_hfEnabledPaymentTypesJSON);

            _hfEnabledPaymentTypesJSON.Value = this.EnabledPaymentTypes.ToJson();

            _hfSelectedPaymentType = new HiddenFieldWithClass()
            {
                ID = "_hfSelectedPaymentType", CssClass = "js-selected-payment-type"
            };
            Controls.Add(_hfSelectedPaymentType);


            /* Payment Type Selector*/
            if (EnabledPaymentTypes.Length > 1)
            {
                Literal lPaymentSelectorHTML = new Literal()
                {
                    ID = "lPaymentSelectorHTML"
                };

                lPaymentSelectorHTML.Text = $@"
<div class='gateway-type-selector btn-group btn-group-justified' role='group'>
    <a class='btn btn-default active js-payment-creditcard payment-creditcard' runat='server'>
        Card
    </a>
    <a class='btn btn-default js-payment-ach payment-ach' runat='server'>
        Bank Account
    </a>
</div>";

                _paymentTypeSelector = new Panel()
                {
                    ID = "_paymentTypeSelector", CssClass = "js-gateway-paymenttype-selector gateway-paymenttype-selector"
                };
                _paymentTypeSelector.Controls.Add(lPaymentSelectorHTML);
                Controls.Add(_paymentTypeSelector);
            }

            var pnlPaymentInputs = new Panel {
                ID = "pnlPaymentInputs", CssClass = "js-nmi-payment-inputs nmi-payment-inputs"
            };

            /* Credit Card Inputs */
            if (EnabledPaymentTypes.Contains(NMIPaymentType.card))
            {
                _gatewayCreditCardContainer = new Panel()
                {
                    ID = "_gatewayCreditCardContainer", CssClass = "gateway-creditcard-container gateway-payment-container js-gateway-creditcard-container"
                };
                pnlPaymentInputs.Controls.Add(_gatewayCreditCardContainer);

                _divCreditCardNumber = new HtmlGenericControl("div");
                _divCreditCardNumber.AddCssClass("js-credit-card-input iframe-input credit-card-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardNumber);

                _divCreditCardBreak = new HtmlGenericControl("div");
                _divCreditCardBreak.AddCssClass("break");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardBreak);

                _divCreditCardExp = new HtmlGenericControl("div");
                _divCreditCardExp.AddCssClass("js-credit-card-exp-input iframe-input credit-card-exp-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardExp);

                _divCreditCardCVV = new HtmlGenericControl("div");
                _divCreditCardCVV.AddCssClass("js-credit-card-cvv-input iframe-input credit-card-cvv-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardCVV);
            }


            /* ACH Inputs */
            if (EnabledPaymentTypes.Contains(NMIPaymentType.ach))
            {
                _gatewayACHContainer = new Panel()
                {
                    ID = "_gatewayACHContainer", CssClass = "gateway-ach-container gateway-payment-container js-gateway-ach-container"
                };
                pnlPaymentInputs.Controls.Add(_gatewayACHContainer);

                _divCheckAccountNumber = new HtmlGenericControl("div");
                _divCheckAccountNumber.AddCssClass("js-check-account-number-input iframe-input check-account-number-input");
                _gatewayACHContainer.Controls.Add(_divCheckAccountNumber);

                _divCheckRoutingNumber = new HtmlGenericControl("div");
                _divCheckRoutingNumber.AddCssClass("js-check-routing-number-input iframe-input check-routing-number-input");
                _gatewayACHContainer.Controls.Add(_divCheckRoutingNumber);

                _divCheckFullName = new HtmlGenericControl("div");
                _divCheckFullName.AddCssClass("js-check-fullname-input iframe-input check-fullname-input");
                _gatewayACHContainer.Controls.Add(_divCheckFullName);
            }

            /* Submit Payment */

            // collectJs needs a payment button to work, so add it but don't show it
            _aPaymentButton = new HtmlGenericControl("button");
            _aPaymentButton.Attributes["type"] = "button";
            _aPaymentButton.Style[HtmlTextWriterStyle.Display] = "none";
            _aPaymentButton.AddCssClass("js-payment-button payment-button");
            pnlPaymentInputs.Controls.Add(_aPaymentButton);

            Controls.Add(pnlPaymentInputs);

            _divValidationMessage = new HtmlGenericControl("div");
            _divValidationMessage.AddCssClass("alert alert-validation js-payment-input-validation");
            _divValidationMessage.InnerHtml =
                @"<span class='js-validation-message'></span>";
            this.Controls.Add(_divValidationMessage);

            _hiddenInputStyleHook = new TextBox();
            _hiddenInputStyleHook.Attributes["class"] = "js-input-style-hook form-control nmi-input-style-hook form-group";
            _hiddenInputStyleHook.Style["display"]    = "none";

            Controls.Add(_hiddenInputStyleHook);

            _divInputInvalid = new HtmlGenericControl("div");
            _divInputInvalid.AddCssClass("form-group has-error");
            _divInputInvalid.InnerHtml =
                @"<input type='text' class='js-input-invalid-style-hook form-control'>";
            _divInputInvalid.Style["display"] = "none";
            Controls.Add(_divInputInvalid);
        }
コード例 #5
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();

            _hfPersonId          = new HiddenFieldWithClass();
            _hfPersonId.CssClass = "js-person-id";
            Controls.Add(_hfPersonId);
            _hfPersonId.ID    = "hfPersonId";
            _hfPersonId.Value = "0";

            _hfPersonName          = new HiddenFieldWithClass();
            _hfPersonName.CssClass = "js-person-name";
            Controls.Add(_hfPersonName);
            _hfPersonName.ID = "hfPersonName";

            _hfSelfPersonId          = new HiddenFieldWithClass();
            _hfSelfPersonId.CssClass = "js-self-person-id";
            Controls.Add(_hfSelfPersonId);
            _hfSelfPersonId.ID    = "hfSelfPersonId";
            _hfSelfPersonId.Value = "0";

            _hfSelfPersonName          = new HiddenFieldWithClass();
            _hfSelfPersonName.CssClass = "js-self-person-name";
            Controls.Add(_hfSelfPersonName);
            _hfSelfPersonName.ID = "hfSelfPersonName";

            var rockBlock = this.RockBlock();

            if (rockBlock != null && rockBlock.CurrentPerson != null)
            {
                _hfSelfPersonId.Value   = rockBlock.CurrentPersonId.ToString();
                _hfSelfPersonName.Value = rockBlock.CurrentPerson.ToString();
            }

            _hfIncludeBusinesses          = new HiddenFieldWithClass();
            _hfIncludeBusinesses.CssClass = "js-include-businesses";
            Controls.Add(_hfIncludeBusinesses);
            _hfIncludeBusinesses.ID = "hfIncludeBusinesses";

            _btnSelect = new HtmlAnchor();
            Controls.Add(_btnSelect);
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary";
            _btnSelect.ID               = "btnSelect";
            _btnSelect.InnerText        = "Select";
            _btnSelect.CausesValidation = false;
            _btnSelect.ServerClick     += btnSelect_Click;

            _btnSelectNone = new HtmlAnchor();
            Controls.Add(_btnSelectNone);
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = "btnSelectNone";
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += btnSelect_Click;

            ControlHelper.CreateChildControls(this, Controls);

            // override a couple of property values on RequiredFieldValidator so that Validation works correctly
            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfPersonId.ID;
        }
コード例 #6
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();
            _hfPaymentInfoToken = new HiddenFieldWithClass()
            {
                ID = "_hfPaymentInfoToken", CssClass = "js-response-token"
            };
            Controls.Add(_hfPaymentInfoToken);

            _hfTokenizerRawResponse = new HiddenFieldWithClass()
            {
                ID = "_hfTokenizerRawResponse", CssClass = "js-tokenizer-raw-response"
            };
            Controls.Add(_hfTokenizerRawResponse);

            _hfEnabledPaymentTypesJSON = new HiddenFieldWithClass()
            {
                ID = "_hfEnabledPaymentTypesJSON", CssClass = "js-enabled-payment-types"
            };
            Controls.Add(_hfEnabledPaymentTypesJSON);

            _hfPublicApiKey = new HiddenFieldWithClass()
            {
                ID = "_hfPublicApiKey", CssClass = "js-public-api-key"
            };
            Controls.Add(_hfPublicApiKey);

            _hiddenInputStyleHook = new TextBox();
            _hiddenInputStyleHook.Attributes["class"] = "js-input-style-hook";
            _hiddenInputStyleHook.Style["display"]    = "none";
            Controls.Add(_hiddenInputStyleHook);

            _hfGatewayUrl = new HiddenFieldWithClass()
            {
                ID = "_hfGatewayUrl", CssClass = "js-gateway-url"
            };
            Controls.Add(_hfGatewayUrl);

            _paymentTypeSelector = new Panel()
            {
                ID = "_paymentTypeSelector", CssClass = "js-gateway-paymenttype-selector gateway-paymenttype-selector"
            };
            Controls.Add(_paymentTypeSelector);

            Literal lPaymentSelectorHTML = new Literal()
            {
                ID = "lPaymentSelectorHTML"
            };

            lPaymentSelectorHTML.Text = $@"
<ul class='nav nav-pills'>
    <li class='js-payment-creditcard payment-creditcard active' runat='server'>
        <a data-toggle='pill'>Credit Card</a>
    </li>
    <li class='js-payment-ach payment-ach' runat='server'>
        <a data-toggle='pill'>Bank Account</a>
    </li>
</ul>
";

            _paymentTypeSelector.Controls.Add(lPaymentSelectorHTML);

            _gatewayCreditCardIFrameContainer = new Panel()
            {
                ID = "_gatewayCreditCardIFrameContainer", CssClass = "js-gateway-creditcard-iframe-container"
            };
            Controls.Add(_gatewayCreditCardIFrameContainer);

            _gatewayACHIFrameContainer = new Panel()
            {
                ID = "_gatewayACHIFrameContainer", CssClass = "js-gateway-ach-iframe-container"
            };
            Controls.Add(_gatewayACHIFrameContainer);
        }