public static string LocalizedEditDeleteLinkButtons(HyperlinkAttributes attributes, int itemId, string itemName, string jsObjectName = "", bool isViewMode = false) { string editButtonCssClass = string.Empty; string deleteButtonCssClass = string.Empty; var handler = (!string.IsNullOrEmpty(jsObjectName) ? jsObjectName + "." : ""); if (!attributes.PagePermission.CanEdit) { return(LocalizedLinkButtons( LocalizedEditLinkButton(new HyperlinkAttributes() { OnClick = handler + "edit" + itemName + "Popup($(this),'" + itemId + "');", DefaultCssClass = "fa fa-eye btnView" }, isViewMode).ToString())); } return(LocalizedLinkButtons( LocalizedEditLinkButton(new HyperlinkAttributes() { OnClick = handler + "edit" + itemName + "Popup($(this),'" + itemId + "');", CssClass = editButtonCssClass }, isViewMode).ToString() + "" + LocalizedDeleteLinkButton(new HyperlinkAttributes() { OnClick = handler + "delete" + itemName + "Data($(this)," + itemId + ");", CssClass = deleteButtonCssClass }).ToString())); }
public static MvcHtmlString LocalizedLinkButton(this HtmlHelper helper, HyperlinkAttributes attributes, bool embedInPanel, bool isSmallActionButtons) { if (embedInPanel) { return(MvcHtmlString.Create(LocalizedLinkButtons(LocalizedLinkButton(attributes).ToString(), isSmallActionButtons))); } return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedEditLinkButton(HyperlinkAttributes attributes, bool isViewMode = false) { if (string.IsNullOrEmpty(attributes.DefaultCssClass)) { attributes.DefaultCssClass = "fas fa-pencil-alt btnEdit"; } attributes.TitleResourceKey = "Shared.Labels.EditRecord"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedEditLinkButton(HyperlinkAttributes attributes) { if (attributes.PagePermission.CanEdit) { attributes.DefaultCssClass = "fas fa-pencil-alt btnEdit"; attributes.TitleResourceKey = "Shared.Labels.EditRecord"; return(LocalizedLinkButton(attributes)); } else { attributes.DefaultCssClass = "fas fa-eye btnEdit"; attributes.TitleResourceKey = "Shared.Labels.View"; return(LocalizedLinkButton(attributes)); } }
public static MvcHtmlString LocalizedLinkButton(HyperlinkAttributes attributes) { TagBuilder tagBuilder = new TagBuilder("button"); // build the input tag. tagBuilder.MergeAttribute("class", "table-action-icon-btn "); if (!string.IsNullOrWhiteSpace(attributes.Id)) { tagBuilder.MergeAttribute("id", attributes.Id); } if (!string.IsNullOrWhiteSpace(attributes.CssClass)) { tagBuilder.MergeAttribute("class", attributes.CssClass); } if (!string.IsNullOrWhiteSpace(attributes.Title)) { tagBuilder.MergeAttribute("title", attributes.Title); } if (!string.IsNullOrWhiteSpace(attributes.TitleResourceKey)) { if (attributes.IsTitleFormatted) { tagBuilder.MergeAttribute("title", ResourceManager.GetStringFormatted(attributes.TitleResourceKey, attributes.TitleFormatValues)); } else { tagBuilder.MergeAttribute("title", ResourceManager.GetString(attributes.TitleResourceKey)); } } if (!string.IsNullOrEmpty(attributes.DefaultCssClass)) { tagBuilder.InnerHtml = "<i class='" + attributes.DefaultCssClass + "'></i>"; } else if (!string.IsNullOrEmpty(attributes.InnerIconCssClass)) { tagBuilder.InnerHtml = "<i class='" + attributes.InnerIconCssClass + "'></i>"; } if (!string.IsNullOrWhiteSpace(attributes.OnClick)) { tagBuilder.MergeAttribute("onclick", attributes.OnClick); } return(MvcHtmlString.Create(tagBuilder.ToString(TagRenderMode.Normal))); }
public static MvcHtmlString LocalizedViewLinkButton(string href, HyperlinkAttributes attributes) { attributes.DefaultCssClass = "fas fa-eye btnView"; attributes.TitleResourceKey = "Shared.Labels.ViewRecord"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedLinkButton(this HtmlHelper helper, HyperlinkAttributes attributes, bool embedInPanel) { return(LocalizedLinkButton(helper, attributes, embedInPanel, false)); }
public static MvcHtmlString LocalizedLinkButton(this HtmlHelper helper, HyperlinkAttributes attributes) { return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedPlusLinkButton(HyperlinkAttributes attributes) { attributes.DefaultCssClass = "fas fa-plus-circle"; attributes.TitleResourceKey = "Shared.Labels.PlusRecord"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedCancelLinkButton(HyperlinkAttributes attributes) { attributes.DefaultCssClass = "fas fa-undo-alt btnCancel"; attributes.TitleResourceKey = "Shared.Buttons.Cancel"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedOkLinkButton(HyperlinkAttributes attributes) { attributes.DefaultCssClass = "fas fa-check-circle btnOk"; attributes.TitleResourceKey = "Shared.Buttons.Ok"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedDeleteLinkButton(HyperlinkAttributes attributes) { attributes.DefaultCssClass = "far fa-trash-alt btnDelete"; attributes.TitleResourceKey = "Shared.Labels.DeleteRecord"; return(LocalizedLinkButton(attributes)); }
public static MvcHtmlString LocalizedEditLinkButton(this HtmlHelper helper, HyperlinkAttributes attributes, bool isViewMode = false) { attributes.DefaultCssClass = "fas fa-pencil-alt btnEdit"; attributes.TitleResourceKey = "Shared.Labels.EditRecord"; return(LocalizedEditLinkButton(attributes, isViewMode)); }
public static MvcHtmlString LocalizedSelectLinkButton(string href, HyperlinkAttributes attributes) { attributes.DefaultCssClass = "fas fa-angle-double-right btnSelect"; return(LocalizedLinkButton(attributes)); }