using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Xys.Remp.WF.UI
{
public class WorkFlowTraceTemplate : ITemplate
{
ListItemType templateType;
public WorkFlowTraceTemplate(ListItemType type)
{
templateType = type;
}
public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
switch (templateType)
{
case ListItemType.Header:
lc.Text = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" class=\"addformcontainer\"><tr><td>节点编号</td><td>节点名称</td><td>处理人</td><td>审批意见</td><td>时间</td></tr>";
break;
case ListItemType.Item:
lc.DataBinding += new EventHandler(TemplateControl_DataBinding);
break;
break;
case ListItemType.Footer:
lc.Text = "</table>";
break;
}
container.Controls.Add(lc);
}
private void TemplateControl_DataBinding(object sender,
System.EventArgs e)
{
Literal lc;
lc = (Literal)sender;
RepeaterItem container = (RepeaterItem)lc.NamingContainer;
lc.Text = " <tr><td>" + DataBinder.Eval(container.DataItem, "NodeID") + "</td><td>" + DataBinder.Eval(container.DataItem, "NodeName") + "</td><td>" + DataBinder.Eval(container.DataItem, "CurrentPersonName") + "</td><td>" + DataBinder.Eval(container.DataItem, "Remark") + "</td><td>" + DataBinder.Eval(container.DataItem, "HandleTime") + "</td></tr>";
}
}
}