开发员工业绩评测中心计划
2021-08-24 13:00:30 菏泽汽车网
源代码编译环境:安装Visual 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;
ll(ds,”bigRules”);
int nTotalBig = bles[“bigRules”].unt;
int k = Int32(bles[\"bigRules\"].Rows[0][\"bigID\"].ToString());
for(int iBig=0;k<=Int32(bles[\"bigRules\"].Rows[nTotalBig-1][\"bigID\"].ToString());k=Int32(bles[\"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) ear();
ds1 = new DataSet();//每次循环都需要更新ds1中记录的细则数据
ll(ds1,\"smallRules\");
int nTotalRows = bles[\"smallRules\"].unt;
int i=Int32(bles[\"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<=Int32(bles[\"smallRules\"]
_.Rows[nTotalRows-1][“ID”].ToString());
i=Int32(bles[“smallRules”].Rows[z][“ID”].ToString()))
//z代表smallRules中的行值,i代表z行的ID值,需要找出i值对应的score表的\"成绩\"值
{
HtmlTableRow tr = new HtmlTableRow();
tValue(indexPageRow++,i);
//array为静态数组,记录每个i值在页面上的对应行,
// 因为各项评测smallRules经过后台不断的增,删,改,其ID值与页面上的行并不对应
for(int j=0;j<bles[\"smallRules\"].unt;j++)
{
HtmlTableCell tc = new HtmlTableCell();
if(j==0)//当前范围的零行零列
{
if(i == Int32(bles[\"smallRules\"].Rows[0][\"ID\"].ToString()))
{
//最左的细则分类列,注意从bigRules表中取数据
nerHtml = bles[\"bigRules\"].Rows[iBig][j+1].ToString()+
_bles[\"bigRules\"].Rows[iBig][\"totalScore\"].ToString()+\"分\";
}
d(tc);
}
else //不是最左列
{
if(j!=bles[\"smallRules\"].unt-1)//判断是否最右列
{
nerHtml = bles[\"smallRules\"].Rows[z][j].ToString();
}
else
{
//最右的成绩分值列
if(lue==”true”)
//最后一个cell列含两个textbox列,显示上次评测的成绩
{
TextBox box1= new TextBox();
dth = 30;
//找出i值对应的score表中的成绩放入ds2
xt = bles[\"score\"].Rows[0][\"score\"].ToString();
adOnly = true;
ckColor = ige;
d(box1);
}
TextBox box = new TextBox();
if(lue == \"false\")
dth = 60;
else
dth = 30;
tributes[\"onblur\"]=\"javascript:OnChange(\"+bles[
\"smallRules\"].Rows[z][j-1].ToString()+\",this)\";
//javascript控制用户评测分数在该项分值之内,
//bles[\"smallRules\"].Rows[z][j-1].ToString()
//传给OnChange函数该项评测细则分值
}
d(tc);//将HtmlTableCell对象存入HtmlTableRow对象中
}
}
d(tr);//一行数据完成,加入到HtmlTable的Rows集合中
z++;
}//一个细则分类的所有评测细则完成
iBig++;
}//下一个细则分类,如由”遵守制度”到”专业技能”
其中嵌入的javascript语句的OnChange()函数在html页面中head部分实现如下:
<script language=”javascript”>
function OnChange(maxValue,obj)
{
//maxValue为该项细则的分值,obj为该项得分,是object型
parseInt(lue,10); parseInt(maxValue,10);
if(!isNaN(lue)) //判断是否自然数
if(lue>maxValue) //值超过范围
{
alert(\'值超过范围\') cus();}
else {}
else //值非法
{
alert(\'值非法\') cus();}
</script>
源代码2(评测结果页面,以一个DataGrid为例):
DataTable table1 = d(\"score\");//ds,ds1为两个DataSet型数据集
d(\"smallID\",typeof(int));//细则ID列
d(\"realName\", typeof(string));//测评人姓名
d(\"score\", typeof(int));//该项细则得分
string commText = \"select smallID,realName,score from score, employee where stPersonID=\"+testID+\"and stedPersonID=\"+testedID+\"and nth=\"+curMon+\"order by allID\";
//其中testID,testedID为页面进入时从前一页面记录的测评人ID和被评人ID值
SqlConnection conn = new SqlConnection(“server=localhost;uid=sa;pwd=;database=ygpc”;
en();
SqlCommand comm= new SqlCommand(commText,conn);
SqlDataReader reader = ecuteReader();
int nColCount= unt;
while(ad())
{
taRow row = wRow();
for(int i=0;i<nColCount;i++)
既有小手提包的优质触感 {
row[i]=reader[i];
}
d(row);
}
taSource=bles[\"score\"].DefaultView;
taMember =bles[\"employee\"].TableName;
taBind();
//使用DataSource和DataMember就能在一个DataGrid控件中显示来自两个表的信息查看本文来源
男人气虚怎么补效果好类风湿性关节炎怎么护理
淄博白癜风医院哪家好
- 上一篇:底层架构探索之进入运行物业
- 下一篇:开发在用户控件中添加事件覆盖