Example #1
0
		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
			};
		}
Example #2
0
		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" }
			};
		}
Example #3
0
		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" }
			};
		}
Example #4
0
		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();
		}
Example #5
0
		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
			};
		}
Example #6
0
		public HtmlIcon():base("i"){
			Attributes["style"]="cursor:pointer;";
			Style=new HtmlStyle();
		}
Example #7
0
		public HtmlSpan():base("span"){
			Style = new HtmlStyle();
		}
Example #8
0
		public HtmlParagragh():base("p"){
			Style = new HtmlStyle();
		}
Example #9
0
		public HtmlLink():base("a"){
			Style = new HtmlStyle();
		}
Example #10
0
		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  );
				
		}
Example #11
0
		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
			};
		}