(以下源代码不排版)
源代码编译环境:安装Visual Studio.net 7.0,SqlServer2000
源代码1(前台评测主页面):
//建立数据库连接,取出bigRules表数据放入ds中
SqlConnection conn = new SqlConnection(“server=localhost;uid=sa;pwd=;database=ygpc”;
SqlCommand comm. = new SqlCommand(“select * from bigRules”,conn);
SqlDataAdapter da = new SqlDataAdapter(comm);
DataSet ds;
da.Fill(ds,”bigRules”);
int nTotalBig = ds.Tables[“bigRules”].Rows.Count;
int k = Convert.ToInt32(ds.Tables["bigRules"].Rows[0]["bigID"].ToString());
for(int iBig=0;k<=Convert.ToInt32(ds.Tables["bigRules"].Rows[nTotalBig-1]["bigID"].ToString());k=Convert.ToInt32(ds.Tables["bigRules"].Rows[iBig]["ID"].ToString()))
//iBig代表bigRules表中行值,k代表iBig行对应的ID值
{
string commText = "Select * from smallRules where bigID="+k+"order by id";
SqlCommand commSmall = new SqlCommand(commText,conn);
SqlDataAdapter daSmall = new SqlDataAdapter(commSmall);
if(ds1!=null) ds1.Clear();
ds1 = new DataSet();//每次循环都需要更新ds1中记录的细则数据
daSmall.Fill(ds1,"smallRules");
int nTotalRows = ds1.Tables["smallRules"].Rows.Count;
int i=Convert.ToInt32(ds1.Tables["smallRules"].Rows[0]["ID"].ToString());
string str = "select * from score where
_testPersonID="+testID+"and testedPersonID="+testedID+"and month="+curMon+" and smallID="+i;
//判断当前被测员工当月是否已有过成绩,即检查score表中是否有与testedID, testID,curMon相符
//的记录,判断结果为true或false存入hidTested隐藏控件中,
// 在显示”黄框”以往成绩时起到作用,略
for(int z=0;i<=Convert.ToInt32(ds1.Tables["smallRules"]
_.Rows[nTotalRows-1][“ID”].ToString());
i=Convert.ToInt32(ds1.Tables[“smallRules”].Rows[z][“ID”].ToString()))
//z代表smallRules中的行值,i代表z行的ID值,需要找出i值对应的score表的"成绩"值
{
HtmlTableRow tr = new HtmlTableRow();
array.SetValue(indexPageRow++,i);
//array为静态数组,记录每个i值在页面上的对应行,
// 因为各项评测smallRules经过后台不断的增,删,改,其ID值与页面上的行并不对应
for(int j=0;j<ds1.Tables["smallRules"].Columns.Count;j++)
{
HtmlTableCell tc = new HtmlTableCell();
if(j==0)//当前范围的零行零列
{
if(i == Convert.ToInt32(ds1.Tables["smallRules"].Rows[0]["ID"].ToString()))
{
//最左的细则分类列,注意从bigRules表中取数据
tc.InnerHtml = s.Tables["bigRules"].Rows[iBig][j+1].ToString()+
_ds.Tables["bigRules"].Rows[iBig]["totalS
源代码编译环境:安装Visual Studio.net 7.0,SqlServer2000
源代码1(前台评测主页面):
//建立数据库连接,取出bigRules表数据放入ds中
SqlConnection conn = new SqlConnection(“server=localhost;uid=sa;pwd=;database=ygpc”;
SqlCommand comm. = new SqlCommand(“select * from bigRules”,conn);
SqlDataAdapter da = new SqlDataAdapter(comm);
DataSet ds;
da.Fill(ds,”bigRules”);
int nTotalBig = ds.Tables[“bigRules”].Rows.Count;
int k = Convert.ToInt32(ds.Tables["bigRules"].Rows[0]["bigID"].ToString());
for(int iBig=0;k<=Convert.ToInt32(ds.Tables["bigRules"].Rows[nTotalBig-1]["bigID"].ToString());k=Convert.ToInt32(ds.Tables["bigRules"].Rows[iBig]["ID"].ToString()))
//iBig代表bigRules表中行值,k代表iBig行对应的ID值
{
string commText = "Select * from smallRules where bigID="+k+"order by id";
SqlCommand commSmall = new SqlCommand(commText,conn);
SqlDataAdapter daSmall = new SqlDataAdapter(commSmall);
if(ds1!=null) ds1.Clear();
ds1 = new DataSet();//每次循环都需要更新ds1中记录的细则数据
daSmall.Fill(ds1,"smallRules");
int nTotalRows = ds1.Tables["smallRules"].Rows.Count;
int i=Convert.ToInt32(ds1.Tables["smallRules"].Rows[0]["ID"].ToString());
string str = "select * from score where
_testPersonID="+testID+"and testedPersonID="+testedID+"and month="+curMon+" and smallID="+i;
//判断当前被测员工当月是否已有过成绩,即检查score表中是否有与testedID, testID,curMon相符
//的记录,判断结果为true或false存入hidTested隐藏控件中,
// 在显示”黄框”以往成绩时起到作用,略
for(int z=0;i<=Convert.ToInt32(ds1.Tables["smallRules"]
_.Rows[nTotalRows-1][“ID”].ToString());
i=Convert.ToInt32(ds1.Tables[“smallRules”].Rows[z][“ID”].ToString()))
//z代表smallRules中的行值,i代表z行的ID值,需要找出i值对应的score表的"成绩"值
{
HtmlTableRow tr = new HtmlTableRow();
array.SetValue(indexPageRow++,i);
//array为静态数组,记录每个i值在页面上的对应行,
// 因为各项评测smallRules经过后台不断的增,删,改,其ID值与页面上的行并不对应
for(int j=0;j<ds1.Tables["smallRules"].Columns.Count;j++)
{
HtmlTableCell tc = new HtmlTableCell();
if(j==0)//当前范围的零行零列
{
if(i == Convert.ToInt32(ds1.Tables["smallRules"].Rows[0]["ID"].ToString()))
{
//最左的细则分类列,注意从bigRules表中取数据
tc.InnerHtml = s.Tables["bigRules"].Rows[iBig][j+1].ToString()+
_ds.Tables["bigRules"].Rows[iBig]["totalS
| 对此文章发表了评论 |

