Пример #1
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 (this.Visible)
            {
                _hfGroupGuid.RenderControl(writer);
                _hfGroupId.RenderControl(writer);
                _hfGroupTypeId.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Style, "margin-top:0;");
                writer.RenderBeginTag(HtmlTextWriterTag.H3);
                _lblGroupName.Text = _tbGroupName.Text;
                _lblGroupName.RenderControl(writer);
                writer.RenderEndTag();

                _tbGroupName.RenderControl(writer);
                _cbIsActive.RenderBaseControl(writer);
                _phGroupAttributes.RenderControl(writer);

                writer.WriteLine("<h3>Locations</h3>");
                if (this.Locations != null)
                {
                    _gLocations.DataSource = this.Locations.OrderBy(l => l.Order).ThenBy(l => l.FullNamePath).ToList();
                    _gLocations.DataBind();
                }
                _gLocations.RenderControl(writer);
            }
        }
Пример #2
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 checkin-grouptype");
            writer.AddAttribute("data-key", _hfGroupTypeGuid.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(HtmlTextWriterAttribute.Class, "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblGroupTypeName.Text = _tbGroupTypeName.Text;
            _lblGroupTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();

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

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

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

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

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

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

            _lbAddCheckinGroupType.RenderControl(writer);
            writer.WriteLine();
            _lbAddCheckinGroup.RenderControl(writer);
            writer.WriteLine();

            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

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

            if (!Expanded)
            {
                writer.AddStyleAttribute("display", "none");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // make two span6 columns: Left Column for Name and Attributes. Right Column for Labels Grid
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

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

            // grouptype edit fields
            _tbGroupTypeName.RenderControl(writer);
            _ddlGroupTypeInheritFrom.RenderControl(writer);

            // attributes
            _phGroupTypeAttributes.RenderControl(writer);

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

            // Check-in Labels grid
            writer.WriteLine("<h3>Check-in Labels</h3>");
            _gCheckinLabels.DataSource = this.CheckinLabels;
            _gCheckinLabels.DataBind();
            _gCheckinLabels.RenderControl(writer);

            // span6
            writer.RenderEndTag();

            // rowfluid
            writer.RenderEndTag();

            // groups
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "checkin-grouptype-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (CheckinGroupTypeEditor checkinGroupTypeEditor in this.Controls.OfType <CheckinGroupTypeEditor>())
            {
                checkinGroupTypeEditor.RenderControl(writer);
            }

            // checkin-grouptype-list div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "checkin-group-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (CheckinGroupEditor checkinGroupEditor in this.Controls.OfType <CheckinGroupEditor>())
            {
                checkinGroupEditor.RenderControl(writer);
            }

            // checkin-group-list div
            writer.RenderEndTag();

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

            // section tag
            writer.RenderEndTag();
        }
Пример #3
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();
        }
Пример #4
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 checkin-group");
            writer.AddAttribute("data-key", _hfGroupGuid.Value);
            writer.RenderBeginTag("article");

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

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

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblGroupName.Text = _tbGroupName.Text;
            _lblGroupName.RenderControl(writer);
            writer.RenderEndTag();

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

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

            if (IsDeleteEnabled)
            {
                _lbDeleteGroup.Visible = true;

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

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

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

            _lbAddCheckinGroup.RenderControl(writer);
            writer.WriteLine();

            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);

            // make two span6 columns: Left Column for Name and Attributes. Right Column for Locations Grid
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

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

            // edit fields
            _tbGroupName.RenderControl(writer);

            // attributes
            _phGroupAttributes.RenderControl(writer);

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

            // Locations grid
            writer.WriteLine("<h3>Locations</h3>");
            _gLocations.DataSource = this.Locations.OrderBy(l => l.FullNamePath).ToList();
            _gLocations.DataBind();
            _gLocations.RenderControl(writer);

            // span6
            writer.RenderEndTag();

            // rowfluid
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "checkin-group-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (CheckinGroupEditor checkinGroupEditor in this.Controls.OfType <CheckinGroupEditor>())
            {
                checkinGroupEditor.RenderControl(writer);
            }

            // checkin-group-list div
            writer.RenderEndTag();

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

            // article tag
            writer.RenderEndTag();
        }
Пример #5
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 checkin-group");
            writer.AddAttribute("data-key", _hfGroupGuid.Value);
            writer.RenderBeginTag("article");

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

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblGroupName.Text = _tbGroupName.Text;
            _lblGroupName.RenderControl(writer);
            writer.RenderEndTag();

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

            writer.WriteLine("<a class='btn btn-xs checkin-group-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine("<a class='btn btn-xs'><i class='checkin-group-state fa fa-chevron-down'></i></a>");

            if (IsDeleteEnabled)
            {
                _lbDeleteGroup.Visible = true;

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

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

            // header div
            writer.RenderEndTag();

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

            Group group = this.GetGroup();

            bool forceContentVisible = !group.IsValid || ForceContentVisible;

            if (!forceContentVisible)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // make two span6 columns: Left Column for Name and Attributes. Right Column for Locations Grid
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

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

            // edit fields
            _tbGroupName.RenderControl(writer);

            // attributes
            _phGroupAttributes.RenderControl(writer);

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

            // Locations grid
            writer.WriteLine("<h3>Locations</h3>");
            _gLocations.DataSource = this.Locations;
            _gLocations.DataBind();
            _gLocations.RenderControl(writer);

            // span6
            writer.RenderEndTag();

            // rowfluid
            writer.RenderEndTag();

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

            // article tag
            writer.RenderEndTag();
        }