예제 #1
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     if (montagroup)
     {
         writer.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.label : this.label, this.ID, TypeControl));
         this.CssClass = "form-control " + this.CssClass;
         base.Render(writer);
         writer.Write(ComponentUtils.RenderControlClose(help, TypeControl));
     }
     else
     {
         base.Render(writer);
     }
 }
예제 #2
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     CssClass = "form-control " + CssClass;
     if (montagroup)
     {
         writer.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.label : this.label, this.ID, TypeControl, false, ObrigatorioVazio, ToolTip));
         Attributes.Add("data-control-required", campoobrigatorio.ToString());
         base.Render(writer);
         writer.Write(ComponentUtils.RenderControlClose(help, TypeControl, false));
     }
     else
     {
         base.Render(writer);
     }
 }
예제 #3
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.Label : this.Label, this.ID, TypeControl, true, false, ToolTip));
            }

            if (Template == CheckBoxTemplate.Default)
            {
                writer.Write("<div class='celebreInput'>");
                base.Render(writer);
                writer.Write("</div>");
            }
            else if (Template == CheckBoxTemplate.Switch)
            {
                //writer.Write("<label class='switch {0}'>", CheckboxStyle.GetStringValueClass());
                this.InputAttributes.Add("data-control", "Switch");

                if (CheckboxStyle != CheckBoxStyle.Default)
                {
                    this.InputAttributes.Add("data-on-color", CheckboxStyle.GetStringValueClass());
                }

                this.InputAttributes.Add("data-on-text", CheckedLabel);
                this.InputAttributes.Add("data-off-text", UncheckedLabel);
                this.Text = "";

                if (!string.IsNullOrWhiteSpace(OnClientChangeFunction))
                {
                    this.InputAttributes.Add("data-client-change", OnClientChangeFunction);
                }

                if (AutoPostBack)
                {
                    this.InputAttributes.Add("onSwitchChange", "true");
                }

                base.Render(writer);
            }

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlClose(Help, TypeControl));
            }
        }
예제 #4
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            MaxLength = 10;

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.label : this.label, this.ID, TypeControl, !string.IsNullOrEmpty(cssimage), ObrigatorioVazio, ToolTip));
            }

            writer.Write("<div class=\"controls\">");
            writer.Write("<div class=\"input-group col-sm-12\" data-control=\"DatePicker\">");
            base.Render(writer);
            writer.Write("<span class=\"input-group-addon\"><i class=\"far fa-calendar-alt\"></i></span></div></div>");

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlClose(help, TypeControl, !string.IsNullOrEmpty(cssimage)));
            }
        }
예제 #5
0
        protected override void Render(HtmlTextWriter output)
        {
            if (montagroup)
            {
                output.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.Label : this.Label, this.ID, TypeControl, true, false, ToolTip));
            }

            string scriptAjustaSelect = String.Format("AjustaTextSearch('{0}_select','{0}');", this.ClientID);

            String scriptClickChange = Page.ClientScript.GetPostBackEventReference(this, RaiseEvents.OnClickChangeEvent.ToString());

            scriptClickChange = scriptClickChange.Replace("'OnClickChangeEvent'", "'OnClickChangeEvent***'+$(this).val()");

            output.Write("<span class='input-group-addon controlClickable'{0}{1}><i class='{2} {3}'></i></span>",
                         this.Enabled ? String.Format(" onclick=\"{0}{1};\"", scriptAjustaSelect, scriptClickChange) : "",
                         this.Enabled ? "" : " disabled='disabled'",
                         FontAwesomeType.Solid.GetStringValueClass(),
                         FontAwesomeIcons.Find.GetStringValueClass());


            String scriptChange = Page.ClientScript.GetPostBackEventReference(this, RaiseEvents.OnChangeEvent.ToString());

            scriptChange = scriptChange.Replace("'OnChangeEvent'", "'OnChangeEvent***'+$(this).val()");

            CssClass = "form-control " + this.CssClass;
            Attributes["onkeydown"]             = "KeyDownTextSearch(event,this);";
            Attributes["onchange"]              = String.Format("{0}{1}", scriptAjustaSelect, scriptChange);
            Attributes["data-change"]           = String.Format("{0}{1}", scriptAjustaSelect, scriptChange);
            Attributes["autocomplete"]          = "off";
            Attributes["data-lasttext"]         = Text;
            Attributes["data-control-required"] = campoobrigatorio.ToString();
            Attributes["data-control"]          = "TextSearch";
            Attributes["data-value"]            = Value;

            base.Render(output);

            if (GroupButtons.Count > 0)
            {
                if (GroupButtons.Count(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Right) > 0)
                {
                    output.Write("<div class='input-group-btn'>");

                    foreach (var btn in GroupButtons.Where(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Right))
                    {
                        btn.RenderControl(output);
                    }

                    output.Write("</div>");
                }

                //output.Write("</div>");
            }

            if (!String.IsNullOrWhiteSpace(PathOpenRegistry) && !String.IsNullOrWhiteSpace(this.Value))
            {
                string param = String.Format("FormMode={0}&PKey={1}&{1}={2}",
                                             Celebre.Web.Pages.ManutPage.FormPageMode.Edit.ToString(),
                                             PathOpenRegistryKey,
                                             this.Value);

                string[] auxPath = PathOpenRegistry.Split(new char[] { '/' });
                Celebre.FrameWork.Seg.TransacaoPagina transacaoPagina = new Celebre.FrameWork.Seg.TransacaoPagina();
                transacaoPagina.NrSeqGrupoEmpresa = Celebre.FrameWork.Seg.Sessao.GetInstance().NrSeqGrupoEmpresa;
                transacaoPagina.NoPaginaweb       = auxPath[auxPath.Length - 1];
                transacaoPagina.Localizar();

                if (transacaoPagina.NrSeqTransacao > 0)
                {
                    FrameWork.Seg.Transacao trans = transacaoPagina.Transacao;

                    string selecao    = "";
                    string manutencao = "";

                    if (System.Configuration.ConfigurationManager.AppSettings.AllKeys.Contains("ApplicationSubPath"))
                    {
                        selecao    = string.Format("parent.$('#celebreMasterTabs').celebreTabs('addWithInner','{0}', '../Sistema/{1}/{2}','{3}','SELPAGE','Seleção');", trans.NoTransacao, trans.NoDirFonte, trans.TransacaoPaginaPrincipal.NoPaginaweb, System.Configuration.ConfigurationManager.AppSettings["ApplicationSubPath"]);
                        manutencao = string.Format("parent.$('#celebreMasterTabs').celebreTabs('addInnerTab','_SISTEMA_{0}_{1}', '../Sistema/{0}/{2}?{3}','MANUTPAGE','Manutenção',undefined,'{4}');", trans.NoDirFonte, trans.TransacaoPaginaDestino.NoPaginaweb.ToUpper().Replace("_ITEM.ASPX", ""), trans.TransacaoPaginaDestino.NoPaginaweb, param, System.Configuration.ConfigurationManager.AppSettings["ApplicationSubPath"]);
                    }
                    else
                    {
                        selecao    = string.Format("parent.$('#celebreMasterTabs').celebreTabs('addWithInner','{0}', '../Sistema/{1}/{2}','{3}','SELPAGE','Seleção');", trans.NoTransacao, trans.NoDirFonte, trans.TransacaoPaginaPrincipal.NoPaginaweb, "");
                        manutencao = string.Format("parent.$('#celebreMasterTabs').celebreTabs('addInnerTab','_SISTEMA_{0}_{1}', '../Sistema/{0}/{2}?{3}','MANUTPAGE','Manutenção',undefined,'{4}');", trans.NoDirFonte, trans.TransacaoPaginaDestino.NoPaginaweb.ToUpper().Replace("_ITEM.ASPX", ""), trans.TransacaoPaginaDestino.NoPaginaweb, param, "");
                    }



                    output.Write("<span class='input-group-addon controlClickable' style='border-left: 0;'{0}{1}><i class='{2} {3}'></i></span>",
                                 //Enabled ? String.Format(" onclick=\"{0}{1}\"", selecao, manutencao) : "",
                                 String.Format(" onclick=\"{0}{1}\"", selecao, manutencao),
                                 //Enabled ? "" : " disabled='disabled'",
                                 Enabled ? "" : "",
                                 FontAwesomeType.Solid.GetStringValueClass(),
                                 FontAwesomeIcons.FolderOpen.GetStringValueClass());
                }
                else
                {
                    Util.Log.Write(new CelebreException($"Transação Página não existe na base {auxPath[auxPath.Length - 1]}"));
                }
            }

            if (!String.IsNullOrWhiteSpace(PathAddValue))
            {
                output.Write("<span class='input-group-addon controlClickable'{0}{1}><i class='{2} {3}'></i></span>",
                             Enabled ? String.Format("onclick='OpenAddModal(\"{0}\",\"../{1}\",\"{2}\")'", ClientID, PathAddValue, Page.ResolveClientUrl("~/Includes/images/loader.gif")) : "",
                             Enabled ? "" : " disabled='disabled'",
                             FontAwesomeType.Regular.GetStringValueClass(),
                             FontAwesomeIcons.FileText.GetStringValueClass());
            }

            if (this.Itens != null && this.Itens.Count > 1)
            {
                output.Write("<div id='{0}_select' name='{0}_select' class='TextSearchSelectList' style='position:absolute;z-index:99;left:0;{1}'><ul>", this.ClientID, this.Itens.Count > 6 ? "height:150px;" : "");
                int index = 1;
                foreach (var item in this.Itens)
                {
                    output.Write("<li tabindex=\"{0}\" data-val=\"{1}\" onclick=\"{3}\" >{2}</li>", index, item.Value, item.Text, Page.ClientScript.GetPostBackEventReference(this, String.Format("{0}***{1}***{2}", RaiseEvents.OnSelectValueChanged.ToString(), item.Value, item.Text)));
                    index++;
                }
                output.Write("</ul></div>");

                ScriptManager.RegisterStartupScript(this, this.GetType(), "AjustaTextSearchAux", String.Format("AjustaTextSearchAux('{0}_select','{0}');", this.ClientID), true);
            }

            if (montagroup)
            {
                output.Write(ComponentUtils.RenderControlClose(Help, TypeControl, true));
            }
        }
예제 #6
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.CssClass = "form-control " + this.CssClass;

            StringBuilder sb = new StringBuilder();

            Attributes.Add("autocomplete", AutoComplete ? "on" : "off");

            if (this.HasEvent("EventTextChanged"))
            {
                this.AutoPostBack = true;
            }

            if (Mask != MaskTextBox.NaoDefinido)
            {
                if (Mask == MaskTextBox.Decimal || Mask == MaskTextBox.Integer)
                {
                    Attributes.Add("data-control-allownegative", AllowNegativeValues.ToString());

                    if (Mask == MaskTextBox.Decimal && DecimalPlaces > 0)
                    {
                        Attributes.Add("data-control-decimalplaces", DecimalPlaces.ToString());
                    }
                }

                this.Attributes.Add("data-control", Mask.ToString());
            }

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlOpen(this.campoobrigatorio ? "*" + this.label : this.label, this.ID, TypeControl, TextBoxIcon != FontAwesomeIcons.NotSet, ObrigatorioVazio, ToolTip));
            }

            base.Attributes.Add("data-control-required", campoobrigatorio.ToString());

            if (TextBoxIcon != FontAwesomeIcons.NotSet)
            {
                writer.Write("<span class=\"input-group-addon\"><i class=\"{0} {1}\"></i></span>", TextBoxIconType.GetStringValueClass(), TextBoxIcon.GetStringValueClass());
                base.Render(writer);
            }
            else
            {
                if (GroupButtons.Count > 0)
                {
                    writer.Write("<div class='input-group'>");

                    if (GroupButtons.Count(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Left) > 0)
                    {
                        writer.Write("<div class='input-group-btn'>");

                        foreach (var btn in GroupButtons.Where(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Left))
                        {
                            btn.RenderControl(writer);
                        }

                        writer.Write("</div>");
                    }
                }


                base.Render(writer);

                if (GroupButtons.Count > 0)
                {
                    if (GroupButtons.Count(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Right) > 0)
                    {
                        writer.Write("<div class='input-group-btn'>");

                        foreach (var btn in GroupButtons.Where(p => p.ButtonPosition == InputGroupButton.InputGroupButtonPosition.Right))
                        {
                            btn.RenderControl(writer);
                        }

                        writer.Write("</div>");
                    }

                    writer.Write("</div>");
                }
            }

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlClose(help, TypeControl, TextBoxIcon != FontAwesomeIcons.NotSet));
            }
        }
예제 #7
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            string cssclass = " " + this.CssClass;

            CssClass = string.Empty;

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlOpen("", this.ID, TypeControlForm.Default));
            }

            if (DataValue != null && DataValue.Count > 0)
            {
                Attributes.Add("data-values", string.Join(";", DataValue.Select(x => x.Key + "=" + x.Value).ToArray()));
            }

            if (ButtonType == ButtonType.Default)
            {
                if (ToolBarButton)
                {
                    this.CssClass = "btn btn-default ";
                }
                else
                {
                    this.CssClass += ButtonStyle.GetStringValueClass() + " ";
                }
            }
            else if (ButtonType == ButtonType.QuickButton)
            {
                this.CssClass  = "quick-button ";
                this.CssClass += ButtonStyle.GetStringValueClass() + " ";
            }
            else if (ButtonType == ButtonType.Inline)
            {
                CssClass  = ButtonStyle.GetStringValueClass() + " btn-inline ";
                CssClass += cssclass;
            }

            if (ButtonSize != ButtonSize.NotSet)
            {
                this.CssClass += ButtonSize.GetStringValueClass() + " ";
            }

            if (!String.IsNullOrWhiteSpace(this.ToolTip))
            {
                this.Attributes.Add("data-toggle", "tooltip");
                this.Attributes.Add("title", this.ToolTip);
                this.Attributes.Add("data-placement", "bottom");

                this.ToolTip = string.Empty;
            }

            //Prevent Double Click
            this.Attributes.Add("AllowDoubleClick", AllowDoubleClick.ToString().ToLower());

            if (!String.IsNullOrWhiteSpace(this.ModalName))
            {
                this.Attributes.Add("data-toggle", "modal");
                this.Attributes.Add("data-target", string.Format("#{0}", this.ModalName));
                this.OnClientClick += $"$('#{ModalName}_OpenedModal').val('true');$('#{ModalName}').one('shown.bs.modal', function (e) {{modalAutoPositioning()}});return false;";
            }
            else if (!String.IsNullOrWhiteSpace(PathAddValue))
            {
                this.OnClientClick += String.Format("OpenAddModal(\"{0}\",\"../{1}\",\"{2}\");return false;", this.ClientID, PathAddValue, Page.ResolveClientUrl("~/Includes/images/loader.gif"));
            }

            this.UseSubmitBehavior = false;
            this.CssClass         += cssclass;

            if (!string.IsNullOrWhiteSpace(NotificationValue))
            {
                CssClass += " btn-notification";
            }

            if (GroupButtons.Count(p => p.Visible) > 0)
            {
                writer.Write("<div class='btn-group'>");
            }

            base.Render(writer);

            if (GroupButtons.Count(p => p.Visible) > 0)
            {
                writer.Write("<button type='button' class='btn {0} dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>", ToolBarButton ? "btn-default" : ButtonStyle.GetStringValueClass());
                writer.Write("<span class='caret'></span><span class='sr-only'>Toggle Dropdown</span></button>");
                writer.Write("<ul class='dropdown-menu'>");

                foreach (var item in GroupButtons.Where(p => p.Visible))
                {
                    writer.Write("<li><a href='javascript:void(0)' onclick='__doPostBack(\"{0}\",\"\")'>{1}</a></li>", item.ID, item.Text);
                }

                writer.Write("</ul>");
                writer.Write("</div>");
            }

            if (montagroup)
            {
                writer.Write(ComponentUtils.RenderControlClose("", TypeControlForm.Default));
            }
        }