|
//真实的删除操作 public void btnRealDel_Click(object sender, EventArgs e) ...{ int count = 0; for (int i = 0; i <this.gvSupplier.Rows.Count; i++) ...{ CheckBox myCb = (CheckBox)(this.gvSupplier.Rows[i].Cells[10].FindControl( "cbSelect ")); if (myCb.Checked) ...{ count++; HyperLink hl = (HyperLink)(this.gvSupplier.Rows[i].Cells[7].Controls[0]); int suppId = int.Parse(hl.Text.ToString()); string sqlString = "delete from Supplier where SuppId= " + suppId; this.ExecuteSql(sqlString); } } if (count >0) ...{ this.Alert( "你成功删除了 " + count + "条数据 ", this.Page); this.BindGvSupplier(); } } |