using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using dataManagerForEC;
using System.Data;
using System.Data.SqlClient;
namespace ec
{
/// <summary>
/// tableDraw 的摘要说明。
/// </summary>
public class tableDraw
{
public tableDraw()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
static public void drawDoubleCol(dataManager dm,DataSet ds,Table table,int rowNum,string imgPath,string tableName,string colLink,string colName,string colOrder,string linkWebPage)
{
table.BorderWidth=0;
table.CellPadding=0;
table.CellSpacing=0;
string sqlSelect="select top "+rowNum.ToString()+" "+colLink+","+colName+" from "+tableName+" order by "+colOrder+" desc";
dm.SelectData(ds,sqlSelect,tableName);
for(int i=0;i<ds.Tables[tableName].Rows.Count;i++)
{
TableRow tRow=new TableRow();
table.Rows.Add(tRow);
TableCell tCell=new TableCell();
tCell.Width=20;
tCell.HorizontalAlign=HorizontalAlign.Center;
tCell.Text="<img src='"+imgPath+"'>";
tRow.Cells.Add(tCell);
TableCell tCell2=new TableCell();
//tCell2.Width=int.Parse(table.Width.ToString())-int.Parse(tCell.Width.ToString());
tCell2.Text="<a href="+linkWebPage+"?id="+ds.Tables[tableName].Rows[i][colLink].ToString()+" target='_blank'>"+ds.Tables[tableName].Rows[i][colName].ToString()+"</a>";
tRow.Cells.Add(tCell2);
}
ds.Tables[tableName].Clear();
}
}
}