protected override void CreateChildControls()
{
if ( !_controlsLoaded )
{
Controls.Clear();
_tbName = new RockTextBox();
_tbName.ID = this.ID + "_tbName";
_tbName.Label = "Registration Instance Name";
_tbName.Help = "The name will be used to describe the registration on the registration screens and emails.";
_tbName.Required = true;
Controls.Add( _tbName );
_cbIsActive = new RockCheckBox();
_cbIsActive.ID = this.ID + "_cbIsActive";
_cbIsActive.Label = "Active";
_cbIsActive.Text = "Yes";
Controls.Add( _cbIsActive );
_tbUrlSlug = new RockTextBox();
_tbUrlSlug.ID = this.ID + "_tbUrlSlug";
_tbUrlSlug.Label = "URL Slug";
_tbUrlSlug.Visible = false;
Controls.Add( _tbUrlSlug );
_ceDetails = new CodeEditor();
_ceDetails.ID = this.ID + "_ceDetails";
_ceDetails.Label = "Details";
_ceDetails.EditorMode = CodeEditorMode.Html;
_ceDetails.EditorTheme = CodeEditorTheme.Rock;
_ceDetails.EditorHeight = "100";
_ceDetails.Visible = false; // hiding this out for now. Struggling where we'd even use this, but instead of removing it we'll just comment it out for now.
Controls.Add( _ceDetails );
_dtpStart = new DateTimePicker();
_dtpStart.ID = this.ID + "_dtpStart";
_dtpStart.Label = "Registration Starts";
Controls.Add( _dtpStart );
_dtpEnd = new DateTimePicker();
_dtpEnd.ID = this.ID + "_dtpEnd";
_dtpEnd.Label = "Registration Ends";
Controls.Add( _dtpEnd );
_nbMaxAttendees = new NumberBox();
_nbMaxAttendees.ID = this.ID + "_nbMaxAttendees";
_nbMaxAttendees.Label = "Maximum Attendees";
_nbMaxAttendees.NumberType = ValidationDataType.Integer;
Controls.Add( _nbMaxAttendees );
_wtpRegistrationWorkflow = new WorkflowTypePicker();
_wtpRegistrationWorkflow.ID = this.ID + "_wtpRegistrationWorkflow";
_wtpRegistrationWorkflow.Label = "Registration Workflow";
_wtpRegistrationWorkflow.Help = "An optional workflow type to launch when a new registration is completed.";
Controls.Add( _wtpRegistrationWorkflow );
_cbCost = new CurrencyBox();
_cbCost.ID = this.ID + "_cbCost";
_cbCost.Label = "Cost";
_cbCost.Help = "The cost per registrant";
Controls.Add( _cbCost );
_cbMinimumInitialPayment = new CurrencyBox();
_cbMinimumInitialPayment.ID = this.ID + "_cbMinimumInitialPayment";
_cbMinimumInitialPayment.Label = "Minimum Initial Payment";
_cbMinimumInitialPayment.Help = "The minimum amount required per registrant. Leave value blank if full amount is required.";
Controls.Add( _cbMinimumInitialPayment );
_apAccount = new AccountPicker();
_apAccount.ID = this.ID + "_apAccount";
_apAccount.Label = "Account";
_apAccount.Required = true;
Controls.Add( _apAccount );
_ppContact = new PersonPicker();
_ppContact.ID = this.ID + "_ppContact";
_ppContact.Label = "Contact";
_ppContact.SelectPerson += _ppContact_SelectPerson;
_ppContact.EnableSelfSelection = true;
Controls.Add( _ppContact );
_pnContactPhone = new PhoneNumberBox();
_pnContactPhone.ID = this.ID + "_pnContactPhone";
_pnContactPhone.Label = "Contact Phone";
Controls.Add( _pnContactPhone );
_ebContactEmail = new EmailBox();
_ebContactEmail.ID = this.ID + "_ebContactEmail";
_ebContactEmail.Label = "Contact Email";
Controls.Add( _ebContactEmail );
_dtpSendReminder = new DateTimePicker();
_dtpSendReminder.ID = this.ID + "_dtpSendReminder";
_dtpSendReminder.Label = "Send Reminder Date";
Controls.Add( _dtpSendReminder );
_cbReminderSent = new RockCheckBox();
_cbReminderSent.ID = this.ID + "_cbReminderSent";
_cbReminderSent.Label = "Reminder Sent";
_cbReminderSent.Text = "Yes";
Controls.Add( _cbReminderSent );
_htmlAdditionalReminderDetails = new HtmlEditor();
_htmlAdditionalReminderDetails.ID = this.ID + "_htmlAdditionalReminderDetails";
_htmlAdditionalReminderDetails.Toolbar = HtmlEditor.ToolbarConfig.Light;
_htmlAdditionalReminderDetails.Label = "Additional Reminder Details";
_htmlAdditionalReminderDetails.Help = "These confirmation details will be appended to those from the registration template when displayed at the end of the registration process.";
_htmlAdditionalReminderDetails.Height = 200;
Controls.Add( _htmlAdditionalReminderDetails );
_htmlAdditionalConfirmationDetails = new HtmlEditor();
_htmlAdditionalConfirmationDetails.ID = this.ID + "_htmlAdditionalConfirmationDetails";
_htmlAdditionalConfirmationDetails.Toolbar = HtmlEditor.ToolbarConfig.Light;
_htmlAdditionalConfirmationDetails.Label = "Additional Confirmation Details";
_htmlAdditionalConfirmationDetails.Help = "These confirmation details will be appended to those from the registration template when displayed at the end of the registration process.";
_htmlAdditionalConfirmationDetails.Height = 200;
Controls.Add( _htmlAdditionalConfirmationDetails );
_controlsLoaded = true;
}
}