public void Delete(object obj, EventArgs e) { try { if (m_stocktaking.ID > 0) { this.Cursor = Cursors.WaitCursor; if (KryptonMessageBox.Show("Are you sure to delete this record?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) { this.Cursor = Cursors.Default; return; } r_stocktaking.Delete(m_stocktaking); ClearForm(); setEnableForm(true); setEditMode(EditMode.New); textBoxCode.Focus(); this.Cursor = Cursors.Default; } } catch (Exception x) { KryptonMessageBox.Show(x.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { this.Cursor = Cursors.Default; } }
private void Delete() { m_stRep.Delete(new StockTaking(3)); }