RenderControl() public method

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The object that receives the control content.
return void
        /// <summary>
        /// Renders the base control.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderBaseControl(HtmlTextWriter writer)
        {
            if (DisplayCurrentOption)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-control-group js-date-picker-container");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (IsCurrentDateOffset)
                {
                    // set this.Attributes["disabled"] instead of this.Enabled so that our child controls don't get disabled
                    this.Attributes["disabled"] = "true";
                    _nbDayOffset.Enabled        = true;
                }
                else
                {
                    _nbDayOffset.Enabled = false;
                }
            }

            base.RenderBaseControl(writer);

            if (DisplayCurrentOption)
            {
                _cbCurrent.RenderControl(writer);
                _nbDayOffset.RenderControl(writer);
                writer.RenderEndTag();
            }
        }
Example #2
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute("rowid", ID);
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                writer.AddAttribute("class", "person-name");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);

                writer.Write(PersonName);
                writer.RenderEndTag();

                writer.AddAttribute("class", "person-alternateId");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "form-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute("class", "input-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbAlternateId.RenderControl(writer);
                writer.AddAttribute("class", "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lbGenerate.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderEndTag();  // Tr
            }
        }
Example #3
0
        /// <summary>
        /// Renders the base control.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderBaseControl(HtmlTextWriter writer)
        {
            if (DisplayCurrentOption)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-control-group js-date-picker-container");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (IsCurrentDateOffset)
                {
                    // set this.Attributes["disabled"] instead of this.Enabled so that our child controls don't get disabled
                    this.Attributes["disabled"] = "true";

                    // set textbox val to something instead of empty string so that validation doesn't complain
                    this.Text = "current";
                    _nbDayOffset.Style[HtmlTextWriterStyle.Display] = "";
                }
                else
                {
                    _nbDayOffset.Style[HtmlTextWriterStyle.Display] = "none";
                }
            }

            base.RenderBaseControl(writer);

            if (DisplayCurrentOption)
            {
                _cbCurrent.RenderControl(writer);
                _nbDayOffset.RenderControl(writer);
                writer.RenderEndTag();
            }
        }
        /// <summary>
        /// This is where you implment the simple aspects of rendering your control.  The rest
        /// will be handled by calling RenderControlHelper's RenderControl() method.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl(HtmlTextWriter writer)
        {
            bool ddlItemSelected = false;

            foreach (ListItem li in _dropDownList.Items)
            {
                if (li.Value == _hiddenField.Value)
                {
                    li.Selected     = true;
                    ddlItemSelected = true;
                }
                else
                {
                    li.Selected = false;
                }
            }

            if (!ddlItemSelected)
            {
                _textBox.Text = _hiddenField.Value;
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row js-text-or-ddl-row " + this.CssClass);
            writer.AddAttribute(HtmlTextWriterAttribute.Style, this.Style.Value);
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _hiddenField.RenderControl(writer);
            if (ValidateRequestMode == System.Web.UI.ValidateRequestMode.Disabled)
            {
                _hfDisableVrm.RenderControl(writer);
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _textBox.AddCssClass("js-text-or-ddl-input");
            _textBox.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-1");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var lOr = new RockLiteral();

            lOr.Label = "&nbsp;";
            lOr.Text  = "or";
            lOr.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _dropDownList.AddCssClass("js-text-or-ddl-input");
            _dropDownList.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            RegisterClientScript();
        }
Example #5
0
        /// <summary>
        /// This is where you implment the simple aspects of rendering your control.  The rest
        /// will be handled by calling RenderControlHelper's RenderControl() method.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-control-group js-datetime-picker-container " + this.CssClass);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (IsCurrentTimeOffset)
                {
                    _date.Attributes["disabled"] = "true";
                    _date.AddCssClass("aspNetDisabled");
                    _time.Enabled         = false;
                    _nbTimeOffset.Enabled = true;
                }
                else
                {
                    _date.Enabled         = true;
                    _time.Enabled         = true;
                    _nbTimeOffset.Enabled = false;
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group input-width-md date");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _date.RenderControl(writer);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write("<i class='fa fa-calendar'></i>");
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "bootstrap-timepicker input-group input-width-md");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _time.RenderControl(writer);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write("<span class='add-on'><i class='fa fa-clock-o'></i></span>");
                writer.RenderEndTag();
                writer.RenderEndTag();

                if (DisplayCurrentOption)
                {
                    _cbCurrent.RenderControl(writer);
                    _nbTimeOffset.RenderControl(writer);
                }

                writer.RenderEndTag();   // form-control-group
            }
        }
        /// <summary>
        /// This is where you implement the simple aspects of rendering your control.  The rest
        /// will be handled by calling RenderControlHelper's RenderControl() method.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Style, this.Style.Value);
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _componentPicker.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _fileUploader.RenderControl(writer);
            _textBox.TextMode = TextBoxMode.MultiLine;
            _textBox.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();
        }
Example #7
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            var           noteType = NoteTypeId.HasValue ? NoteTypeCache.Get(NoteTypeId.Value) : null;
            StringBuilder noteCss  = new StringBuilder();

            noteCss.Append("note-editor js-note-editor meta");

            if (!string.IsNullOrEmpty(this.CssClass))
            {
                noteCss.Append(" " + this.CssClass);
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, noteCss.ToString());
            if (this.Style[HtmlTextWriterStyle.Display] != null)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, this.Style[HtmlTextWriterStyle.Display]);
            }

            if (!ShowEditMode)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            }

            if (this.NoteId.HasValue)
            {
                writer.AddAttribute("rel", this.NoteId.Value.ToStringSafe());
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...

            if (NoteOptions.DisplayType == NoteDisplayType.Full && NoteOptions.UsePersonIcon)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "meta-figure");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "avatar avatar-lg");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.Write(Person.GetPersonPhotoImageTag(CreatedByPersonId, CreatedByPhotoId, null, CreatedByGender, null, 50, 50));

                writer.RenderEndTag(); // avatar div
                writer.RenderEndTag(); // meta-figure div
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "meta-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "noteentry-control");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbNote.RenderControl(writer);
            _hfNoteId.RenderControl(writer);
            _hfParentNoteId.RenderControl(writer);
            writer.RenderEndTag();


            // Options
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // The optional create date text box, but only for new notes...
            if (NoteOptions.ShowCreateDateInput && !NoteId.HasValue)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "createDate");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dtCreateDate.RenderControl(writer);
                writer.RenderEndTag();  // createDate div
            }

            _ddlNoteType.RenderControl(writer);
            _hfHasUnselectableNoteType.RenderControl(writer);

            if (NoteOptions.DisplayType == NoteDisplayType.Full)
            {
                if (NoteOptions.ShowAlertCheckBox)
                {
                    _cbAlert.RenderControl(writer);
                }

                if (NoteOptions.ShowPrivateCheckBox)
                {
                    _cbPrivate.RenderControl(writer);
                }
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "commands");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _mdEditWarning.RenderControl(writer);

            if (NoteOptions.DisplayType == NoteDisplayType.Full)
            {
                if (NoteOptions.ShowSecurityButton)
                {
                    _aSecurity.Attributes["data-title"] = this.Label;
                    _aSecurity.RenderControl(writer);
                }
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel js-editnote-cancel btn btn-link btn-xs");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write("Cancel");
            writer.RenderEndTag();

            _lbSaveNote.Text            = "Save " + Label;
            _lbSaveNote.CommandName     = "SaveNote";
            _lbSaveNote.CommandArgument = this.NoteId.ToString();
            _lbSaveNote.RenderControl(writer);

            writer.RenderEndTag();  // commands div

            writer.RenderEndTag();  // settings div


            writer.RenderEndTag(); // panel body

            writer.RenderEndTag(); // ????
        }
Example #8
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute("rowid", ID);
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                writer.AddAttribute("data-label", "Role");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblRole.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _rblRole.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                if (this.ShowTitle)
                {
                    writer.AddAttribute("data-label", "Title");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    _dvpTitle.RenderControl(writer);
                    writer.RenderEndTag();
                }

                writer.AddAttribute("data-label", "Name");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbFirstName.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbFirstName.RenderControl(writer);
                writer.RenderEndTag();

                if (this.ShowNickName)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbNickName.IsValid ? "" : " has-error"));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _tbNickName.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowMiddleName)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbMiddleName.IsValid ? "" : " has-error"));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _tbMiddleName.RenderControl(writer);
                    writer.RenderEndTag();
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbLastName.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbLastName.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();

                if (this.ShowSuffix)
                {
                    writer.AddAttribute("data-label", "Suffix");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    _dvpSuffix.RenderControl(writer);
                    writer.RenderEndTag();
                }

                writer.AddAttribute("data-label", "Connection Status");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _dvpConnectionStatus.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute("data-label", "Gender");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblGender.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _rblGender.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.AddAttribute("data-label", "Birthdate");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_dpBirthdate.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dpBirthdate.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                if (ShowGradeColumn)
                {
                    writer.AddAttribute("data-label", "Grade");
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    if (ShowGradePicker)
                    {
                        _ddlGradePicker.RenderControl(writer);
                    }
                    writer.RenderEndTag();
                }

                writer.AddAttribute("data-label", "Cancel");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _lbDelete.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();
            }
        }
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute("data-key", Guid.ToString());
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-columncommand");
                writer.AddAttribute(HtmlTextWriterAttribute.Align, "center");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _hfOrder.RenderControl(writer);
                writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "minimal workflow-formfield-reorder");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-bars");
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();      // I
                writer.RenderEndTag();      // A
                writer.RenderEndTag();      // Td

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "px-0 py-3");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row mb-2 js-form-attribute-pre-html");
                writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:" + (_cbPreHtml.Checked ? "block" : "none"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-12");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbPreHtml.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row no-gutters d-flex align-items-center");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-3");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(AttributeName);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-9");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "d-flex");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbVisible.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbEditable.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbRequired.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbHideLabel.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbPreHtml.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "flex-eq grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbPostHtml.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "d-flex flex-eq justify-content-center grid-select-field");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lbFilter.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();      // row

                writer.RenderEndTag();      // col-xs-9

                writer.RenderEndTag();      // row

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row mt-2 js-form-attribute-post-html");
                writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:" + (_cbPostHtml.Checked ? "block" : "none"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-12");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbPostHtml.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderEndTag();      // Td

                writer.RenderEndTag();      // Tr
            }
        }
Example #10
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action");
            writer.AddAttribute("data-key", _hfActionTypeGuid.Value);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left workflow-action-name");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblActionTypeName.Text = _tbActionTypeName.Text;
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty;

            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass));
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActionType.Visible = true;

                _lbDeleteActionType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActionType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // add Criteria fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning");
            if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue)
            {
                writer.AddStyleAttribute("display", "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaAttribute.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaComparisonType.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>();

            _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block";
            _tbddlCriteriaValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // action edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActionTypeName.ValidationGroup = ValidationGroup;
            _tbActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActionCompletedOnSuccess.RenderControl(writer);
            _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActivityCompletedOnSuccess.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _wfatpEntityType.ValidationGroup = ValidationGroup;
            _wfatpEntityType.RenderControl(writer);
            writer.RenderEndTag();

            // Add an overview(description) of the selected action type
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            EntityTypeCache entityType   = null;
            int?            entityTypeId = _wfatpEntityType.SelectedValueAsInt();

            if (entityTypeId.HasValue)
            {
                entityType = EntityTypeCache.Get(entityTypeId.Value);
                if (entityType != null)
                {
                    var component = ActionContainer.GetComponent(entityType.Name);
                    if (component != null)
                    {
                        string description   = string.Empty;
                        var    propAttribute = component.GetType().GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false).FirstOrDefault();
                        if (propAttribute != null)
                        {
                            var descAttribute = propAttribute as System.ComponentModel.DescriptionAttribute;
                            if (descAttribute != null)
                            {
                                _rlEntityTypeOverview.Label = string.Format("'{0}' Overview", entityType.FriendlyName);
                                _rlEntityTypeOverview.Text  = descAttribute.Description;
                                _rlEntityTypeOverview.RenderControl(writer);
                            }
                        }
                    }
                }
            }
            writer.RenderEndTag();  // col-md-8

            writer.RenderEndTag();  // row

            if (entityType != null && entityType.Name == typeof(Rock.Workflow.Action.UserEntryForm).FullName)
            {
                _formEditor.ValidationGroup = ValidationGroup;
                _formEditor.RenderControl(writer);
            }

            _phActionAttributes.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // article tag
            writer.RenderEndTag();
        }
Example #11
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (CSSClass != string.Empty)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note " + CSSClass);
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note");
            }

            if (this.NoteId.HasValue)
            {
                writer.AddAttribute("rel", this.NoteId.Value.ToStringSafe());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (DisplayType == NoteDisplayType.Full && UsePersonIcon)
            {
                writer.Write(Person.GetPersonPhotoImageTag(CreatedByPersonId, CreatedByPhotoId, null, CreatedByGender, null, 50, 50));
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "noteentry-control");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlNoteType.RenderControl(writer);
            _tbNote.RenderControl(writer);
            writer.RenderEndTag();

            // The optional create date text box, but only for new notes...
            if (ShowCreateDateInput && !NoteId.HasValue)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "createDate clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dtCreateDate.RenderControl(writer);
                writer.RenderEndTag();  // createDate div
            }

            if (DisplayType == NoteDisplayType.Full)
            {
                // Options
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (ShowAlertCheckBox)
                {
                    _cbAlert.RenderControl(writer);
                }

                if (ShowPrivateCheckBox)
                {
                    _cbPrivate.RenderControl(writer);
                }

                writer.RenderEndTag();

                if (ShowSecurityButton && this.NoteId.HasValue)
                {
                    _sbSecurity.EntityId = this.NoteId.Value;
                    _sbSecurity.Title    = this.Label;
                    _sbSecurity.RenderControl(writer);
                }

                writer.RenderEndTag();  // settings div
            }

            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _lbSaveNote.Text = "Save " + Label;
            _lbSaveNote.RenderControl(writer);

            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-link btn-xs");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.Write("Cancel");
                writer.RenderEndTag();
            }

            writer.RenderEndTag();  // panel-footer div

            writer.RenderEndTag();  // note-entry div

            if (NoteId.HasValue)
            {
                // View Mode HTML...
                writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
                writer.RenderBeginTag("article");

                if (DisplayType == NoteDisplayType.Full)
                {
                    if (UsePersonIcon)
                    {
                        writer.Write(Person.GetPersonPhotoImageTag(CreatedByPersonId, CreatedByPhotoId, CreatedByAge, CreatedByGender, null, 50, 50));
                    }
                    else
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
                        writer.RenderBeginTag(HtmlTextWriterTag.I);
                        writer.RenderEndTag();
                    }
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                // first, encode the text to ensure html tags get encoded
                string renderedText = Text.EncodeHtml();

                // convert any http, etc text into clickable links (do this before applying Markdown)
                renderedText = renderedText.Linkify();

                // convert any markdown into HTML, and convert into crlf into <br />
                renderedText = renderedText.ConvertMarkdownToHtml(true);

                if (DisplayType == NoteDisplayType.Full)
                {
                    // Heading
                    writer.RenderBeginTag(HtmlTextWriterTag.H5);

                    if (DisplayNoteTypeHeading & this.NoteTypeId.HasValue)
                    {
                        var noteType = NoteTypeCache.Get(this.NoteTypeId.Value);
                        if (noteType != null)
                        {
                            writer.RenderBeginTag(HtmlTextWriterTag.Strong);
                            writer.Write(noteType.Name + " &nbsp; ");
                            writer.RenderEndTag();
                        }
                    }

                    string heading = Caption;
                    if (string.IsNullOrWhiteSpace(Caption))
                    {
                        heading = CreatedByName;
                    }
                    writer.Write(heading.EncodeHtml());
                    if (CreatedDateTime.HasValue)
                    {
                        writer.Write(" ");
                        writer.AddAttribute("class", "date");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();

                    writer.Write(renderedText);
                }
                else
                {
                    writer.Write(renderedText);
                    writer.Write(" - ");
                    if (!string.IsNullOrWhiteSpace(CreatedByName))
                    {
                        writer.AddAttribute("class", "note-author");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedByName);
                        writer.RenderEndTag();
                        writer.Write(" ");
                    }
                    if (CreatedDateTime.HasValue)
                    {
                        writer.AddAttribute("class", "note-created");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                }

                writer.RenderEndTag();  // Details Div

                if (CanEdit)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    _lbDeleteNote.RenderControl(writer);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();
                    writer.RenderEndTag();  // A

                    writer.RenderEndTag();  // actions
                }

                writer.RenderEndTag();  // article
            }

            writer.RenderEndTag();
        }
Example #12
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.RenderBeginTag(HtmlTextWriterTag.Legend);
            _lAttributeActionTitle.RenderControl(writer);
            writer.RenderEndTag();

            _validationSummary.RenderControl(writer);

            // row 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbDescription.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 3
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // row 3 col 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cpCategories.RenderControl(writer);
            _tbKey.RenderControl(writer);
            _cvKey.RenderControl(writer);
            _cbRequired.RenderControl(writer);
            _cbShowInGrid.RenderControl(writer);
            writer.RenderEndTag();

            // row 3 col 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlFieldType.RenderControl(writer);
            _phQualifiers.RenderControl(writer);
            _phDefaultValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // </fieldset>
            writer.RenderEndTag();

            if (ShowActions)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _btnSave.RenderControl(writer);
                writer.Write(Environment.NewLine);
                _btnCancel.RenderControl(writer);
                writer.RenderEndTag();
            }

            RegisterClientScript();
        }
Example #13
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lbDelete.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.H4);
                writer.Write(Caption);
                writer.RenderEndTag();

                // Relationship
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _ddlRelationshipType.RenderControl(writer);
                writer.RenderEndTag();
                writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6));     // filler/blocker column
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.RenderEndTag();
                writer.RenderEndTag(); // end Relationship row

                writer.AddAttribute("rowid", ID);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                bool existingPerson = (this.PersonId > 0);
                _lNickName.Visible  = existingPerson;
                _lLastName.Visible  = existingPerson;
                _tbNickName.Visible = !existingPerson;
                _tbLastName.Visible = !existingPerson;

                writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lNickName.RenderControl(writer);
                _tbNickName.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lLastName.RenderControl(writer);
                _tbLastName.RenderControl(writer);
                writer.RenderEndTag();

                if (this.ShowGender)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlGender.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowSuffix)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlSuffix.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowBirthDate)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _bpBirthdate.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowGrade)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlGradePicker.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowMobilePhone)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _pnbMobile.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowEmailAddress)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ebEmail.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowCommunicationPreference)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _rblCommunicationPreference.RenderControl(writer);
                    writer.RenderEndTag();
                }

                foreach (Control attributeCtrl in _phAttributes.Controls)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3));
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    attributeCtrl.RenderControl(writer);
                    writer.RenderEndTag();
                }

                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                writer.RenderEndTag();
            }
        }
Example #14
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.RenderBeginTag(HtmlTextWriterTag.Legend);
            _lAttributeActionTitle.RenderControl(writer);
            writer.RenderEndTag();

            var existingKeyNames = new List <string>();

            ReservedKeyNames.ForEach(n => existingKeyNames.Add(n));
            ObjectPropertyNames.ForEach(n => existingKeyNames.Add(n));
            _hfExistingKeyNames.Value = existingKeyNames.ToJson();
            _hfExistingKeyNames.RenderControl(writer);

            _validationSummary.RenderControl(writer);

            // row 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbDescription.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 3
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // row 3 col 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cpCategories.RenderControl(writer);
            _tbKey.RenderControl(writer);
            _cvKey.RenderControl(writer);
            _tbIconCssClass.RenderControl(writer);
            _cbRequired.RenderControl(writer);
            _cbShowInGrid.RenderControl(writer);
            writer.RenderEndTag();

            // row 3 col 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlFieldType.RenderControl(writer);
            _phQualifiers.RenderControl(writer);
            _phDefaultValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // </fieldset>
            writer.RenderEndTag();

            if (ShowActions)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _btnSave.RenderControl(writer);
                writer.Write(Environment.NewLine);
                _btnCancel.RenderControl(writer);
                writer.RenderEndTag();
            }

            RegisterClientScript();
        }
Example #15
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (CSSClass != string.Empty)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note " + CSSClass);
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note");
            }

            if (this.NoteId.HasValue)
            {
                writer.AddAttribute("rel", this.NoteId.Value.ToStringSafe());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (DisplayType == NoteDisplayType.Full && UsePersonIcon)
            {
                writer.Write(Person.GetPhotoImageTag(CreatedByPhotoId, CreatedByGender, 50, 50));
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "noteentry-control");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlNoteType.RenderControl(writer);
            _tbNote.RenderControl(writer);
            writer.RenderEndTag();

            // The optional create date text box, but only for new notes...
            if (ShowCreateDateInput && !NoteId.HasValue)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "createDate clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dtCreateDate.RenderControl(writer);
                writer.RenderEndTag();  // createDate div
            }

            if (DisplayType == NoteDisplayType.Full)
            {
                // Options
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (ShowAlertCheckBox)
                {
                    _cbAlert.RenderControl(writer);
                }

                if (ShowPrivateCheckBox)
                {
                    _cbPrivate.RenderControl(writer);
                }

                writer.RenderEndTag();

                if (ShowSecurityButton && this.NoteId.HasValue)
                {
                    _sbSecurity.EntityId = this.NoteId.Value;
                    _sbSecurity.Title    = this.Label;
                    _sbSecurity.RenderControl(writer);
                }

                writer.RenderEndTag();  // settings div
            }

            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _lbSaveNote.Text = "Save " + Label;
            _lbSaveNote.RenderControl(writer);

            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-link btn-xs");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.Write("Cancel");
                writer.RenderEndTag();
            }

            writer.RenderEndTag();  // panel-footer div

            writer.RenderEndTag();  // note-entry div

            if (NoteId.HasValue)
            {
                // View Mode HTML...
                writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
                writer.RenderBeginTag("article");

                if (DisplayType == NoteDisplayType.Full)
                {
                    if (UsePersonIcon)
                    {
                        writer.Write(Person.GetPhotoImageTag(CreatedByPhotoId, CreatedByGender, 50, 50));
                    }
                    else
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
                        writer.RenderBeginTag(HtmlTextWriterTag.I);
                        writer.RenderEndTag();
                    }
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (DisplayType == NoteDisplayType.Full)
                {
                    // Heading
                    writer.RenderBeginTag(HtmlTextWriterTag.H5);
                    string heading = Caption;
                    if (string.IsNullOrWhiteSpace(Caption))
                    {
                        heading = CreatedByName;
                    }
                    writer.Write(heading.EncodeHtml());
                    if (CreatedDateTime.HasValue)
                    {
                        writer.Write(" ");
                        writer.AddAttribute("class", "date");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();

                    writer.Write(Text.EncodeHtml().ConvertCrLfToHtmlBr());
                }
                else
                {
                    writer.Write(Text.EncodeHtml().ConvertCrLfToHtmlBr());
                    writer.Write(" - ");
                    if (!string.IsNullOrWhiteSpace(CreatedByName))
                    {
                        writer.AddAttribute("class", "note-author");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedByName);
                        writer.RenderEndTag();
                        writer.Write(" ");
                    }
                    if (CreatedDateTime.HasValue)
                    {
                        writer.AddAttribute("class", "note-created");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                }

                writer.RenderEndTag();  // Details Div

                if (CanEdit)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    _lbDeleteNote.RenderControl(writer);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();
                    writer.RenderEndTag();  // A

                    writer.RenderEndTag();  // actions
                }

                writer.RenderEndTag();  // article
            }

            writer.RenderEndTag();
        }
Example #16
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lbDelete.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.H4);
                writer.Write(Caption);
                writer.RenderEndTag();

                writer.AddAttribute("rowid", ID);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                bool existingPerson = (this.PersonId > 0);
                _lNickName.Visible  = existingPerson;
                _lLastName.Visible  = existingPerson;
                _tbNickName.Visible = !existingPerson;
                _tbLastName.Visible = !existingPerson;

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lNickName.RenderControl(writer);
                _tbNickName.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _lLastName.RenderControl(writer);
                _tbLastName.RenderControl(writer);
                writer.RenderEndTag();


                if (this.ShowSuffix)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlSuffix.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowGender)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlGender.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowBirthDate)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _dpBirthdate.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowGrade)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _ddlGradePicker.RenderControl(writer);
                    writer.RenderEndTag();
                }

                if (this.ShowMobilePhone)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _pnbMobile.RenderControl(writer);
                    writer.RenderEndTag();
                }

                foreach (Control attributeCtrl in _phAttributes.Controls)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    attributeCtrl.RenderControl(writer);
                    writer.RenderEndTag();
                }

                writer.RenderEndTag();

                // Relationship
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.RenderEndTag();
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _ddlRelationshipType.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                writer.RenderEndTag();
            }
        }
Example #17
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget template-form");

            writer.AddAttribute("data-key", _hfFormGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblFormName.Text = _tbFormName.Text;
            _lblFormName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();

            // Name div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.WriteLine("<a class='btn btn-xs btn-link form-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='form-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteForm.Visible = true;
                _lbDeleteForm.RenderControl(writer);
            }
            else
            {
                _lbDeleteForm.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _hfFormGuid.RenderControl(writer);
            _hfFormId.RenderControl(writer);
            _tbFormName.ValidationGroup = ValidationGroup;
            _tbFormName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _gFields.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action");
            writer.AddAttribute("data-key", _hfActionTypeGuid.Value);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left workflow-action-name");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblActionTypeName.Text = _tbActionTypeName.Text;
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty;

            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass));
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActionType.Visible = true;

                _lbDeleteActionType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActionType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // add Criteria fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning");
            if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue)
            {
                writer.AddStyleAttribute("display", "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaAttribute.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaComparisonType.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>();

            _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block";
            _tbddlCriteriaValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // action edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActionTypeName.ValidationGroup = ValidationGroup;
            _tbActionTypeName.RenderControl(writer);
            _ddlEntityType.ValidationGroup = ValidationGroup;
            _ddlEntityType.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActionCompletedOnSuccess.RenderControl(writer);
            _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActivityCompletedOnSuccess.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _formEditor.ValidationGroup = ValidationGroup;
            _formEditor.RenderControl(writer);

            _phActionAttributes.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // article tag
            writer.RenderEndTag();
        }
Example #19
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActive.RenderControl(writer);
            _tbUrlSlug.RenderControl(writer);
            writer.RenderEndTag();  // col-md-6

            writer.RenderEndTag();  // row

            _ceDetails.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _dtpStart.RenderControl(writer);
            _dtpEnd.RenderControl(writer);
            _nbMaxAttendees.RenderControl(writer);
            _wtpRegistrationWorkflow.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _dtpSendReminder.RenderControl(writer);
            writer.RenderEndTag();              // col-xs-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbReminderSent.Visible = _cbReminderSent.Checked;
            _cbReminderSent.RenderControl(writer);
            writer.RenderEndTag();      // col-xs-6

            writer.RenderEndTag();      // row

            writer.RenderEndTag();      // col-md-6
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _ppContact.RenderControl(writer);
            _pnContactPhone.RenderControl(writer);
            _ebContactEmail.RenderControl(writer);

            _cbCost.RenderControl(writer);
            _cbMinimumInitialPayment.RenderControl(writer);
            _cbDefaultPaymentAmount.RenderControl(writer);
            _apAccount.RenderControl(writer);

            writer.RenderEndTag();  // col-md-6
            writer.RenderEndTag();  // row

            _htmlRegistrationInstructions.RenderControl(writer);

            _htmlAdditionalReminderDetails.RenderControl(writer);

            _htmlAdditionalConfirmationDetails.RenderControl(writer);
        }
Example #20
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute("rowid", ID);
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblRole.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _rblRole.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _ddlTitle.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbFirstName.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbFirstName.RenderControl(writer);
                writer.RenderEndTag();
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbLastName.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _tbLastName.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _ddlSuffix.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _ddlConnectionStatus.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblGender.IsValid ? "" : " has-error"));
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _rblGender.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _dpBirthdate.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                if (ShowGrade)
                {
                    _ddlGradePicker.RenderControl(writer);
                }

                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                _lbDelete.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();
            }
        }
Example #21
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (!Expanded)
            {
                foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
                {
                    if (workflowActionTypeEditor.Expanded)
                    {
                        Expanded = true;
                        break;
                    }
                }
            }

            string inactiveCss = _cbActivityTypeIsActive.Checked ? string.Empty : " workflow-activity-inactive";
            string activatedWithWorkflowCss = _cbActivityTypeIsActivatedWithWorkflow.Checked ? " activated-with-workflow" : string.Empty;

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity" + inactiveCss + activatedWithWorkflowCss);

            writer.AddAttribute("data-key", _hfActivityTypeGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute("class", "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblActivityTypeName.Text = _tbActivityTypeName.Text;
            _lblActivityTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.Text = _tbActivityTypeDescription.Text;
            _lblActivityTypeDescription.RenderControl(writer);

            // Name/Description div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId != 0)
            {
                writer.WriteLine(string.Format("<span class=\"label label-default\">Id: {0}</span>", _sbSecurity.EntityId));
            }
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-activity-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            _lblInactive.Style[HtmlTextWriterStyle.Display] = _cbActivityTypeIsActive.Checked ? "none" : string.Empty;
            _lblInactive.RenderControl(writer);

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActivityTypeName.ValidationGroup = ValidationGroup;
            _tbActivityTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-2");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityTypeIsActive.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActive.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId > 0)
            {
                _sbSecurity.Title = _tbActivityTypeName.Text;
                _sbSecurity.RenderControl(writer);
            }

            _cbActivityTypeIsActivatedWithWorkflow.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActivatedWithWorkflow.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _tbActivityTypeDescription.ValidationGroup = ValidationGroup;
            _tbActivityTypeDescription.RenderControl(writer);

            _pwAttributes.RenderControl(writer);

            // actions
            writer.RenderBeginTag("fieldset");

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            _lbAddActionType.RenderControl(writer);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-action-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
            {
                workflowActionTypeEditor.ValidationGroup = ValidationGroup;
                workflowActionTypeEditor.RenderControl(writer);
            }

            // workflow-action-list div
            writer.RenderEndTag();

            // actions fieldset
            writer.RenderEndTag();

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
Example #22
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "note-editor");
            writer.AddAttribute("rel", this.NoteId.ToStringSafe());
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _tbNote.RenderControl(writer);

            // Options
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (ShowAlertCheckBox)
            {
                _cbAlert.RenderControl(writer);
            }

            if (ShowPrivateCheckBox)
            {
                _cbPrivate.RenderControl(writer);
            }

            writer.RenderEndTag();

            if (ShowSecurityButton)
            {
                _sbSecurity.EntityId = this.NoteId;
                _sbSecurity.Title    = this.Label;
                _sbSecurity.RenderControl(writer);
            }

            writer.RenderEndTag();  // settings div
            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lbSaveNote.RenderControl(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-xs");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write("Cancel");
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.RenderEndTag();  // note-entry div

            // View Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
            writer.RenderBeginTag(HtmlTextWriterTag.I);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Heading
            writer.RenderBeginTag(HtmlTextWriterTag.H5);
            writer.Write(Caption.EncodeHtmlThenConvertCrLfToHtmlBr());
            if (CreatedDateTime.HasValue)
            {
                writer.Write(" ");
                writer.AddAttribute("class", "date");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                writer.RenderEndTag();
            }
            writer.RenderEndTag();

            writer.Write(Text.EncodeHtmlThenConvertCrLfToHtmlBr());

            writer.RenderEndTag();  // Details Div

            if (CanEdit)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                _lbDeleteNote.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();  // A


                writer.RenderEndTag();  // actions
            }

            writer.RenderEndTag();  // article

            writer.RenderEndTag();
        }