Beispiel #1
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.HtmlEncode(url) + "'";

            if (!string.IsNullOrEmpty(Target))
                s += " target='" + Target + "'";
            
            s += ">" + Q.HtmlEncode(display) + "</a>";

            return s;
        }
Beispiel #2
0
 public string Format(SlickFormatterContext ctx)
 {
     return("<span class='shipper-symbol shipper-" +
            ((ctx.Value as string) ?? "").Replace(" ", "") +
            "'>" + Q.HtmlEncode(ctx.Value) +
            "</span>");
 }
Beispiel #3
0
        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>");
        }
Beispiel #4
0
        private string InputFormatter(SlickFormatterContext ctx)
        {
            var klass   = "edit";
            var item    = (ProductRow)ctx.Item;
            var pending = pendingChanges[item.ProductID.Value];

            if (pending != null && Script.IsValue(pending.As <dynamic>()[ctx.Column.Field]))
            {
                klass += " dirty";
            }

            double?value = GetEffectiveValue(item, ctx.Column.Field);

            return
                ("<input type='text'" +
                 " class='" + klass + "'" +
                 " value='" + Q.FormatNumber(value, "0.##") + "'" +
                 "/>");
        }
Beispiel #5
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);
        }
Beispiel #6
0
 public string Format(SlickFormatterContext ctx)
 {
     return("<a href='" + Q.HtmlEncode(ctx.Value) + "'>" +
            Q.HtmlEncode(ctx.Value) +
            "</a>");
 }
Beispiel #7
0
 public string Format(SlickFormatterContext ctx)
 {
     return "<a href='" + Q.HtmlEncode(ctx.Value) + "'>" +
         Q.HtmlEncode(ctx.Value) +
         "</a>";
 }
Beispiel #8
0
 public string Format(SlickFormatterContext ctx)
 {
     return("<span class='freight-symbol'>" +
            Q.HtmlEncode(ctx.Value) +
            "</span>");
 }
 public string Format(SlickFormatterContext ctx)
 {
     throw new NotImplementedException();
 }
 public string Format(SlickFormatterContext ctx)
 {
     throw new NotImplementedException();
 }