跪求一个c#的库存管理系统,急急急!!!
展开全部
ASP.NET中Gridview中模版用的CheckBox在代码页里面是没有事件的,所以你点了后会没反应。你如果硬要给他来个On change 事件的话得把代码写在前台,很麻烦的,还不如在界面的合适位置放个按钮,通过按钮的click事件来写例如:
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
string str = "";
CheckBox cbox = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkSelect");
if (cbox.Checked == true)
{
LinkButton linkb = (LinkButton)GridView1.Rows[i].Cells[2].FindControl("LinkButton1");
str = linkb.Text.ToString();
string sqlstr = "update T_neirong set isshenhe = 0 where tnr_biaoti ='" + str + "'";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = sqlstr;
cmd.ExecuteNonQuery();
con.Close();
}
}
Response.Write("<script language='javascript'>alert('解除审核成功');</script>");
gridviewdata();
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
string str = "";
CheckBox cbox = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chkSelect");
if (cbox.Checked == true)
{
LinkButton linkb = (LinkButton)GridView1.Rows[i].Cells[2].FindControl("LinkButton1");
str = linkb.Text.ToString();
string sqlstr = "update T_neirong set isshenhe = 0 where tnr_biaoti ='" + str + "'";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = sqlstr;
cmd.ExecuteNonQuery();
con.Close();
}
}
Response.Write("<script language='javascript'>alert('解除审核成功');</script>");
gridviewdata();
展开全部
表示这个是学生作业啊,不好给,给了是害他啊
追问
不是啊!怎么是害呢?不会啊~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询