62,047
社区成员
发帖
与我相关
我的任务
分享
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridViewRow gridview = e.Row;
HtmlAnchor htmla = gridview.Cells[10].FindControl("UpLoad") as HtmlAnchor;
string path = (e.Row.FindControl("Label7") as Label).Text;
string PayDetailID = hf.Value;
string year = hfd.Value;
string parentId = hfdd.Value;
string paySetId = pay.Value;
string total = string.Empty;
string sql2 = string.Format(@"SELECT SUM(SendTotal)as he FROM ProjectPayDetail WHERE dbo.StartsWith(Path,'" + path + "')=1 and ReportID='" + ReportID + "'");
total = SqlHelper.ExecuteScalar(sql2);
string sql = string.Format(@"SELECT SUM(SendTotal)as he FROM ProjectPayDetail WHERE dbo.StartsWith(Path,'" + path + "')=1 AND Path<> '" + path + "' and ReportID='" + ReportID + "'");
string sql3 = "select SendTotal from ProjectPayDetail where PayDetailID='" + PayDetailID + "' and ReportID='" + ReportID + "'";
string total3 = SqlHelper.ExecuteScalar(sql3);
string total2 = SqlHelper.ExecuteScalar(sql);
if (parentId == "0")
{
htmla.HRef = "FileUpload.aspx?ReportId=" + ReportID + "&PayDetailID=" + PayDetailID + "";
(gridview.Cells[6].FindControl("Label6") as Label).Text = total.ToString();
}
else
{
htmla.Visible = false;
if (string.IsNullOrEmpty(total2))
{
(gridview.Cells[6].FindControl("Label6") as Label).Text = total3.ToString();
}
else
{
(gridview.Cells[6].FindControl("Label6") as Label).Text = total2.ToString();
}
}
}
}