标题:[求助]C#数形目录代码解析
取消只看楼主
reym
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-5-19
 问题点数:0 回复次数:2 
[求助]C#数形目录代码解析
平行指标创建(群众评价指标)
//初始化树
public void inittree()
{
evaluation_index_manage.evaluation_index_manage index = new evaluation_index_manage.evaluation_index_manage();
SqlDataReader reader = index.studentindex_Select();
while(reader.Read())
{
TreeNode nd = new TreeNode();
nd.Text = reader["Content"].ToString();
nd.ID = reader["Student_index_ID"].ToString();
this.TreeView1.Nodes.Add(nd);
}
reader.Close();
}
private void Toolbar1_ButtonClick(object sender, System.EventArgs e)
{
Microsoft.Web.UI.WebControls.ToolbarButton btn = (Microsoft.Web.UI.WebControls.ToolbarButton)sender;
evaluation_index_manage.evaluation_index_manage index = new evaluation_index_manage.evaluation_index_manage();
switch(btn.ID)
{
case "add":
this.Table2.Visible=true;
this.TextBox1.Text="";
this.bt_addindex.Visible = true;
this.bt_update.Visible = false;
this.Table3.Visible = false;
break;
case "del":
if(this.lb_index.Text=="")
{
Response.Write("<scr"+"ipt>alert('请先在树上选择一个操作对象!')</scr"+"ipt>");
}
else
{
if(index.studentindex_Delete(id))
{
//Attributes.Add("onclick","if(confirm('您确信要删除吗?')){}else{return false}");
this.TreeView1.Nodes.Clear();
this.inittree();
Response.Write("<scr"+"ipt>alert('删除成功!')</scr"+"ipt>");
}
}
break;
case "add1":
this.Table3.Visible = true;
this.Table2.Visible = false;
break;
}
}

private void bt_addindex_Click(object sender, System.EventArgs e)
{
if(this.TextBox1.Text=="")
Response.Write("<scr"+"ipt>alert('群众评价指标内容不能为空!')</scr"+"ipt>");
else
{
evaluation_index_manage.evaluation_index_manage index = new evaluation_index_manage.evaluation_index_manage();
if(index.studentindex_Create(this.TextBox1.Text))
{
this.TreeView1.Nodes.Clear();
this.inittree();
Response.Write("<scr"+"ipt>alert('群众评价指标内容添加成功!')</scr"+"ipt>");
}
else
{
Response.Write("<scr"+"ipt>alert('添加时出错,请联系系统管理员!')</scr"+"ipt>");
}
}

}

private void bt_additem_Click(object sender, System.EventArgs e)
{
evaluation_index_manage.evaluation_index_manage index = new evaluation_index_manage.evaluation_index_manage();
if(this.lb_index.Text=="")
{
Response.Write("<scr"+"ipt>alert('请先在树上选择一个操作对象!')</scr"+"ipt>");
}
else
{
if(this.tb_itemcontent.Text==""||this.tb_score.Text=="")
{
Response.Write("<scr"+"ipt>alert('请输入完整!')</scr"+"ipt>");
}
else
{
try
{
if(index.studentindexitem_Create(id,this.tb_itemcontent.Text,System.Int32.Parse(this.tb_score.Text)))
{
this.binddatagrid(id);
Response.Write("<scr"+"ipt>alert('添加成功!')</scr"+"ipt>");
}
else
{
Response.Write("<scr"+"ipt>alert('添加时出错,请联系系统管理员!')</scr"+"ipt>");
}
}
catch
{
Response.Write("<scr"+"ipt>alert('添加时出错,检查是否输入出错,或者你也可以联系系统管理员!')</scr"+"ipt>");
}
}
}
}
private void bt_update_Click(object sender, System.EventArgs e)
{
if(this.TextBox1.Text=="")
Response.Write("<scr"+"ipt>alert('群众评价指标内容不能为空!')</scr"+"ipt>");
else
{
evaluation_index_manage.evaluation_index_manage index = new evaluation_index_manage.evaluation_index_manage();
if(index.studentindex_Update(id,this.TextBox1.Text))
{
this.TreeView1.Nodes.Clear();
this.inittree();
Response.Write("<scr"+"ipt>alert('群众评价指标内容更新成功!')</scr"+"ipt>");
}
else
{
Response.Write("<scr"+"ipt>alert('更新时出错,请联系系统管理员!')</scr"+"ipt>");
}
}
}

评价模块(平级部门评价)
private void bt_sub_Click(object sender, System.EventArgs e)
{
string temp = "";
evaluation_index_manage eim = new evaluation_index_manage();
SqlDataReader reader = eim.get_cou_result(index_id,cou_id);
while(reader.Read())
temp = reader["Self_Score"].ToString();
if ( temp == "")
{
try
{
if(this.tb_cou_score.Text =="")
Response.Write("<script language='javascript'>alert('平级部门评价分值为必填项!')</script>");
else if(System.Double.Parse(this.tb_cou_score.Text)>System.Double.Parse(this.lb_highestscore.Text)||System.Double.Parse(this.tb_cou_score.Text)<System.Double.Parse(this.lb_lowestscore.Text))
{
Response.Write("<script language='javascript'>alert('平级部门评价分值需在指标最高分和最低分之间!')</script>");
}
else
{ eim.add_consellor_evaluation(index_id,cou_id,this.tb_cou_score.Text,this.lb_material.Text);
Response.Write("<script language='javascript'>alert('该指标评价成功!')</script>");
}
}
catch
{
Response.Write("<script language='javascript'>alert('字符输入出错,请检查!')</script>");
}
}
else
{
try
{
if(this.tb_cou_score.Text =="")
Response.Write("<script language='javascript'>alert('平级部门评价分值为必填项!')</script>");
else if(System.Double.Parse(this.tb_cou_score.Text)>System.Double.Parse(this.lb_highestscore.Text)||System.Double.Parse(this.tb_cou_score.Text)<System.Double.Parse(this.lb_lowestscore.Text))
{
Response.Write("<script language='javascript'>alert('平级部门评价分值需在指标最高分和最低分之间!')</script>");
}
else
{
eim.update_consellor_evaluation(index_id,cou_id,this.tb_cou_score.Text,this.lb_material.Text);
Response.Write("<script language='javascript'>alert('指标更新成功!')</script>");
}
}
catch
{
Response.Write("<script language='javascript'>alert('更新时出错!')</script>");
}
}
}
搜索更多相关主题的帖子: evaluation 目录 index manage 代码 
2006-05-19 13:01
reym
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-5-19
得分:0 
哪位大人可以帮忙解析下,毕业答辩急用
2006-05-19 13:02
reym
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-5-19
得分:0 

主要是对自己理解的没信心,这段代码是朋友帮忙写的,我也只知道大概,希望哪位高手能详细指导下,22号答辩了.

2006-05-19 19:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-65551-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.380222 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved