61,821
社区成员




protected void BtnSave_Click(object sender, EventArgs e)
{
string cards = "";
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
if (cbox.Checked==true)
{
cards += "'"+GridView1.Rows[i].Cells[1].Text+"',";
}
}
if(!card.Equals(""))
{
cards = cards.Substring(0,card.Length-1);
string strsql = "Update People set 加班补助=1 where 卡号 in (" + cards+")";
SqlCommand comm = new SqlCommand(strsql, conn);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
}
BindData();
Response.Write(" <script>alert('修改加班补助成功'); </script>");
Response.Write(" <script language='javascript'>window.location.href=window.location.href; </script>");//重定向页面
}