private void tsbDel_Click(object sender, EventArgs e) { try { if (!MyLove.PermissionsBalidation(this.Text, "02")) { return; } if (this.dataGrid1.CurrentRow() != null) { string sheet_no = this.dataGrid1.CurrentRow()["sheet_no"].ToString(); if (YesNoForm.ShowFrom("确认删除单据" + sheet_no + "?") == DialogResult.Yes) { IBLL.IInOutBLL bll = new BLL.InOutBLL(); bll.DeleteCGOrder(sheet_no, update_time); var tb = this.dataGrid1.DataSource; tb.Rows.Remove(this.dataGrid1.CurrentRow()); this.dataGrid2.DataSource = new DataTable(); this.dataGrid1.Refresh(); } } } catch (Exception ex) { MsgForm.ShowFrom(ex); Helper.LogHelper.writeLog("frmCGInSheetList->tsbDel_Click()", ex.ToString()); } }