public static MvcRow BeginRowForCoding(this HtmlHelper helper, Question question) { DateTime created = question.CreatedDate; var tagBuilder = new TagBuilder("tr"); var cssClass = question.IsClosed() ? "Closed" : created > DateTime.Now.AddDays(-10) ? "Current" : created < DateTime.Now.AddDays(-25) ? "Urgent" : "Overdue"; tagBuilder.AddCssClass(cssClass); helper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); var row = new MvcRow(helper.ViewContext); return(row); }
public static MvcRow BeginRowForCoding(this HtmlHelper helper, Question question) { DateTime created = question.CreatedDate; var tagBuilder = new TagBuilder("tr"); var cssClass = question.IsClosed() ? "Closed" : created > DateTime.Now.AddDays(-10) ? "Current" : created < DateTime.Now.AddDays(-25) ? "Urgent" : "Overdue"; tagBuilder.AddCssClass(cssClass); helper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); var row = new MvcRow(helper.ViewContext); return row; }