Ejemplo n.º 1
0
        public static ColumnFormatInfo MakeDialogButton(ButtonTypesEnum buttonType, string url, string buttonText, int?width, int?height, string title = null, string buttonID = null, bool showDialog = true, bool resizable = true, bool maxed = false)
        {
            ColumnFormatInfo rv = new ColumnFormatInfo();

            rv.FormatType = ColumnFormatTypeEnum.Dialog;
            rv.ButtonType = buttonType;
            rv.Url        = url;
            rv.Width      = width;
            rv.Height     = height;
            rv.Text       = buttonText;
            rv.Title      = title;
            rv.ButtonID   = buttonID;
            rv.ShowDialog = showDialog;
            rv.Resizable  = resizable;
            rv.Maxed      = maxed;
            return(rv);
        }
Ejemplo n.º 2
0
        public static ColumnFormatInfo MakeViewButton(ButtonTypesEnum buttonType, Guid?fileID, int?width = null, int?height = null, string title = null, string windowID = null, string buttonText = null, bool resizable = true, bool maxed = false, string buttonclass = null, string style = null)
        {
            ColumnFormatInfo rv = new ColumnFormatInfo();

            rv.FormatType  = ColumnFormatTypeEnum.ViewPic;
            rv.ButtonType  = buttonType;
            rv.FileID      = fileID;
            rv.Width       = width;
            rv.Height      = height;
            rv.WindowID    = windowID;
            rv.Text        = buttonText ?? Program._localizer["Preview"];
            rv.Title       = title ?? Program._localizer["Preview"];
            rv.Resizable   = resizable;
            rv.Maxed       = maxed;
            rv.ButtonClass = buttonclass;
            rv.Style       = style;
            return(rv);
        }
Ejemplo n.º 3
0
        public static ColumnFormatInfo MakeButton(ButtonTypesEnum buttonType, string url, string buttonText, int?width, int?height, string title = null, string buttonID = null, bool resizable = true, bool maxed = false, string buttonclass = null, RedirectTypesEnum rtype = RedirectTypesEnum.Layer)
        {
            ColumnFormatInfo rv = new ColumnFormatInfo();

            rv.FormatType  = ColumnFormatTypeEnum.Button;
            rv.ButtonType  = buttonType;
            rv.Url         = url;
            rv.Width       = width;
            rv.Height      = height;
            rv.Text        = buttonText;
            rv.Title       = title;
            rv.ButtonID    = buttonID;
            rv.Resizable   = resizable;
            rv.Maxed       = maxed;
            rv.ButtonClass = buttonclass;
            rv.RType       = rtype;
            return(rv);
        }
Ejemplo n.º 4
0
        public string MakeScriptButton(ButtonTypesEnum buttonType, string buttonText, string script = "", string buttonID = null, string url = null)
        {
            if (buttonID == null)
            {
                buttonID = Guid.NewGuid().ToString();
            }
            var    innerClick = script;
            var    click      = $"<script>$('#{buttonID}').on('click',function(){{{innerClick};return false;}});</script>";
            string rv         = "";

            if (buttonType == ButtonTypesEnum.Link)
            {
                rv = $"<a id='{buttonID}' style='color:blue;cursor:pointer'>{buttonText}</a>";
            }
            if (buttonType == ButtonTypesEnum.Button)
            {
                rv = $"<a id='{buttonID}' class='layui-btn layui-btn-primary layui-btn-xs'>{buttonText}</a>";
            }
            rv += click;
            return(rv);
        }
Ejemplo n.º 5
0
 public string MakeViewButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, int?width = null, int?height = null, string title = null, bool resizable = true, string _DONOT_USE_CS = "default", bool maxed = false, string buttonClass = null, string style = null)
 {
     return("");
 }
Ejemplo n.º 6
0
 public string MakeButton(ButtonTypesEnum buttonType, string url, string buttonText, int?width, int?height, string title = null, string buttonID = null, bool resizable = true, bool max = false, string currentdivid = "", string buttonClass = null, string style = null, RedirectTypesEnum rtype = RedirectTypesEnum.Layer)
 {
     return("");
 }
Ejemplo n.º 7
0
 public string MakeDownloadButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, string _DONOT_USE_CS = "default", string buttonClass = null, string style = null)
 {
     return("");
 }
Ejemplo n.º 8
0
 public string MakeScriptButton(ButtonTypesEnum buttonType, string url, int?width, int?height, string windowID, string buttonText, string title = null, string buttonID = null, string script = "")
 {
     return("");
 }
Ejemplo n.º 9
0
 public string MakeViewButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, int?width = null, int?height = null, string title = null, bool resizable = true)
 {
     return(MakeDialogButton(buttonType, $"/_Framework/ViewFile/{fileID}", buttonText, width, height, title, null, true, resizable));
 }
Ejemplo n.º 10
0
 public string MakeRedirectButton(ButtonTypesEnum buttonType, string url, string buttonText)
 {
     return("");
 }
Ejemplo n.º 11
0
 public string MakeDownloadButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null)
 {
     return("");
 }
Ejemplo n.º 12
0
 public string MakeViewButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, int?width = null, int?height = null, string title = null, bool resizable = true, string _DONOT_USE_CS = "default", bool maxed = false)
 {
     return(MakeDialogButton(buttonType, $"/_Framework/ViewFile/{fileID}?_DONOT_USE_CS={_DONOT_USE_CS}", buttonText, width, height, title, null, true, resizable, maxed));
 }
Ejemplo n.º 13
0
        public static void AddButtonClassAttribute(IDictionary <string, object> attributes, ButtonTypesEnum type)
        {
            string htmlClass = String.Empty;

            switch (type)
            {
            case ButtonTypesEnum.Submit:
                htmlClass = "btn btn-success";
                break;

            case ButtonTypesEnum.Cancel:
                htmlClass = "btn btn-default";
                break;
            }

            if (attributes.ContainsKey("class"))
            {
                attributes["class"] += " " + htmlClass;
            }
            else
            {
                attributes["class"] = htmlClass;
            }
        }
Ejemplo n.º 14
0
 public string MakeScriptButton(ButtonTypesEnum buttonType, string buttonText, string script = "", string buttonID = null, string url = null, string buttonClass = null, string style = null)
 {
     return("");
 }
Ejemplo n.º 15
0
 public string MakeViewButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, int?width = null, int?height = null, string title = null, bool resizable = true)
 {
     return("");
 }
Ejemplo n.º 16
0
 public string MakeDialogButton(ButtonTypesEnum buttonType, string url, string buttonText, int?width, int?height, string title = null, string buttonID = null, bool showDialog = true, bool resizable = true, bool max = false, string buttonClass = null, string style = null)
 {
     return("");
 }
Ejemplo n.º 17
0
        public static MvcHtmlString ButtonDirective(this HtmlHelper htmlHelper, string text, object htmlAttributes = null,
                                                    NgModelPathOptions ngModelPathOptions = null, ButtonTypesEnum type = ButtonTypesEnum.Submit)
        {
            var attributes = (IDictionary <string, object>)HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);

            if (!attributes.ContainsKey("ng-click"))
            {
                throw new Exception("There is no ng_click attribute passed to ButtonDirective.");
            }

            AttributeManager.AddButtonClassAttribute(attributes, type);

            attributes.Add("value", text);
            attributes.Add("type", "button");
            var builder = new TagBuilder("input");

            builder.MergeAttributes(attributes);
            return(MvcHtmlString.Create(builder.ToString()));
        }