Esempio n. 1
0
        protected override void Render(HtmlTextWriter output)
        {
            PlaceHolder plh   = new PlaceHolder();
            Table       table = new Table();

            table.Rows.Add(new TableRow());
            table.Rows[0].Cells.Add(new TableCell());
            table.Rows[0].Cells.Add(new TableCell());
            HtmlGenericControl txt = new HtmlGenericControl("input");

            txt.EnableViewState = false;
            txt.Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, Color);
            txt.Attributes.Add("maxlength", "15");
            txt.Attributes.Add("size", "15");
            txt.Attributes.Add("value", Color);
            txt.Attributes.Add("id", ColorInputControlClientId);
            txt.Attributes.Add("name", this.UniqueID);
            table.Rows[0].Cells[0].Controls.Add(txt);
            HtmlInputImage btn = new HtmlInputImage();

            btn.Src = Page.ClientScript.GetWebResourceUrl(typeof(ColorPicker), "Lib.Images.ColorPickerIcon.jpg");
            btn.Attributes.Add("onclick", string.Format("colorPicker.ShowColorPicker(this,document.getElementById('{0}'));return false;", ColorInputControlClientId));
            HtmlGenericControl container = new HtmlGenericControl("div");

            container.EnableViewState = false;
            container.Controls.Add(btn);
            container.Attributes.CssStyle.Add(HtmlTextWriterStyle.Position, "relative");
            container.Attributes.CssStyle.Add(HtmlTextWriterStyle.Display, "block");
            table.Rows[0].Cells[1].Controls.Add(container);
            plh.Controls.Add(table);
            plh.RenderControl(output);
        }
Esempio n. 2
0
        private void RenderPlaceHolder(SingleViewRenderingContext renderingContext, Style style, PlaceHolder placeHolder, string defaultCssClass)
        {
            ScriptUtility.Instance.RegisterElementForBorderSpans(renderingContext.Control, "#" + placeHolder.ClientID);

            string cssClass = defaultCssClass;

            if (!string.IsNullOrEmpty(style.CssClass))
            {
                cssClass = style.CssClass;
            }

            if (placeHolder.Controls.Count == 0)
            {
                cssClass += " " + CssClassEmpty;
            }

            string backupCssClass = style.CssClass;

            style.CssClass = cssClass;
            style.AddAttributesToRender(renderingContext.Writer);
            style.CssClass = backupCssClass;

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Id, placeHolder.ClientID);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassContent);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div);

            placeHolder.RenderControl(renderingContext.Writer);

            renderingContext.Writer.RenderEndTag();
            renderingContext.Writer.RenderEndTag();
        }
Esempio n. 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)
        {
            if (this.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Style, "margin-top:0;");
                writer.RenderBeginTag(HtmlTextWriterTag.H3);
                _lblGroupTypeName.Text = _tbGroupTypeName.Text;
                _lblGroupTypeName.RenderControl(writer);
                writer.RenderEndTag();

                _tbGroupTypeName.RenderControl(writer);
                _ddlGroupTypeInheritFrom.RenderControl(writer);
                _ddlAttendanceRule.RenderControl(writer);
                _ddlPrintTo.RenderControl(writer);

                _phGroupTypeAttributes.RenderControl(writer);

                writer.WriteLine("<h3>Check-in Labels</h3>");
                if (this.CheckinLabels != null)
                {
                    _gCheckinLabels.DataSource = this.CheckinLabels;
                    _gCheckinLabels.DataBind();
                }
                _gCheckinLabels.RenderControl(writer);
            }
        }
        /// <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);
                _ddlGroupRequirement.RenderControl(writer);
                _phGroupAttributes.RenderControl(writer);

                if (EnableAddLocations)
                {
                    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);
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Renders this template to the specified <see cref="HtmlTextWriter" />
        /// </summary>
        /// <param name="writer">The <see cref="HtmlTextWriter" /> to which to render.</param>
        public void Render(HtmlTextWriter writer)
        {
            if (_string != null)
            {
                writer.Write(_string);
            }
            else if (_action != null)
            {
                _action();
            }
            else if (_actionWriter != null)
            {
                _actionWriter(writer);
            }
            else if (_template != null)
            {
                PlaceHolder ph = new PlaceHolder();

                _template.InstantiateIn(ph);

                // TODO?
                //using (HtmlTextWriter w = new HtmlTextWriter(writer))
                ph.RenderControl(writer);
            }
        }
        /// <summary>
        /// Renders the base control.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl(HtmlTextWriter writer)
        {
            _etpEntityType.Visible = EntityTypePickerVisible;
            _etpEntityType.RenderControl(writer);

            _phEntityTypeEntityIdValue.RenderControl(writer);
        }
Esempio n. 7
0
        protected override void Render(HtmlTextWriter writer)
        {
            EnsureChildControls();

            //Render the main controls on the page
            ph.RenderControl(writer);

            base.Render(writer);
        }
Esempio n. 8
0
        protected string RenderHtml()
        {
            StringBuilder  SB     = new StringBuilder();
            StringWriter   SW     = new StringWriter(SB);
            HtmlTextWriter htmlTW = new HtmlTextWriter(SW);

            phcomprobantepago.RenderControl(htmlTW);
            return(SB.ToString());
        }
Esempio n. 9
0
        protected string RenderHtml()
        {
            StringBuilder  SB     = new StringBuilder();
            StringWriter   SW     = new StringWriter(SB);
            HtmlTextWriter htmlTW = new HtmlTextWriter(SW);

            phFormatoPagoVacaciones.RenderControl(htmlTW);
            return(SB.ToString());
        }
Esempio n. 10
0
        /// <summary>
        /// Generates HTML from a control template.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <returns>The generated HTML.</returns>
        public static string GenerateHtmlFromTemplate(ITemplate template)
        {
            HtmlTextWriter writer = CreateHtmlTextWriter();

            PlaceHolder ph = new PlaceHolder();

            template.InstantiateIn(ph);
            ph.RenderControl(writer);

            return(writer.InnerWriter.ToString());
        }
Esempio n. 11
0
        protected string Html_Writer(PlaceHolder reporte)
        {
            StringBuilder  SB     = new StringBuilder();
            StringWriter   SW     = new StringWriter(SB);
            HtmlTextWriter htmlTW = new HtmlTextWriter(SW);

            reporte.RenderControl(htmlTW);
            string reporteString = SB.ToString();

            return(reporteString);
        }
Esempio n. 12
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         Session.Clear();
         tiquetes.Controls.Add(new LiteralControl("<iframe id='frameDibujo' src='../aspx/AMS.Tiquete.aspx?tiqs=" + Request.QueryString["tiqs"] + "' width='700' height='600'></iframe>"));
         StringBuilder  SB     = new StringBuilder();
         StringWriter   SW     = new StringWriter(SB);
         HtmlTextWriter htmlTW = new HtmlTextWriter(SW);
         tiquetes.RenderControl(htmlTW);
         Session["Rep"] = SB.ToString();
     }
 }
Esempio n. 13
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (string.IsNullOrEmpty(FormID))
            {
                return;
            }

            EnsureChildControls();

            //Render the main controls on the page
            ph.RenderControl(writer);

            base.Render(writer);
        }
Esempio n. 14
0
        private void RenderPlaceHolder(SingleViewRenderingContext renderingContext, Style style, PlaceHolder placeHolder, string cssClass)
        {
            ScriptUtility.Instance.RegisterElementForBorderSpans(renderingContext.Control, "#" + placeHolder.ClientID + " > *:first");

            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Tr); // begin tr
            if (string.IsNullOrEmpty(style.CssClass))
            {
                if (placeHolder.Controls.Count > 0)
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
                }
                else
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass + " " + CssClassEmpty);
                }
            }
            else
            {
                if (placeHolder.Controls.Count > 0)
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, style.CssClass);
                }
                else
                {
                    renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, style.CssClass + " " + CssClassEmpty);
                }
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Td); // begin td

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Id, placeHolder.ClientID);
            style.AddAttributesToRender(renderingContext.Writer);
            if (string.IsNullOrEmpty(style.CssClass))
            {
                renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
            }
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin outer div

            renderingContext.Writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClassContent);
            renderingContext.Writer.RenderBeginTag(HtmlTextWriterTag.Div); // begin content div

            placeHolder.RenderControl(renderingContext.Writer);

            renderingContext.Writer.RenderEndTag(); // end content div
            renderingContext.Writer.RenderEndTag(); // end outer div

            renderingContext.Writer.RenderEndTag(); // end td
            renderingContext.Writer.RenderEndTag(); // end tr
        }
        protected override void Render(HtmlTextWriter writer)
        {
            writer.WriteLine("<div class=\"propertyItem\">");
            writer.WriteLine("<div class=\"propertyItemheader\">Database datatype</div>");
            writer.WriteLine("<div class=\"propertyItemContent\">");
            _dropdownlist.RenderControl(writer);
            writer.Write("</div></div>");

            writer.WriteLine("<div class=\"propertyItem\">");
            writer.WriteLine("<div class=\"propertyItemheader\">Usercontrol:</div>");
            writer.WriteLine("<div class=\"propertyItemContent\">");
            _dropdownlistUserControl.RenderControl(writer);
            writer.Write("</div></div>");

            _phSettings.RenderControl(writer);
        }
Esempio n. 16
0
        public static void ToExcel(System.Web.UI.Page p, PlaceHolder rpt)
        {
            string filename = System.IO.Path.GetFileNameWithoutExtension(
                System.Web.HttpContext.Current.Request.PhysicalPath);

            p.Response.Clear();

            p.Response.AddHeader("content-disposition", "attachment;filename=" + filename + ".xls");
            p.Response.ContentType = "application/ms-excel";

            System.IO.StringWriter       sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
            rpt.RenderControl(hw);
            p.Response.Write(sw.ToString());

            p.Response.End();
        }
Esempio n. 17
0
        protected override void Render(HtmlTextWriter output)
        {
            PlaceHolder target = new PlaceHolder();

            if (base.DesignMode || (this.Page.Header == null))
            {
                this.RegisterCSSInclude(target);
            }
            Table child = new Table();

            child.Rows.Add(new TableRow());
            child.Rows[0].Cells.Add(new TableCell());
            child.Rows[0].Cells.Add(new TableCell());

            TextBox control = new TextBox();

            control.Width     = this.Width;
            control.Height    = this.Height;
            control.CssClass  = this.CssClass;
            control.MaxLength = 15;
            control.ForeColor = System.Drawing.ColorTranslator.FromHtml(this.Color);
            control.Text      = this.Color;
            control.ID        = this.ClientID;
            child.Rows[0].Cells[0].Controls.Add(control);

            HtmlInputImage image = new HtmlInputImage();

            image.Src = GetWebResourceUrl("ColorPickerIcon.jpg");
            image.Attributes.Add("onclick", string.Format("colorPicker.ShowColorPicker(this,document.getElementById('{0}'));return false;", this.ClientID));
            HtmlGenericControl control2 = new HtmlGenericControl("div");

            control2.EnableViewState = false;
            control2.Controls.Add(image);
            control2.Attributes.CssStyle.Add(HtmlTextWriterStyle.Position, "relative");
            control2.Attributes.CssStyle.Add(HtmlTextWriterStyle.Display, "block");
            child.Rows[0].Cells[1].Controls.Add(control2);
            target.Controls.Add(child);
            target.RenderControl(output);
        }
Esempio n. 18
0
 public override void RenderControl(HtmlTextWriter writer)
 {
     writer.RenderBeginTag(HtmlTextWriterTag.Table);
     writer.RenderBeginTag(HtmlTextWriterTag.Tr);
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     GridView.RenderControl(writer);
     writer.RenderEndTag();                // td
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     writer.Write("/");
     writer.RenderEndTag();                // td
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     plcPaging.RenderControl(writer);
     writer.RenderEndTag();                // td
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     writer.Write("/");
     writer.RenderEndTag();                // td
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     litPagingSummary.RenderControl(writer);
     writer.RenderEndTag();                // td
     writer.RenderEndTag();                // tr
     writer.RenderEndTag();                // table
     lblCacheStatus.RenderControl(writer);
 }
Esempio n. 19
0
        protected static Literal renderTemplate(WebControl control, ITemplate template)
        {
            Literal content = new Literal( );

            if (null == template)
            {
                return(content);
            }
            else
            {
                PlaceHolder holder = new PlaceHolder( );
                //template.InstantiateIn ( content );
                template.InstantiateIn(holder);

                StringWriter writer = new StringWriter( );
                holder.RenderControl(new HtmlTextWriter(writer));

                content.Text = JQueryCoder.Encode(control, writer.ToString( ));
                //content.Text = JQueryCoder.Encode ( control, content.Text );
            }

            return(content);
        }
Esempio n. 20
0
            public override string GetDesignTimeHtml()
            {
                // Component is the instance of the component or control that
                // this designer object is associated with. This property is
                // inherited from System.ComponentModel.ComponentDesigner.
                string tmpS = string.Empty;

                try
                {
                    PlaceHolder DesignPlaceHolder = (PlaceHolder)Component;

                    // Capture the default output of the PlaceHolder control
                    StringWriter   writer = new StringWriter();
                    HtmlTextWriter buffer = new HtmlTextWriter(writer);
                    DesignPlaceHolder.RenderControl(buffer);
                    tmpS = writer.ToString();
                }
                catch (Exception ex)
                {
                    tmpS = this.GetErrorDesignTimeHtml(ex);
                }
                return(tmpS);
            }
Esempio n. 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)
        {
            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();
        }
Esempio n. 22
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();
        }
Esempio n. 23
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();
        }
Esempio n. 24
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();
        }
Esempio n. 25
0
 protected override void RenderContents(HtmlTextWriter writer)
 {
     _MainContener.RenderControl(writer);
     writer.Close();
 }
        /// <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();
        }
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (Extender.AdapterEnabled)
            {
                DataList dataList = Control as DataList;
                if (dataList != null)
                {
                    writer.Indent++;
                    writer.WriteLine();
                    writer.WriteBeginTag("table");
                    writer.WriteAttribute("cellpadding", "0");
                    writer.WriteAttribute("cellspacing", "0");
                    writer.WriteAttribute("summary", Control.ToolTip);
                    writer.Write(HtmlTextWriter.TagRightChar);
                    writer.Indent++;

                    if (dataList.HeaderTemplate != null)
                    {
                        PlaceHolder container = new PlaceHolder();
                        dataList.HeaderTemplate.InstantiateIn(container);
                        container.DataBind();

                        if ((container.Controls.Count == 1) && typeof(LiteralControl).IsInstanceOfType(container.Controls[0]))
                        {
                            writer.WriteLine();
                            writer.WriteBeginTag("caption");
                            writer.Write(HtmlTextWriter.TagRightChar);

                            LiteralControl literalControl = container.Controls[0] as LiteralControl;
                            writer.Write(literalControl.Text.Trim());

                            writer.WriteEndTag("caption");
                        }
                        else
                        {
                            writer.WriteLine();
                            writer.WriteBeginTag("thead");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            writer.WriteBeginTag("tr");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            writer.WriteBeginTag("th");
                            writer.WriteAttribute("colspan", RepeatColumns.ToString());
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            writer.WriteLine();
                            container.RenderControl(writer);

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("th");

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("tr");

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("thead");
                        }
                    }

                    if (dataList.FooterTemplate != null)
                    {
                        writer.WriteLine();
                        writer.WriteBeginTag("tfoot");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        writer.WriteLine();
                        writer.WriteBeginTag("tr");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        writer.WriteLine();
                        writer.WriteBeginTag("td");
                        writer.WriteAttribute("colspan", RepeatColumns.ToString());
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        PlaceHolder container = new PlaceHolder();
                        dataList.FooterTemplate.InstantiateIn(container);
                        container.DataBind();
                        container.RenderControl(writer);

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("td");

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tr");

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tfoot");
                    }

                    if (dataList.ItemTemplate != null)
                    {
                        writer.WriteLine();
                        writer.WriteBeginTag("tbody");
                        writer.Write(HtmlTextWriter.TagRightChar);
                        writer.Indent++;

                        int nItemsInColumn = (int)Math.Ceiling(((Double)dataList.Items.Count) / ((Double)RepeatColumns));
                        for (int iItem = 0; iItem < dataList.Items.Count; iItem++)
                        {
                            int nRow          = iItem / RepeatColumns;
                            int nCol          = iItem % RepeatColumns;
                            int nDesiredIndex = iItem;
                            if (dataList.RepeatDirection == RepeatDirection.Vertical)
                            {
                                nDesiredIndex = (nCol * nItemsInColumn) + nRow;
                            }

                            if ((iItem % RepeatColumns) == 0)
                            {
                                writer.WriteLine();
                                writer.WriteBeginTag("tr");
                                writer.Write(HtmlTextWriter.TagRightChar);
                                writer.Indent++;
                            }

                            writer.WriteLine();
                            writer.WriteBeginTag("td");
                            writer.Write(HtmlTextWriter.TagRightChar);
                            writer.Indent++;

                            foreach (Control itemCtrl in dataList.Items[iItem].Controls)
                            {
                                itemCtrl.RenderControl(writer);
                            }

                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("td");

                            if (((iItem + 1) % RepeatColumns) == 0)
                            {
                                writer.Indent--;
                                writer.WriteLine();
                                writer.WriteEndTag("tr");
                            }
                        }

                        if ((dataList.Items.Count % RepeatColumns) != 0)
                        {
                            writer.Indent--;
                            writer.WriteLine();
                            writer.WriteEndTag("tr");
                        }

                        writer.Indent--;
                        writer.WriteLine();
                        writer.WriteEndTag("tbody");
                    }

                    writer.Indent--;
                    writer.WriteLine();
                    writer.WriteEndTag("table");

                    writer.Indent--;
                    writer.WriteLine();
                }
            }
            else
            {
                base.RenderContents(writer);
            }
        }
Esempio n. 28
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)
        {
            string inactiveCss = _cbActivityIsComplete.Checked ? string.Empty : " workflow-activity-inactive";

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

            writer.AddAttribute("data-key", _hfActivityGuid.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
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded");
            _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.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.RenderControl(writer);

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

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

            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 (CanEdit && IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

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

            _lblStatus.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);
            if (CanEdit)
            {
                _ppAssignedToPerson.ValidationGroup = ValidationGroup;
                _ppAssignedToPerson.RenderControl(writer);
                _gpAssignedToGroup.ValidationGroup = ValidationGroup;
                _gpAssignedToGroup.RenderControl(writer);
                _ddlAssignedToRole.ValidationGroup = ValidationGroup;
                _ddlAssignedToRole.RenderControl(writer);
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(_lAssignedToPerson.Text))
                {
                    _lAssignedToPerson.RenderControl(writer);
                }
                if (!string.IsNullOrWhiteSpace(_lAssignedToGroup.Text))
                {
                    _lAssignedToGroup.RenderControl(writer);
                }
                if (!string.IsNullOrWhiteSpace(_lAssignedToRole.Text))
                {
                    _lAssignedToRole.RenderControl(writer);
                }
            }
            writer.RenderEndTag();  // col-md-4

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityIsComplete.Enabled         = CanEdit;
            _cbActivityIsComplete.ValidationGroup = ValidationGroup;
            _cbActivityIsComplete.RenderControl(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label");
            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("&nbsp;");
            writer.RenderEndTag();  // control-label
            _lState.RenderControl(writer);
            writer.RenderEndTag();  // form-group
            writer.RenderEndTag();  // col-md-6

            writer.RenderEndTag();  // row

            _phAttributes.RenderControl(writer);

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

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-table table table-condensed table-light");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            writer.RenderBeginTag(HtmlTextWriterTag.Thead);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Action");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Last Processed");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Completed");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.RenderEndTag();

            writer.RenderEndTag();  // tr
            writer.RenderEndTag();  // thead

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-formfield-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Tbody);

            foreach (WorkflowActionEditor workflowActionEditor in this.Controls.OfType <WorkflowActionEditor>())
            {
                workflowActionEditor.ValidationGroup = ValidationGroup;
                workflowActionEditor.RenderControl(writer);
            }

            writer.RenderEndTag();  // tbody

            writer.RenderEndTag();  // table

            // actions fieldset
            writer.RenderEndTag();

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

            // section tag
            writer.RenderEndTag();
        }
Esempio n. 29
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();
        }
        /// <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)
        {
            //
            // Render the panel.
            //
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, $"js-accordion-panel { CssClass }");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            {
                _hfState.RenderControl(writer);

                //
                // Render the panel heading.
                //
                writer.AddAttribute(HtmlTextWriterAttribute.Class, $"panel-heading clearfix clickable { HeaderCssClass }");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                {
                    //
                    // Render the panel title.
                    //
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-title pull-left");
                    writer.RenderBeginTag(HtmlTextWriterTag.H3);
                    {
                        if (!string.IsNullOrWhiteSpace(TitleIcon))
                        {
                            writer.Write($"<i class='{ TitleIcon }'></i> ");
                        }

                        writer.WriteEncodedText(Title);
                    }
                    writer.RenderEndTag();

                    //
                    // Render the panel header buttons.
                    //
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
                    writer.AddAttribute("style", "margin: -4px 0px -4px 0px;");
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    {
                        _additionalButtonsPlaceholder?.RenderControl(writer);

                        writer.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-xs btn-link js-accordion-panel-chevron");
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        {
                            writer.Write($"<i class='fa { ( Collapsed ? "fa-chevron-down" : "fa-chevron-up" ) }'></i>");
                        }
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();

                //
                // Render panel body.
                //
                writer.AddAttribute(HtmlTextWriterAttribute.Class, $"panel-collapse { ( Collapsed ? "collapse" : string.Empty ) }");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, $"panel-body { BodyCssClass }");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    {
                        _bodyPlaceholder.RenderControl(writer);
                    }
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();

                //
                // Render the footer if we have one.
                //
                if (_footerPlaceholder != null)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, $"panel-footer { FooterCssClass }");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    {
                        _footerPlaceholder.RenderControl(writer);
                    }
                }
            }
            writer.RenderEndTag();
        }