StringBuilder strb1 = new StringBuilder();
DataSet ds = new DataSet();
BLL.JZ_BJFL BllBJFL = new BLL.JZ_BJFL();
ds = BllBJFL.GetList("SSID=0");
//父分类
strb1.Append("<table style=\"width: 50%;text-align:left;\" border=\"1\">");
foreach (DataRow dr in ds.Tables[0].Rows)
{
strb1.Append("<tr><td>"+dr["FLMC"].ToString()+"</td></tr>");//大类,第一行start end
DataSet ds2 = new DataSet();
BLL.JZ_BJFL BllBjfl = new BLL.JZ_BJFL();
ds2=BllBjfl.GetList("SSID="+dr["ID"].ToString());
strb1.Append("<tr><td>"); //小类,第二行,start
//小类列表开始
strb1.Append("<table border=\"1\" style=\"width:100%;\">");
for (int i = 0; i <= ds2.Tables[0].Rows.Count - 1; i++)
{
if (i % 4 == 0)
{
strb1.Append("<tr><td>");
}
strb1.Append(" <a href=\"cmp_ServicePriceAdd1.aspx?BjflId=" + ds2.Tables[0].Rows[i]["ID"].ToString() + "\" >" + ds2.Tables[0].Rows[i]["FLMC"].ToString() + "</a>");
if ((i+1) % 4 == 0)
{
strb1.Append("</td></tr>");
}
}
if (ds2.Tables[0].Rows.Count % 4 != 0)
{
strb1.Append("</td></tr>");
}
strb1.Append("</table>");
//小类列表结束
strb1.Append("</td></tr>"); //小类,第二行,end
}
strb1.Append("</table>");
lblTable.Text = strb1.ToString();