Ejemplo n.º 1
0
        public static HtmlParagragh Format(this int value, string format = "##,0",
                                           HtmlStyle trueStyle           = null,
                                           HtmlStyle falseStyle          = null,
                                           Func <int, bool> condition    = null
                                           )
        {
            HtmlStyle style;

            if (condition != null)
            {
                style = (condition(value)? trueStyle: falseStyle) ?? new HtmlStyle()
                {
                    TextAlign = "center"
                };
            }
            else
            {
                style = new HtmlStyle()
                {
                    TextAlign = "center"
                };
                if (value < 0)
                {
                    style.Color = "red";
                }
            }


            return(new HtmlParagragh()
            {
                Text = value.ToString(format),
                Style = style
            });
        }
Ejemplo n.º 2
0
 protected internal GridColumnBase()
 {
     CellStyle       = new HtmlCellStyle();
     HeaderCellStyle = new HtmlCellStyle();
     HeaderTextSytle = new HtmlStyle();
     FooterCellStyle = new HtmlCellStyle();
 }
Ejemplo n.º 3
0
        public static HtmlParagragh Format(this DateTime date, string format = "dd.MM.yyyy",
                                           HtmlStyle trueStyle             = null,
                                           HtmlStyle falseStyle            = null,
                                           Func <DateTime, bool> condition = null
                                           )
        {
            HtmlStyle style;

            if (condition != null)
            {
                style = (condition(date)? trueStyle: falseStyle) ?? new HtmlStyle()
                {
                    TextAlign = "center"
                };
            }
            else
            {
                style = new HtmlStyle()
                {
                    TextAlign = "center"
                }
            };

            return(new HtmlParagragh()
            {
                Text = date != default(DateTime)? date.ToString(format):"",
                Style = style
            });
        }
Ejemplo n.º 4
0
 public static HtmlParagragh Format(this DateTime?date, string format = "dd.MM.yyyy",
                                    HtmlStyle trueStyle             = null,
                                    HtmlStyle falseStyle            = null,
                                    Func <DateTime, bool> condition = null)
 {
     return
         (Format((date.HasValue)? date.Value:default(DateTime),
                 format, trueStyle, falseStyle, condition));
 }
Ejemplo n.º 5
0
		public static HtmlParagragh Format(this bool value, string trueValue="Yes", string falseValue="No",
		                                   HtmlStyle trueStyle=null, 
		                                   HtmlStyle falseStyle=null){
			HtmlStyle style = (value? trueStyle: falseStyle)?? new HtmlStyle(){TextAlign="center" };

			return new HtmlParagragh{
				Style=style,
				Text= value? trueValue: falseValue
			};
		}
Ejemplo n.º 6
0
		public static HtmlParagragh Format(this bool? value, string trueValue="Yes", string falseValue="No",
		                                   HtmlStyle trueStyle=null, 
		                                   HtmlStyle falseStyle=null){

			if(value.HasValue) return Format (value.Value,trueValue, falseValue, trueStyle,falseStyle);

			return new HtmlParagragh(){
				Text="",
				Style=falseStyle?? new HtmlStyle(){TextAlign="center" }
			};
		}
Ejemplo n.º 7
0
		public static HtmlParagragh Format(this decimal? value, string format="##,0.00", 
		                             HtmlStyle trueStyle=null, 
		                             HtmlStyle falseStyle=null,
		                             Func<decimal,bool> condition=null
		                             )
		{
			if(value.HasValue) return Format(value.Value, format,trueStyle, falseStyle, condition);

			return new HtmlParagragh(){
				Text="",
				Style=falseStyle?? new HtmlStyle(){TextAlign="right" }
			};
		}
Ejemplo n.º 8
0
        public static HtmlParagragh Format(this bool value, string trueValue = "Yes", string falseValue = "No",
                                           HtmlStyle trueStyle  = null,
                                           HtmlStyle falseStyle = null)
        {
            HtmlStyle style = (value? trueStyle: falseStyle) ?? new HtmlStyle()
            {
                TextAlign = "center"
            };

            return(new HtmlParagragh {
                Style = style,
                Text = value? trueValue: falseValue
            });
        }
Ejemplo n.º 9
0
        public static HtmlParagragh Format(this bool?value, string trueValue = "Yes", string falseValue = "No",
                                           HtmlStyle trueStyle  = null,
                                           HtmlStyle falseStyle = null)
        {
            if (value.HasValue)
            {
                return(Format(value.Value, trueValue, falseValue, trueStyle, falseStyle));
            }

            return(new HtmlParagragh()
            {
                Text = "",
                Style = falseStyle ?? new HtmlStyle()
                {
                    TextAlign = "center"
                }
            });
        }
Ejemplo n.º 10
0
        public static HtmlParagragh Format(this decimal?value, string format = "##,0.00",
                                           HtmlStyle trueStyle            = null,
                                           HtmlStyle falseStyle           = null,
                                           Func <decimal, bool> condition = null
                                           )
        {
            if (value.HasValue)
            {
                return(Format(value.Value, format, trueStyle, falseStyle, condition));
            }

            return(new HtmlParagragh()
            {
                Text = "",
                Style = falseStyle ?? new HtmlStyle()
                {
                    TextAlign = "right"
                }
            });
        }
Ejemplo n.º 11
0
		public static HtmlParagragh Format(this decimal value, string format="##,0.00", 
		                             HtmlStyle trueStyle=null, 
		                             HtmlStyle falseStyle=null,
		                             Func<decimal,bool> condition=null
		                             )
		{
			HtmlStyle style;

			if( condition!=null){
				style= (condition(value)? trueStyle: falseStyle )??new HtmlStyle(){TextAlign="right" };
			}
			else{
				style =  new HtmlStyle(){TextAlign="right" };
				if(value<0) style.Color="red";
			}

			return new HtmlParagragh(){
				Text=  value.ToString(format),
				Style= style
			};
		}
Ejemplo n.º 12
0
		public HtmlLink():base("a"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 13
0
		public HtmlSpan():base("span"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 14
0
		public static HtmlParagragh Format (this DateTime date, string format="dd.MM.yyyy", 
		                             HtmlStyle trueStyle=null, 
		                             HtmlStyle falseStyle=null,
		                             Func<DateTime,bool> condition=null
		                             )
		{
			HtmlStyle style;

			if( condition!=null){
				style= (condition(date)? trueStyle: falseStyle )??new HtmlStyle(){TextAlign="center" };
			}
			else
				style =  new HtmlStyle(){TextAlign="center"};

			return new HtmlParagragh(){
				Text= date!=default(DateTime)? date.ToString(format):"",
				Style= style
			};
		}
Ejemplo n.º 15
0
 public HtmlLink() : base("a")
 {
     Style = new HtmlStyle();
 }
Ejemplo n.º 16
0
 public HtmlSpan() : base("span")
 {
     Style = new HtmlStyle();
 }
Ejemplo n.º 17
0
		public HtmlParagragh():base("p"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 18
0
 public HtmlParagragh() : base("p")
 {
     Style = new HtmlStyle();
 }
Ejemplo n.º 19
0
		public static HtmlParagragh Format (this DateTime? date, string format="dd.MM.yyyy",
		                             HtmlStyle trueStyle=null, 
		                             HtmlStyle falseStyle=null,
		                             Func<DateTime,bool> condition=null){
			return 
				Format((date.HasValue)? date.Value:default(DateTime),
				       format,  trueStyle, falseStyle, condition  );
				
		}