protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//显示总积分
int jifen_counts = 0;
RYJL.BLL.jifen_log jifen_logBLL = new RYJL.BLL.jifen_log();
List<RYJL.Model.jifen_log> jifen_loglist = jifen_logBLL.GetModelList("KaNumber='" + e.Row.Cells[2].Text + "'");
if (jifen_loglist.Count > 0)
{
for (int ii = 0; ii < jifen_loglist.Count; ii++)
{
jifen_counts += jifen_loglist[ii].JiFen;
}
e.Row.Cells[2].Text = jifen_counts.ToString();//设置该列显示
}
else
{
e.Row.Cells[2].Text = "0";//设置该列显示
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");
e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
}
}
{
//显示总积分
int jifen_counts = 0;
RYJL.BLL.jifen_log jifen_logBLL = new RYJL.BLL.jifen_log();
List<RYJL.Model.jifen_log> jifen_loglist = jifen_logBLL.GetModelList("KaNumber='" + e.Row.Cells[2].Text + "'");
if (jifen_loglist.Count > 0)
{
for (int ii = 0; ii < jifen_loglist.Count; ii++)
{
jifen_counts += jifen_loglist[ii].JiFen;
}
e.Row.Cells[2].Text = jifen_counts.ToString();//设置该列显示
}
else
{
e.Row.Cells[2].Text = "0";//设置该列显示
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");
e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
}
}