Beispiel #1
0
        public static string RenderControlClose(string help, TypeControlForm typeControl, bool multipleControls = true)
        {
            string control = "";

            if (control.Length > 0)
            {
                control = "<span class='help-block'>" + help + "<span>";
            }

            if (typeControl == TypeControlForm.Default)
            {
                control += "</div>";

                if (multipleControls)
                {
                    control += "</div></div>";
                }
            }
            else if (typeControl == TypeControlForm.Inline)
            {
                control += "</div></div>";
            }

            return(control);
        }
Beispiel #2
0
        public static string RenderControlOpen(string label, string controlID, TypeControlForm typeControl, bool multipleControls = true, bool obrigatoriovazio = false, string tooltip = "")
        {
            string control = string.Empty;

            if (typeControl == TypeControlForm.Default)
            {
                if (!obrigatoriovazio)
                {
                    control = string.Format(@"
                    <div class='form-group'>
                        <label class='control-label' for='{0}'{1}>{2}{3}</label>",
                                            controlID,
                                            string.IsNullOrWhiteSpace(tooltip) ? "" : string.Format(" data-toggle='tooltip' data-placement='bottom' title='{0}'", tooltip),
                                            string.IsNullOrWhiteSpace(tooltip) ? "" : "<i class='fas fa-question-circle'></i>",
                                            label);
                }
                else
                {
                    control = string.Format(@"
                    <div class='form-group has-error'>
                        <label class='control-label' for='{0}'{1}>{2}{3}</label>",
                                            controlID,
                                            string.IsNullOrWhiteSpace(tooltip) ? "" : string.Format(" data-toggle='tooltip' data-placement='bottom' title='{0}'", tooltip),
                                            string.IsNullOrWhiteSpace(tooltip) ? "" : "<i class='fas fa-question-circle'></i>",
                                            label);
                }

                if (multipleControls)
                {
                    control += string.Format(@"<div class='controls'><div class='input-group col-sm-12'>");
                }
            }
            else if (typeControl == TypeControlForm.Inline)
            {
                control = string.Format(@"
                <div class='form-group'>
                    <label class='col-sm-auto control-label verticalAlignCenter' for='{0}'>{1}</label>
                    <div class='col-sm-auto verticalAlignCenter'>
                        ", controlID, label);
            }
            return(control);
        }