private static HtmlTag MakeRadioButton(string display, object value, string name)
        {
            DivTag  divTag      = new DivTag(display);
            HtmlTag radioButton = new RadioButtonTag(false).Attr("value", value).Attr("name", name);
            HtmlTag label       = new HtmlTag("label").Text(display);

            label.AddChildren(radioButton);
            divTag.AddChildren(label);
            return(divTag);
        }
예제 #2
0
        private HtmlTag buildHtmlForTasks(IEnumerable <Task> tasks)
        {
            var rootTag = new DivTag("tasks");
            var ul      = new HtmlTag("ul");

            tasks.OrderBy(x => x.ScheduledDate).Each(x =>
            {
                var li    = new HtmlTag("li");
                var liDiv = new DivTag("liDiv");
                var task  = x.ScheduledDate.Value.ToLongDateString() + " " + x.ScheduledStartTime.Value.ToShortTimeString();
                task     += x.ScheduledEndTime.HasValue? " To " + x.ScheduledEndTime.Value.ToShortTimeString():"";
                task     += ": " + x.TaskType.Name + " at " + x.Field.Name;
                liDiv.Text(task);
                li.AddChildren(liDiv);
                ul.AddChildren(li);
            });
            rootTag.AddChildren(ul);
            return(rootTag);
        }