public static HtmlParagragh HtmlFormat(this bool value, string trueValue="Yes", string falseValue="No", HtmlStyle styleIf=null, HtmlStyle styleElse=null){ HtmlStyle style = (value? styleIf: styleElse)?? new HtmlStyle(){TextAlign="center" }; return new HtmlParagragh{ Style=style, Text= value? trueValue: falseValue }; }
public static HtmlParagragh HtmlFormat(this bool? value, string trueValue="Yes", string falseValue="No", HtmlStyle styleIf=null, HtmlStyle styleElse=null){ if(value.HasValue) return HtmlFormat (value.Value,trueValue, falseValue, styleIf,styleElse); return new HtmlParagragh(){ Text="", Style=styleElse?? new HtmlStyle(){TextAlign="center" } }; }
public static HtmlParagragh HtmlFormat(this decimal? value, string format="##,0.00", HtmlStyle styleIf=null, HtmlStyle styleElse=null, Func<decimal,bool> condition=null ) { if(value.HasValue) return HtmlFormat(value.Value, format,styleIf, styleElse, condition); return new HtmlParagragh(){ Text="", Style=styleElse?? new HtmlStyle(){TextAlign="right" } }; }
public HtmlStyle HeaderTextStyle {get;set;} // p public GridStyleBase(){ RowStyle = new HtmlRowStyle(); AlternateRowStyle = new HtmlRowStyle(); CellStyle = new HtmlCellStyle(); TableStyle = new HtmlTableStyle(); //TableStyle.FontFamily="Century Gothic, Arial, Helvetica, sans-serif"; //TableStyle.FontSize.Value=95; TableStyle.FontSize.Unit="%"; HeaderStyle= new HtmlTableStyle(); FooterStyle = new HtmlTableStyle(); TitleStyle = new HtmlStyle(); FootNoteStyle = new HtmlStyle(); HeaderCellStyle= new HtmlCellStyle(); FooterCellStyle = new HtmlCellStyle(); HeaderTextStyle = new HtmlStyle(); }
public static HtmlParagragh HtmlFormat(this decimal value, string format="##,0.00", HtmlStyle styleIf=null, HtmlStyle styleElse=null, Func<decimal,bool> condition=null ) { HtmlStyle style; if( condition!=null){ style= (condition(value)? styleIf: styleElse )??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 }; }
public HtmlIcon():base("i"){ Attributes["style"]="cursor:pointer;"; Style=new HtmlStyle(); }
public HtmlSpan():base("span"){ Style = new HtmlStyle(); }
public HtmlParagragh():base("p"){ Style = new HtmlStyle(); }
public HtmlLink():base("a"){ Style = new HtmlStyle(); }
public static HtmlParagragh HtmlFormat (this DateTime? date, string format="dd.MM.yyyy", HtmlStyle styleIf=null, HtmlStyle styleElse=null, Func<DateTime,bool> condition=null){ return HtmlFormat((date.HasValue)? date.Value:default(DateTime), format, styleIf, styleElse, condition ); }
public static HtmlParagragh HtmlFormat (this DateTime date, string format="dd.MM.yyyy", HtmlStyle styleIf=null, HtmlStyle styleElse=null, Func<DateTime,bool> condition=null ) { HtmlStyle style; if( condition!=null){ style= (condition(date)? styleIf: styleElse )??new HtmlStyle(){TextAlign="center" }; } else style = new HtmlStyle(){TextAlign="center"}; return new HtmlParagragh(){ Text= date!=default(DateTime)? date.ToString(format):"", Style= style }; }