📄 dftable.aspx.cs
字号:
for(int j=2;j<3;j++)//七项打分
{
string sqlinsert;
// scoren="score"+j;
scoren=this.Page.Request.Form[al1[i].ToString()+"_"+j+""].ToString();
// temp[i,j]=this.Page.Request.Form[al1[i].ToString()+"_"+j+""].ToString();
role_id2=al2[i].ToString();
string sqlselect="select role_id,factor_id,staff_code from score where role_id='"+role_id2+"' and staff_code='"+Session["staff_code"].ToString()+"' and factor_id="+j+"";
SqlCommand cmdselect=new SqlCommand(sqlselect,cnn);
SqlDataReader drselect=cmdselect.ExecuteReader();
if(drselect.Read())
{
if(scoren=="")
{
// sqlinsert="update score set score=null where role_id='"+drselect["role_id"].ToString()+"' and factor_id='"+drselect["factor_id"].ToString()+"' and staff_code='"+drselect["staff_code"].ToString()+"'";
Response.Write("<script>alert('分值不能为空!')</script>");
user();
b_score();
return;
}
else
{
sqlinsert="update score set score='"+scoren+"' where role_id='"+drselect["role_id"].ToString()+"' and factor_id='"+drselect["factor_id"].ToString()+"' and staff_code='"+drselect["staff_code"].ToString()+"'";
}
}
else
{
if(scoren=="")
{
// sqlinsert="insert into score(role_id,factor_id,staff_code,score) values('"+role_id2+"',"+j+",'"+Session["staff_code"].ToString()+"',null)";
Response.Write("<script>alert('分值不能为空!')</script>");
user();
b_score();
return;
}
else
{
sqlinsert="insert into score(role_id,factor_id,staff_code,score) values('"+role_id2+"',"+j+",'"+Session["staff_code"].ToString()+"','"+scoren+"')";
}
}
drselect.Close();
cmdselect.Dispose();
SqlCommand cmd=new SqlCommand(sqlinsert,cnn);
try
{
cmd.ExecuteNonQuery();
}
catch(Exception m)
{
string aaa=m.Message.Trim().ToString();
string bbb=myclass.DeleteUnVisibleChar(aaa);
Response.Write("<script>alert('"+bbb.Replace("\'","\\'")+"')</script>");
user();
b_score();
return;
}
cmd.Dispose();
}
}
string sqlup="update evaluate_staff set evaluate_ok='1' where staff_code='"+Session["staff_code"].ToString()+"'";
SqlCommand cmdup=new SqlCommand(sqlup,cnn);
cmdup.ExecuteNonQuery();
cmdup.Dispose();
cnn.Close();
Response.Write("<script>alert('提交成功!')</script>");
user();
select();
}
else
{
dr88.Close();
cmd88.Dispose();
for(int i=0;i<al1.Count;i++)//
{
for(int j=1;j<8;j++)//七项打分
{
string sqlinsert;
// scoren="score"+j;
if(j==2)
{
// scoren=this.Page.Request.Form[al1[i].ToString()+"_"+j+""].ToString();
// return;
}
else
{
scoren=this.Page.Request.Form[al1[i].ToString()+"_"+j+""].ToString();
// temp[i,j]=this.Page.Request.Form[al1[i].ToString()+"_"+j+""].ToString();
role_id2=al2[i].ToString();
string sqlselect="select role_id,factor_id,staff_code from score where role_id='"+role_id2+"' and staff_code='"+Session["staff_code"].ToString()+"' and factor_id="+j+"";
SqlCommand cmdselect=new SqlCommand(sqlselect,cnn);
SqlDataReader drselect=cmdselect.ExecuteReader();
if(drselect.Read())
{
if(scoren=="")
{
// sqlinsert="update score set score=null where role_id='"+drselect["role_id"].ToString()+"' and factor_id='"+drselect["factor_id"].ToString()+"' and staff_code='"+drselect["staff_code"].ToString()+"'";
Response.Write("<script>alert('分值不能为空!')</script>");
user();
b_score();
return;
}
else
{
sqlinsert="update score set score='"+scoren+"' where role_id='"+drselect["role_id"].ToString()+"' and factor_id='"+drselect["factor_id"].ToString()+"' and staff_code='"+drselect["staff_code"].ToString()+"'";
}
}
else
{
if(scoren=="")
{
// sqlinsert="insert into score(role_id,factor_id,staff_code,score) values('"+role_id2+"',"+j+",'"+Session["staff_code"].ToString()+"',null)";
Response.Write("<script>alert('分值不能为空!')</script>");
user();
b_score();
return;
}
else
{
sqlinsert="insert into score(role_id,factor_id,staff_code,score) values('"+role_id2+"',"+j+",'"+Session["staff_code"].ToString()+"','"+scoren+"')";
}
}
drselect.Close();
cmdselect.Dispose();
SqlCommand cmd=new SqlCommand(sqlinsert,cnn);
try
{
cmd.ExecuteNonQuery();
}
catch(Exception m)
{
string aaa=m.Message.Trim().ToString();
string bbb=myclass.DeleteUnVisibleChar(aaa);
Response.Write("<script>alert('"+bbb.Replace("\'","\\'")+"')</script>");
user();
b_score();
return;
}
cmd.Dispose();
}
}
}
string sqlup="update evaluate_staff set evaluate_ok='1' where staff_code='"+Session["staff_code"].ToString()+"'";
SqlCommand cmdup=new SqlCommand(sqlup,cnn);
cmdup.ExecuteNonQuery();
cmdup.Dispose();
cnn.Close();
Response.Write("<script>alert('提交成功!')</script>");
user();
select();
}
}
else{
}
}
}
#endregion
#region 判断用户
private void user(){
// string aaa=Session["is_admin"].ToString();
// Session.Timeout=30;
// this.ViewState["is_admin"]=Session["is_admin"];
// string str=this.ViewState["is_admin"].ToString();
if(Session["is_admin"]==null)
{
Response.Write("<script>alert('由于您长时间没有使用本软件,请重新登陆!')</script>");
return;
}
else
{
if(Session["is_admin"].ToString()=="False")
{
user1="readonly";
user2="";
map1="show";
map2="";
title1="title=\"管理制度-此因素不用评分,由人力资源部统计确定.\"";
}
else
{
user1="";
user2="readonly";
map1="";
map2="show";
title1="";
}
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -