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>");
        }
Ejemplo n.º 2
0
 public string Format(SlickFormatterContext ctx)
 {
     return "<span class='shipper-symbol shipper-" + 
         ((ctx.Value as string) ?? "").Replace(" ", "") + 
         "'>" + Q.HtmlEncode(ctx.Value) +
         "</span>";
 }
Ejemplo 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>";
        }
Ejemplo 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"));
        }
Ejemplo 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);
        }
Ejemplo 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>";
        }
Ejemplo n.º 8
0
 public string Format(SlickFormatterContext ctx)
 {
     return Format(ctx.Value, DisplayFormat);
 }
Ejemplo n.º 9
0
 public string Format(SlickFormatterContext ctx)
 {
     return(Format(ctx.Value, DisplayFormat));
 }
Ejemplo 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>";
 }
Ejemplo n.º 12
0
 protected virtual string GetItemText(SlickFormatterContext ctx)
 {
     return(Q.HtmlEncode(ctx.Value));
 }
Ejemplo n.º 13
0
 public string Format(SlickFormatterContext ctx)
 {
     return("<span class=\"check-box no-float readonly " + (Q.IsTrue(ctx.Value) ? " checked" : "") + "\"></span>");
 }
Ejemplo n.º 14
0
 public string Format(SlickFormatterContext ctx)
 {
     return "<span class=\"check-box no-float readonly " + (Q.IsTrue(ctx.Value) ? " checked" : "") + "\"></span>";
 }
Ejemplo n.º 15
0
 public string Format(SlickFormatterContext ctx)
 {
     return Format(ctx.Value);
 }