コード例 #1
0
 public static IHtmlString KIndexIcon(this HtmlHelper htmlHelper, Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues label,
                                      string style, bool showNone = false, string title = "")
 {
     System.Security.Principal.IPrincipal user = htmlHelper.ViewContext.RequestContext.HttpContext.User;
     if (ShowKIndex(user))
     {
         return(htmlHelper.Raw(Lib.Analysis.KorupcniRiziko.KIndexData.KindexImageIcon(label, style, showNone, title)));
     }
     else
     {
         return(htmlHelper.Raw(""));
     }
 }
コード例 #2
0
        public static IHtmlString KIndexLabelLink(this HtmlHelper htmlHelper, string ico,
                                                  Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues label,
                                                  string style, bool showNone = false, int?rok = null, bool linkToKindex = false)
        {
            if (string.IsNullOrEmpty(ico))
            {
                return(htmlHelper.Raw(""));
            }

            System.Security.Principal.IPrincipal user = htmlHelper.ViewContext.RequestContext.HttpContext.User;
            if (ShowKIndex(user))
            {
                if (linkToKindex)
                {
                    if (label != Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues.None || showNone)
                    {
                        if (label == Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues.None)
                        {
                            return(htmlHelper.KIndexIcon(label, style, showNone));
                        }
                        else
                        {
                            return(htmlHelper.Raw($"<a href='/kindex/detail/{ico}{(rok.HasValue ? "?rok=" + rok.Value : "")}'>"
                                                  + KIndexIcon(htmlHelper, label, style, showNone).ToHtmlString()
                                                  + "</a>"));
                        }
                    }
                }
                else
                {
                    if (label != Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues.None || showNone)
                    {
                        if (label == Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues.None)
                        {
                            return(htmlHelper.KIndexIcon(label, style, showNone));
                        }
                        else
                        {
                            return(htmlHelper.Raw($"<a href='/Subjekt/{ico}'>"
                                                  + KIndexIcon(htmlHelper, label, style, showNone).ToHtmlString()
                                                  + "</a>"));
                        }
                    }
                }
            }
            return(htmlHelper.Raw(""));
        }
コード例 #3
0
        public static IHtmlString KIndexLabelLink(this HtmlHelper htmlHelper, string ico, string style, bool showNone = false, int?rok = null, bool linkToKindex = false)
        {
            if (string.IsNullOrEmpty(ico))
            {
                return(htmlHelper.Raw(""));
            }

            ico = HlidacStatu.Util.ParseTools.NormalizeIco(ico);
            System.Security.Principal.IPrincipal user = htmlHelper.ViewContext.RequestContext.HttpContext.User;
            if (ShowKIndex(user))
            {
                var kidx = Lib.Analysis.KorupcniRiziko.KIndex.Get(ico);
                if (kidx == null)
                {
                    kidx = Lib.Analysis.KorupcniRiziko.KIndexData.Empty(ico);
                }
                var ann = kidx.ForYear(rok ?? Lib.Analysis.KorupcniRiziko.Consts.CalculationYears.Max());


                Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues lbl = ann.KIndexLabel;
                return(htmlHelper.KIndexLabelLink(ico, lbl, style, showNone, rok, linkToKindex: linkToKindex));
            }
            return(htmlHelper.Raw(""));
        }
コード例 #4
0
 public static IHtmlString KIndexIcon(this HtmlHelper htmlHelper, Lib.Analysis.KorupcniRiziko.KIndexData.KIndexLabelValues label,
                                      int heightInPx = 15, string hPadding = "3px", string vPadding = "0", bool showNone = false)
 {
     return(htmlHelper.KIndexIcon(label, $"padding:{vPadding} {hPadding};height:{heightInPx}px;width:auto", showNone));
 }