public static MvcHtmlString EarlyWarningOperationButton(this HtmlHelper helper, string url, EarlyWarningCheckAccess.Operation operation, string text = "", string ccsClass = "", string dataButtontype = "", string id = "") { var user = (UserIdentity)HttpContext.Current.User.Identity; var checkAccessHelper = DependencyResolver.Current.GetService<IEarlyWarningCheckAccess>(); var dbUser = checkAccessHelper.Storage.GetDBUser(user.Profile.UserName).CustomSid; var html = string.Empty; if (checkAccessHelper.CheckAccess(operation, dbUser)) { html = "<a href=" + url; if (ccsClass != "") { html += " class=" + ccsClass; } if (id != "") { html += " id=" + id; } if (dataButtontype != "") { html += " data-buttontype=" + dataButtontype; } if(text!="") { html += " >" + text + "</a>"; } else { html += " ></a>"; } } return MvcHtmlString.Create(html); }
public static MvcHtmlString EarlyWarningOperationMenuItem(this HtmlHelper helper, string url, EarlyWarningCheckAccess.Operation operation, string text = "", string ccsClass = "", string dataButtontype = "") { var user = (UserIdentity)HttpContext.Current.User.Identity; var checkAccessHelper = DependencyResolver.Current.GetService<IEarlyWarningCheckAccess>(); var dbUser = checkAccessHelper.Storage.GetDBUser(user.Profile.UserName).CustomSid; var html = string.Empty; if (checkAccessHelper.CheckAccess(operation, dbUser)) { html = @"<a data-buttontype=" + dataButtontype + " class=" + ccsClass + " href=" + url + ">" + text + "</a>"; } return MvcHtmlString.Create(html); }