public string Format(SlickFormatterContext ctx)
        {
            var dbFile = ctx.Value as string;

            if (string.IsNullOrEmpty(dbFile))
            {
                return("");
            }

            var downloadUrl  = DbFileUrl(dbFile);
            var originalName = !string.IsNullOrEmpty(OriginalNameProperty) ?
                               ctx.Item[OriginalNameProperty] as string : null;

            originalName = originalName ?? "";

            var text = string.Format(DisplayFormat ?? "{0}",
                                     originalName,
                                     dbFile,
                                     downloadUrl);

            return("<a class='file-download-link' target='_blank' " +
                   "href='" + Q.AttrEncode(downloadUrl) + "'>" +
                   Q.HtmlEncode(text) +
                   "</a>");
        }
Esempio n. 2
0
 public string Format(SlickFormatterContext ctx)
 {
     return "<span class='shipper-symbol shipper-" + 
         ((ctx.Value as string) ?? "").Replace(" ", "") + 
         "'>" + Q.HtmlEncode(ctx.Value) +
         "</span>";
 }
Esempio n. 3
0
        public string Format(SlickFormatterContext ctx)
        {
            if (!Script.IsValue(ctx.Value))
                return "";

            if (Q.IsTrue(ctx.Value))
                return Q.HtmlEncode(Q.TryGetText(TrueText) ?? TrueText ?? Q.TryGetText("Dialogs.YesButton") ?? "Yes");

            return Q.HtmlEncode(Q.TryGetText(FalseText) ?? FalseText ?? Q.TryGetText("Dialogs.NoButton") ?? "No");
        }
        public string Format(SlickFormatterContext ctx)
        {
            var text = Q.HtmlEncode(ctx.Value);

            if (string.IsNullOrEmpty(GenderProperty))
                return text;

            var gender = ctx.Item[GenderProperty] as Gender?;

            return "<span class='" +
                (gender == Gender.Female ? "employee-symbol female" : "employee-symbol male") +
                "'>" + text + "</span>";
        }
Esempio n. 5
0
        public string Format(SlickFormatterContext ctx)
        {
            if (!Script.IsValue(ctx.Value))
            {
                return("");
            }

            if (Q.IsTrue(ctx.Value))
            {
                return(Q.HtmlEncode(Q.TryGetText(TrueText) ?? TrueText ?? Q.TryGetText("Dialogs.YesButton") ?? "Yes"));
            }

            return(Q.HtmlEncode(Q.TryGetText(FalseText) ?? FalseText ?? Q.TryGetText("Dialogs.NoButton") ?? "No"));
        }
Esempio n. 6
0
        public string Format(SlickFormatterContext ctx)
        {
            var url = !string.IsNullOrEmpty(UrlProperty) ?
                      ((object)(ctx.Item[UrlProperty] ?? "")).ToString() :
                      ((object)(ctx.Value ?? "")).ToString();

            if (string.IsNullOrEmpty(url))
            {
                return("");
            }

            if (!string.IsNullOrEmpty(UrlFormat))
            {
                url = string.Format(UrlFormat, url);
            }

            if (url != null && url.StartsWith("~/"))
            {
                url = Q.ResolveUrl(url);
            }

            var display = !string.IsNullOrEmpty(DisplayProperty) ?
                          ((object)ctx.Item[DisplayProperty] ?? "").ToString() :
                          ((object)(ctx.Value ?? "")).ToString();

            if (!string.IsNullOrEmpty(DisplayFormat))
            {
                display = string.Format(DisplayFormat, display);
            }

            var s = "<a href='" + Q.AttrEncode(url) + "'";

            if (!string.IsNullOrEmpty(Target))
            {
                s += " target='" + Target + "'";
            }

            s += ">" + Q.HtmlEncode(display) + "</a>";

            return(s);
        }
Esempio n. 7
0
        public string Format(SlickFormatterContext ctx)
        {
            var dbFile = ctx.Value as string;

            if (string.IsNullOrEmpty(dbFile))
                return "";

            var downloadUrl = DbFileUrl(dbFile);
            var originalName = !string.IsNullOrEmpty(OriginalNameProperty) ?
                ctx.Item[OriginalNameProperty] as string : null;
            originalName = originalName ?? "";

            var text = string.Format(DisplayFormat ?? "{0}",
                originalName,
                dbFile,
                downloadUrl);

            return "<a class='file-download-link' target='_blank' " + 
                "href='" + Q.HtmlEncode(downloadUrl) + "'>" +
                Q.HtmlEncode(text) +
                "</a>";
        }
Esempio n. 8
0
 public string Format(SlickFormatterContext ctx)
 {
     return Format(ctx.Value, DisplayFormat);
 }
Esempio n. 9
0
 public string Format(SlickFormatterContext ctx)
 {
     return(Format(ctx.Value, DisplayFormat));
 }
Esempio n. 10
0
 public string Format(SlickFormatterContext ctx)
 {
     return(Format(EnumTypeRegistry.Get(EnumKey), ctx.Value));
 }
 public string Format(SlickFormatterContext ctx)
 {
     return "<span class='freight-symbol'>" +
         Q.HtmlEncode(ctx.Value) +
         "</span>";
 }
Esempio n. 12
0
 protected virtual string GetItemText(SlickFormatterContext ctx)
 {
     return(Q.HtmlEncode(ctx.Value));
 }
Esempio n. 13
0
 public string Format(SlickFormatterContext ctx)
 {
     return("<span class=\"check-box no-float readonly " + (Q.IsTrue(ctx.Value) ? " checked" : "") + "\"></span>");
 }
Esempio n. 14
0
 public string Format(SlickFormatterContext ctx)
 {
     return "<span class=\"check-box no-float readonly " + (Q.IsTrue(ctx.Value) ? " checked" : "") + "\"></span>";
 }
Esempio n. 15
0
 public string Format(SlickFormatterContext ctx)
 {
     return Format(ctx.Value);
 }