IDData.IDDatabase operate = new IDData.IDDatabase();
DataSet myDS = operate.GetDataSetByStoredProcedure(IDData.ConnectionName.ZBiddingDB, "[SP3_BI_ProjectZBiddingPlan]",
new string[] { "@ProjectID", "@ZBETID", "@ZBWFMID", "@StartDate", "@EndDate" },
new DbType[] { DbType.String, DbType.String, DbType.String, DbType.DateTime, DbType.DateTime },
new object[] { this.ddlProject.SelectedValue, this.hidZBETID.Value, this.ddlZBWFMType.SelectedValue, StartDate, EndDate });
if (myDS != null)
{
this.rptData.DataSource = myDS.Tables[0];
rptData.ItemDataBound += (s, e) =>
{
if (CGeneral.RowIsFooter(e))
{ //绑定表尾数据,用逗号隔开
double dbTotalEstimateAmount = myDS.Tables[0].AsEnumerable().Sum(r => r.Field<double>("EstimateAmount"));
double dbTotalZBAmount = myDS.Tables[0].AsEnumerable().Sum(r => r.Field<double>("ZBAmount"));
e.Item.DataItem = new { TotalZBAmount = dbTotalZBAmount, TotalEstimateAmount = dbTotalEstimateAmount };
e.Item.DataBind();
}
};
this.rptData.DataBind();
}
表尾绑定
最新推荐文章于 2022-12-12 14:46:24 发布