protected void gdvList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { strAmoutAll = ((HiddenField)e.Row.FindControl("hdAmountAll")).Value; strEffectTime = ((HiddenField)e.Row.FindControl("hdEffectTime")).Value; strOperator = ((HiddenField)e.Row.FindControl("hdOperator")).Value; strKindCode = ((HiddenField)e.Row.FindControl("hdKindCode")).Value; TDTK.IndustryPlatform.CoalTraffic.Model.TT_CoalKind kind = new TDTK.IndustryPlatform.CoalTraffic.BLL.TT_CoalKind().GetModel(strKindCode); if (kind != null) strCoalKind = kind.CoalKindName; string strGroup = this.gdvList.DataKeys[e.Row.RowIndex].Value.ToString(); GridView gdvMain = (GridView)e.Row.FindControl("gdvMain"); gdvMain.DataSource = bll.OutTaxDetailSearchType(strKindCode, strGroup); gdvMain.DataBind(); foreach (GridViewRow gr in gdvMain.Rows) { GridView gdvDetail = (GridView)gr.FindControl("gdvDetail"); string strItemType = gdvMain.DataKeys[gr.RowIndex].Value.ToString(); gdvDetail.DataSource = bll.OutTaxDetailSearchDetail(strKindCode, strGroup, strItemType); gdvDetail.DataBind(); } gdvMain.FooterRow.Cells[0].Text = "<table border=0 width=100%><tr><td width=100%><b>煤种:</b>" + strCoalKind + "</td></tr></table>"; gdvMain.FooterRow.Cells[1].Text = "<table border=0 width=100%><tr><td width=33%><b>操作人:</b>" + strOperator + "</td><td width=33%> <b>生效日期:</b>" + strEffectTime + " </td><td width=33%><b>合计:¥" + strAmoutAll + "元</b></td></tr></table>"; } else if (e.Row.RowType == DataControlRowType.Footer) { //e.Row.Cells[0].Text = "<table border=0 width=100%><tr><td width=20%><b>磅房:</b>" // + strRoomName + "</td><td width=20%><b>煤种:</b>" // +strCoalKind+"</td><td width=20%><b>操作人:</b>" // + strOperator + "</td><td width=20%> <b>生效日期:</b>" // + strEffectTime + " </td><td width=20%><b>合计:¥</b>" // + strAmoutAll + "</td></tr></table>"; } }
protected void gdvList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { strAmoutAll = ((HiddenField)e.Row.FindControl("hdAmountAll")).Value; strEffectTime = ((HiddenField)e.Row.FindControl("hdEffectTime")).Value; strOperator = ((HiddenField)e.Row.FindControl("hdOperator")).Value; //strOperator = ControlBindHelper.GetFiledValue("SYS_Operator", "userName", "operatorID", strOperator, ""); strKindCode = ((HiddenField)e.Row.FindControl("hdKindCode")).Value; TDTK.IndustryPlatform.CoalTraffic.Model.TT_CoalKind kind = new TDTK.IndustryPlatform.CoalTraffic.BLL.TT_CoalKind().GetModel(strKindCode); if (kind != null) strCoalKind = kind.CoalKindName; strRoomCode = ((HiddenField)e.Row.FindControl("hdRoomCode")).Value; if (strTaxObject == "1") { try { TDTK.IndustryPlatform.CoalTraffic.Model.TT_Room room = new TDTK.IndustryPlatform.CoalTraffic.BLL.TT_Room().GetModel(strRoomCode); if (room != null) strRoomName = room.RoomName; } catch { } } else strRoomName = bll.getCollNameByCode(strRoomCode); string strGroup = this.gdvList.DataKeys[e.Row.RowIndex].Value.ToString(); GridView gdvMain = (GridView)e.Row.FindControl("gdvMain"); gdvMain.DataSource = bll.TaxDetailSearchType(strRoomCode, strKindCode, strGroup, this.ddlIsAssigned.SelectedValue); gdvMain.DataBind(); foreach (GridViewRow gr in gdvMain.Rows) { GridView gdvDetail = (GridView)gr.FindControl("gdvDetail"); string strItemType = gdvMain.DataKeys[gr.RowIndex].Value.ToString(); gdvDetail.DataSource = bll.TaxDetailSearchDetail(strRoomCode, strKindCode, strGroup, strItemType, this.ddlIsAssigned.SelectedValue); gdvDetail.DataBind(); } if (strTaxObject == "1") { gdvMain.FooterRow.Cells[0].Text = "<table border=0 width=100%><tr><td width=50%><b>磅房:</b>" + strRoomName + "</td><td width=50%><b>煤种:</b>" + strCoalKind + "</td></tr></table>"; } else if (strTaxObject == "2") { gdvMain.FooterRow.Cells[0].Text = "<table border=0 width=100%><tr><td width=50%><b>煤矿:</b>" + strRoomName + "</td><td width=50%><b>煤种:</b>" + strCoalKind + "</td></tr></table>"; } else if (strTaxObject == "3") { string strSql = "Select BusinName from Sys_Dictionary where BusinTypeID='1018' and BusinID='" + strRoomCode + "'"; string strParcel = DbHelperSQL.GetSingle(strSql).ToString(); gdvMain.FooterRow.Cells[0].Text = "<table border=0 width=100%><tr><td width=50%><b>片区:</b>" + strParcel + "</td><td width=50%><b>煤种:</b>" + strCoalKind + "</td></tr></table>"; } gdvMain.FooterRow.Cells[1].Text = "<table border=0 width=100%><tr><td width=33%><b>操作人:</b>" + strOperator + "</td><td width=33%> <b>生效日期:</b>" + strEffectTime + " </td><td width=33%><b>合计:¥" + strAmoutAll + "元</b></td></tr></table>"; } else if (e.Row.RowType == DataControlRowType.Footer) { //e.Row.Cells[0].Text = "<table border=0 width=100%><tr><td width=20%><b>磅房:</b>" // + strRoomName + "</td><td width=20%><b>煤种:</b>" // +strCoalKind+"</td><td width=20%><b>操作人:</b>" // + strOperator + "</td><td width=20%> <b>生效日期:</b>" // + strEffectTime + " </td><td width=20%><b>合计:¥</b>" // + strAmoutAll + "</td></tr></table>"; } }