110,539
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bind();
}
//del
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string sqlstr = "";
sqlstr = "delete from [Booking] where PatientID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
sqlstr = "delete from [Grug Allergy] where PatientID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
sqlstr = "delete from [Patient_History] where PatientID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
sqlstr = "delete from [Waiting List] where PatientID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
sqlstr = "delete from [Patients] where PatientID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
bind();
}
//update
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string sqlstr = "update Patients set P_Name='"
// + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim() + "',ID_Card='"
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() + "',Guardian_Name='"
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim() + "' where PatientID='"
+ GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
sqlHp.SQLExecute(sqlstr);
GridView1.EditIndex = -1;
bind();
}
//
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind();
}
while(不会)
{
//理解中ing。。。
}