/// <summary> /// 删除 /// </summary> protected void DeleteButton_Click(object sender, EventArgs e) { bool deleted = false; try { using (ContractProvider contProvider = new ContractProvider()) { foreach (GridViewRow row in List.Rows) { HtmlInputCheckBox rowCheckControl = (HtmlInputCheckBox)row.FindControl("RowCheck"); if (rowCheckControl.Checked) { string facNo = List.DataKeys[row.RowIndex]["avend"].ToString().Trim(); contProvider.DeleteFactory(facNo); //有项被删除 deleted = true; } } } } catch (Exception error) { this.ShowErrorMessage(this.GetGlobalResourceString("DeleteErrorMessage") + error.Message); return; } if (deleted) { this.BindList(); } else { this.ShowInfoMessage(this.GetGlobalResourceString("NotSelectMessage")); } }