private void butDelete_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete entire order?")) { return; } SupplyOrders.DeleteObject(SupplyOrderCur); DialogResult = DialogResult.OK; }
private void butDelete_Click(object sender, EventArgs e) { //if(Order.IsNew){//never // DialogResult=DialogResult.Cancel; //} if (textDatePlaced.Text != "") { MsgBox.Show(this, "Not allowed to delete unless date is blank."); return; } if (!MsgBox.Show(this, true, "Delete entire order?")) { return; } SupplyOrders.DeleteObject(Order); DialogResult = DialogResult.OK; }