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); }
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); }
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); }
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); }
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(""); }
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(""); }
public string MakeDownloadButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, string _DONOT_USE_CS = "default", string buttonClass = null, string style = null) { return(""); }
public string MakeScriptButton(ButtonTypesEnum buttonType, string url, int?width, int?height, string windowID, string buttonText, string title = null, string buttonID = null, string script = "") { return(""); }
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)); }
public string MakeRedirectButton(ButtonTypesEnum buttonType, string url, string buttonText) { return(""); }
public string MakeDownloadButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null) { return(""); }
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)); }
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; } }
public string MakeScriptButton(ButtonTypesEnum buttonType, string buttonText, string script = "", string buttonID = null, string url = null, string buttonClass = null, string style = null) { return(""); }
public string MakeViewButton(ButtonTypesEnum buttonType, Guid fileID, string buttonText = null, int?width = null, int?height = null, string title = null, bool resizable = true) { return(""); }
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(""); }
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())); }