private bool update(SdeptClass s) { SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@StuDeptClassNo", s.sDeptClassno), new SqlParameter("@StuDepartment", s.department), new SqlParameter("@Class", s.clazz) }; int rtn = SqlHelper.ExecuteNonQueryUsingProcedure("updateStuDeptClass", paras); return(rtn > 0 ? true : false); }
protected void Button2_Click(object sender, EventArgs e) { SdeptClass s = new SdeptClass(); s.sDeptClassno = int.Parse(TextBox1.Text.Trim()); s.department = TextBox2.Text.Trim(); s.clazz = TextBox3.Text.Trim(); if (update(s)) { Response.Write("<script>alert('修改成功!');</script>"); DisplayData(); } else { Response.Write("<script>alert('修改失败!');</script>"); } }