Ejemplo n.º 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
			};
		}
Ejemplo n.º 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" }
			};
		}
Ejemplo n.º 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" }
			};
		}
Ejemplo n.º 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();
		}
Ejemplo n.º 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
			};
		}
Ejemplo n.º 6
0
		public HtmlIcon():base("i"){
			Attributes["style"]="cursor:pointer;";
			Style=new HtmlStyle();
		}
Ejemplo n.º 7
0
		public HtmlSpan():base("span"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 8
0
		public HtmlParagragh():base("p"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 9
0
		public HtmlLink():base("a"){
			Style = new HtmlStyle();
		}
Ejemplo n.º 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  );
				
		}
Ejemplo n.º 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
			};
		}