下面的是MVC中视图中grid的代码 @(
F.Window()
.Width(650)
.WindowPosition(WindowPosition.Center)
.EnableClose(true)
.IsModal(false)
.Title("统计分析结果信息表")
.ID("w_DJHJ")
.Height(550)
.Hidden(true)
.Items(
F.Grid()
.EnableCollapse(false)
.Width(650)
.ShowHeader(false)
.ShowBorder(true)
.ID("Grid_DJHJ")
.AllowSorting(false)
.AutoScroll(true)
//.DataIDField("YWH")
//.DataTextField("业务号")
.Height(550)
.Columns(
F.RowNumberField(),
F.RenderField()
.HeaderText("业务号")
.DataField("YWH")
.FieldType(FieldType.String)
.Width(120),
F.RenderField()
.HeaderText("办理业务名称")
.DataField("WFENTITYNAME")
.FieldType(FieldType.String)
.Width(180),
F.RenderField()
.HeaderText("业务类型")
.DataField("WFENTITYPRENAME")
.FieldType(FieldType.String)
.Width(100),
F.RenderField()
.HeaderText("环节名称")
.DataField("DOWITHNAME")
.FieldType(FieldType.String)
.Width(130),
F.RenderField()
.HeaderText("处理时间")
.DataField("SUBMITDATE")
.FieldType(FieldType.String)
.Width(100)
)
)
)
下面是查询时的代码
public DataTable GetTotalAnalyNodeDetailResult(DateTime dWhereStart, DateTime dWhereEnd)
{
DataTable dt = null;
string sSql = string.Empty;
sSql = @"select * from BDC_TABLE_TMP";// 查询字段 YWH,WFENTITYNAME
,WFENTITYPRENAME,SUBMITDATE,DOWITHNAME;
dt = OracleHelper.ExecuteDataTable(OracleHelper.BDCconnstr, sSql);
return dt;
}
下面的代码是绑定Grid控件
DataTable dt = op.GetTotalAnalyNodeDetailResult(dS, dE);
UIHelper.Grid("Grid_DJHJ").DataSource(dt);
UIHelper.Window("w_DJHJ").Hidden(false);
return UIHelper.Result();
执行后的效果如下图所示
|